@datalayer/core 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli-login.js +5 -51
- package/lib/components/anonymous/AnonymousKeyExpired.js +1 -15
- package/lib/components/anonymous/AnonymousKeyTimer.js +5 -15
- package/lib/components/auth/SignIn.js +2 -2
- package/lib/components/avatars/UserAvatar.js +3 -27
- package/lib/components/billing/BillingEntitySelect.js +6 -48
- package/lib/components/checkout/StripeCheckout.js +33 -217
- package/lib/components/contents/ContentSourceCard.js +2 -11
- package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +1 -1
- package/lib/components/contents/HomeFolderObjectsBrowser.js +11 -35
- package/lib/components/display/CenteredSpinner.js +1 -6
- package/lib/components/display/DatalayerBox.js +2 -14
- package/lib/components/flashes/FlashClosable.js +2 -17
- package/lib/components/mcp/ClientBadge.js +1 -1
- package/lib/components/mcp/McpErrorBlankslate.js +1 -1
- package/lib/components/mcp/ScopeList.js +1 -1
- package/lib/components/notebooks/JupyterNotebook.js +1 -2
- package/lib/components/principal/Principal.js +2 -10
- package/lib/components/principal/PrincipalAppearance.js +19 -63
- package/lib/components/principal/PrincipalAvatar.js +5 -25
- package/lib/components/principal/PrincipalBadge.js +3 -13
- package/lib/components/principal/PrincipalBanner.js +4 -32
- package/lib/components/principal/PrincipalDetailsOverlay.js +7 -23
- package/lib/components/principal/PrincipalHoverCard.js +15 -18
- package/lib/components/principal/PrincipalSwitcherMenu.js +15 -83
- package/lib/components/progress/ConsumptionBar.js +1 -1
- package/lib/components/sharing/ShareAccessComponent.js +21 -229
- package/lib/components/sharing/SharingEditor.js +1 -1
- package/lib/components/spaces/SpaceDetailsOverlay.js +4 -35
- package/lib/components/spaces/SpaceDisplay.js +1 -8
- package/lib/components/storage/ContentsBrowser.js +3 -26
- package/lib/components/storage/ContentsTable.js +4 -23
- package/lib/components/students/StudentResultCircle.js +7 -29
- package/lib/components/timeline/Timeline.js +4 -36
- package/lib/hooks/layouts/LayoutBackdrop.js +2 -1
- package/lib/hooks/layouts/LayoutScreencapture.js +1 -1
- package/lib/hooks/libraryApp.d.ts +6 -1
- package/lib/hooks/libraryApp.js +10 -1
- package/lib/hooks/useAuthorization.js +6 -1
- package/lib/mocks/components/FlashMock.js +3 -8
- package/lib/mocks/views/DashboardMock.js +6 -72
- package/lib/mocks/views/FormMock.js +3 -2
- package/lib/mocks/views/TableMock.js +3 -2
- package/lib/mocks/views/WipMock.js +2 -1
- package/lib/models/Person.d.ts +9 -0
- package/lib/models/Person.js +23 -0
- package/lib/otel/views/OtelLive.js +4 -62
- package/lib/otel/views/OtelLiveSpans.js +4 -29
- package/lib/otel/views/OtelLogsList.js +13 -64
- package/lib/otel/views/OtelMetricsChart.js +4 -19
- package/lib/otel/views/OtelMetricsList.js +8 -77
- package/lib/otel/views/OtelSearchBar.js +3 -12
- package/lib/otel/views/OtelSpanDetail.js +9 -79
- package/lib/otel/views/OtelSpanTree.js +7 -57
- package/lib/otel/views/OtelSqlView.js +5 -99
- package/lib/otel/views/OtelSystemView.js +4 -34
- package/lib/otel/views/OtelTimeline.js +7 -37
- package/lib/otel/views/OtelTimelineRangeSlider.js +7 -140
- package/lib/otel/views/OtelTracesList.js +12 -76
- package/lib/portable/index.d.ts +8 -0
- package/lib/portable/index.js +12 -0
- package/lib/state/substates/NavigationState.d.ts +6 -4
- package/lib/state/substates/NavigationState.js +6 -5
- package/lib/views/api-keys/APIKeyEdit.js +2 -11
- package/lib/views/api-keys/APIKeyNew.js +3 -19
- package/lib/views/api-keys/APIKeys.js +6 -11
- package/lib/views/api-keys/APIKeysStandalone.js +1 -1
- package/lib/views/datasources/DatasourceDetail.d.ts +1 -1
- package/lib/views/datasources/DatasourceDetail.js +24 -17
- package/lib/views/datasources/DatasourceNew.js +2 -6
- package/lib/views/datasources/Datasources.js +2 -14
- package/lib/views/iam/SignInSimple.js +8 -64
- package/lib/views/mcp/AdmittedClients.js +3 -16
- package/lib/views/mcp/AlertDestinations.js +2 -10
- package/lib/views/mcp/AlertRules.js +4 -9
- package/lib/views/mcp/ApprovalQueue.js +4 -21
- package/lib/views/mcp/AuditLog.js +7 -44
- package/lib/views/mcp/ConnectedAgents.js +1 -6
- package/lib/views/mcp/EnterpriseConsole.js +10 -23
- package/lib/views/mcp/IdentityProviders.js +7 -31
- package/lib/views/mcp/McpDashboard.js +14 -30
- package/lib/views/mcp/McpHome.js +7 -54
- package/lib/views/mcp/McpObservability.js +13 -85
- package/lib/views/mcp/NotebookRuns.js +5 -12
- package/lib/views/mcp/OrganizationPolicy.js +3 -9
- package/lib/views/mcp/OrganizationUsage.js +4 -11
- package/lib/views/mcp/PersonalPolicy.js +3 -3
- package/lib/views/mcp/Policies.js +5 -46
- package/lib/views/mcp/PolicyForm.js +1 -9
- package/lib/views/mcp/PolicyHistory.js +2 -8
- package/lib/views/mcp/RunDetail.js +3 -25
- package/lib/views/mcp/ScimProvisioning.js +3 -15
- package/lib/views/mcp/ServiceAgents.js +4 -17
- package/lib/views/mcp/TeamPolicies.js +7 -19
- package/lib/views/mcp/ToolAccess.js +15 -22
- package/lib/views/mcp/TraceTimeline.js +8 -23
- package/lib/views/otel/DashboardView.js +2 -2
- package/lib/views/otel/LogsView.js +2 -2
- package/lib/views/otel/MetricsView.js +2 -2
- package/lib/views/otel/OtelHeader.js +6 -40
- package/lib/views/otel/SqlView.js +2 -2
- package/lib/views/otel/SystemView.js +2 -2
- package/lib/views/otel/TracesView.js +2 -2
- package/lib/views/profile/UserBadge.js +6 -98
- package/lib/views/secrets/SecretEdit.js +2 -11
- package/lib/views/secrets/SecretNew.js +1 -1
- package/package.json +1 -1
|
@@ -122,7 +122,9 @@ function StripePaymentForm({ clientSecret, intentType = 'payment', onPaymentSucc
|
|
|
122
122
|
},
|
|
123
123
|
};
|
|
124
124
|
}, [themeIsDark]);
|
|
125
|
-
const handleSubmit = useCallback(
|
|
125
|
+
const handleSubmit = useCallback(
|
|
126
|
+
// A Box drawn as a form hands an HTMLElement's submit event.
|
|
127
|
+
async (event) => {
|
|
126
128
|
event.preventDefault();
|
|
127
129
|
if (!stripe || !elements) {
|
|
128
130
|
return;
|
|
@@ -166,7 +168,7 @@ function StripePaymentForm({ clientSecret, intentType = 'payment', onPaymentSucc
|
|
|
166
168
|
}
|
|
167
169
|
setIsSubmitting(false);
|
|
168
170
|
}, [clientSecret, elements, onPaymentSucceeded, stripe]);
|
|
169
|
-
return (_jsxs(Box, { as: "form", onSubmit: handleSubmit,
|
|
171
|
+
return (_jsxs(Box, { as: "form", onSubmit: handleSubmit, display: "grid", gap: 3, children: [_jsx(CardElement, { options: cardOptions, onReady: element => {
|
|
170
172
|
try {
|
|
171
173
|
element.focus();
|
|
172
174
|
}
|
|
@@ -844,49 +846,15 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
844
846
|
marginBottom: 'var(--stack-gap-normal)',
|
|
845
847
|
};
|
|
846
848
|
const shouldShowMonthlySubscriptionSection = !isPaidSubscription || isIncompleteSubscription;
|
|
847
|
-
const monthlySubscriptionSection = shouldShowMonthlySubscriptionSection ? (_jsxs(Box, { sx: {
|
|
848
|
-
borderTop: 'none',
|
|
849
|
-
paddingTop: 0,
|
|
850
|
-
}, children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Choose a monthly plan" }), isIncompleteSubscription ? (_jsxs(_Fragment, { children: [_jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "A pending plan change already exists. Complete payment or cancel it from the billing portal before creating a new one." }), _jsxs(Box, { sx: {
|
|
851
|
-
display: 'flex',
|
|
852
|
-
gap: 'var(--stack-gap-condensed)',
|
|
853
|
-
flexWrap: 'wrap',
|
|
854
|
-
marginTop: 'var(--stack-gap-normal)',
|
|
855
|
-
}, children: [_jsx(Button, { variant: "primary", onClick: startPendingSubscriptionCheckout, disabled: subscriptionPaymentIntentMutation.isPending ||
|
|
849
|
+
const monthlySubscriptionSection = shouldShowMonthlySubscriptionSection ? (_jsxs(Box, { borderTop: "none", paddingTop: 0, children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Choose a monthly plan" }), isIncompleteSubscription ? (_jsxs(_Fragment, { children: [_jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "A pending plan change already exists. Complete payment or cancel it from the billing portal before creating a new one." }), _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", marginTop: "var(--stack-gap-normal)", children: [_jsx(Button, { variant: "primary", onClick: startPendingSubscriptionCheckout, disabled: subscriptionPaymentIntentMutation.isPending ||
|
|
856
850
|
checkout ||
|
|
857
851
|
!pendingSubscriptionPlan, children: subscriptionPaymentIntentMutation.isPending
|
|
858
852
|
? 'Preparing checkout...'
|
|
859
|
-
: 'Continue pending payment' }), _jsx(Button, { variant: "danger", onClick: onCancelSubscription, children: "Cancel pending plan change" })] }), cancelViewOpen && (_jsxs(Box, { sx: {
|
|
860
|
-
marginTop: 'var(--stack-gap-normal)',
|
|
861
|
-
border: '1px solid',
|
|
862
|
-
borderColor: 'border.default',
|
|
863
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
864
|
-
backgroundColor: 'canvas.subtle',
|
|
865
|
-
padding: 'var(--stack-padding-normal)',
|
|
866
|
-
display: 'grid',
|
|
867
|
-
gap: 'var(--stack-gap-condensed)',
|
|
868
|
-
}, children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Cancel pending plan change" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "This pending plan change will be canceled immediately." }), _jsxs(Box, { sx: {
|
|
869
|
-
display: 'flex',
|
|
870
|
-
gap: 'var(--stack-gap-condensed)',
|
|
871
|
-
flexWrap: 'wrap',
|
|
872
|
-
}, children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isCancelActionPending
|
|
853
|
+
: 'Continue pending payment' }), _jsx(Button, { variant: "danger", onClick: onCancelSubscription, children: "Cancel pending plan change" })] }), cancelViewOpen && (_jsxs(Box, { marginTop: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.subtle", padding: "var(--stack-padding-normal)", display: "grid", gap: "var(--stack-gap-condensed)", children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Cancel pending plan change" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "This pending plan change will be canceled immediately." }), _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isCancelActionPending
|
|
873
854
|
? 'Canceling pending plan change...'
|
|
874
|
-
: 'Confirm cancel pending plan change' }), _jsx(Button, { variant: "default", onClick: onAbortCancelView, disabled: isCancelActionPending, children: "Keep pending plan change" })] })] }))] })) : !isPaidSubscription ? (_jsxs(_Fragment, { children: [_jsxs(Box, { role: "radiogroup",
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
maxHeight: '260px',
|
|
878
|
-
overflowY: 'auto',
|
|
879
|
-
marginBottom: 'var(--stack-gap-normal)',
|
|
880
|
-
}, children: [plans.map(plan => (_jsx(Box, { role: "radio", "aria-labelledby": `subscription-plan-${plan.id}`, "aria-checked": subscriptionPlan?.id === plan.id, onClick: () => setSubscriptionPlan(plan), sx: {
|
|
881
|
-
borderStyle: 'solid',
|
|
882
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
883
|
-
borderWidth: 'var(--borderWidth-thick)',
|
|
884
|
-
borderColor: subscriptionPlan?.id === plan.id
|
|
885
|
-
? 'var(--borderColor-accent-emphasis)'
|
|
886
|
-
: 'var(--borderColor-default)',
|
|
887
|
-
padding: 'var(--stack-padding-condensed)',
|
|
888
|
-
cursor: 'pointer',
|
|
889
|
-
}, children: _jsxs(FormControl, { sx: { alignItems: 'center' }, children: [_jsx(FormControl.Label, { id: `subscription-plan-${plan.id}`, sx: { alignSelf: 'center' }, children: plan.name }), _jsxs(Text, { as: "p", children: [new Intl.NumberFormat(undefined, {
|
|
855
|
+
: 'Confirm cancel pending plan change' }), _jsx(Button, { variant: "default", onClick: onAbortCancelView, disabled: isCancelActionPending, children: "Keep pending plan change" })] })] }))] })) : !isPaidSubscription ? (_jsxs(_Fragment, { children: [_jsxs(Box, { role: "radiogroup", display: "grid", gap: "var(--stack-gap-condensed)", maxHeight: "260px", overflowY: "auto", marginBottom: "var(--stack-gap-normal)", children: [plans.map(plan => (_jsx(Box, { role: "radio", "aria-labelledby": `subscription-plan-${plan.id}`, "aria-checked": subscriptionPlan?.id === plan.id, onClick: () => setSubscriptionPlan(plan), borderStyle: "solid", borderRadius: "medium", borderWidth: "var(--borderWidth-thick)", borderColor: subscriptionPlan?.id === plan.id
|
|
856
|
+
? 'var(--borderColor-accent-emphasis)'
|
|
857
|
+
: 'border.default', padding: "var(--stack-padding-condensed)", cursor: "pointer", children: _jsxs(FormControl, { sx: { alignItems: 'center' }, children: [_jsx(FormControl.Label, { id: `subscription-plan-${plan.id}`, sx: { alignSelf: 'center' }, children: plan.name }), _jsxs(Text, { as: "p", children: [new Intl.NumberFormat(undefined, {
|
|
890
858
|
style: 'currency',
|
|
891
859
|
currency: plan.currency,
|
|
892
860
|
}).format((plan.amount || 0) / 100), plan.interval ? ` / ${plan.interval}` : ''] }), typeof plan.included_runs === 'number' && (_jsxs(Text, { as: "p", children: [plan.included_runs, " included runs"] }))] }) }, plan.id))), plans.length === 0 && (_jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "No monthly plans available right now." }))] }), _jsx(Button, { variant: "primary", onClick: () => void startSubscriptionCheckout(), disabled: !subscriptionPlan ||
|
|
@@ -894,26 +862,13 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
894
862
|
checkout, children: subscriptionPaymentIntentMutation.isPending
|
|
895
863
|
? 'Preparing Team plan checkout...'
|
|
896
864
|
: 'Upgrade to Team Plan' })] })) : null] })) : null;
|
|
897
|
-
const topUpSection = (_jsxs(Box, { children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Topup your wallet with credits" }), _jsx(Box, { role: "radiogroup",
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
gridTemplateColumns: Array(sortedTopUpItems.length)
|
|
901
|
-
.fill('1fr')
|
|
902
|
-
.join(' '),
|
|
903
|
-
padding: 0,
|
|
904
|
-
marginBottom: 'var(--stack-gap-normal)',
|
|
905
|
-
}, children: sortedTopUpItems.map(item => (_jsx(Box, { role: "radio", "aria-labelledby": `checkout-price-${item.id}`, "aria-checked": product?.id === item.id, onClick: () => {
|
|
865
|
+
const topUpSection = (_jsxs(Box, { children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Topup your wallet with credits" }), _jsx(Box, { role: "radiogroup", display: "grid", gap: "var(--stack-gap-normal)", gridTemplateColumns: Array(sortedTopUpItems.length)
|
|
866
|
+
.fill('1fr')
|
|
867
|
+
.join(' '), padding: 0, marginBottom: "var(--stack-gap-normal)", children: sortedTopUpItems.map(item => (_jsx(Box, { role: "radio", "aria-labelledby": `checkout-price-${item.id}`, "aria-checked": product?.id === item.id, onClick: () => {
|
|
906
868
|
setProduct(item);
|
|
907
|
-
},
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
borderWidth: 'var(--borderWidth-thick)',
|
|
911
|
-
borderColor: product?.id === item.id
|
|
912
|
-
? 'var(--borderColor-accent-emphasis)'
|
|
913
|
-
: 'var(--borderColor-default)',
|
|
914
|
-
padding: 'var(--stack-padding-condensed)',
|
|
915
|
-
cursor: 'pointer',
|
|
916
|
-
}, children: _jsxs(FormControl, { sx: {
|
|
869
|
+
}, borderStyle: "solid", borderRadius: "medium", borderWidth: "var(--borderWidth-thick)", borderColor: product?.id === item.id
|
|
870
|
+
? 'var(--borderColor-accent-emphasis)'
|
|
871
|
+
: 'border.default', padding: "var(--stack-padding-condensed)", cursor: "pointer", children: _jsxs(FormControl, { sx: {
|
|
917
872
|
alignItems: 'center',
|
|
918
873
|
}, children: [_jsx(FormControl.Label, { id: `checkout-price-${item.id}`, sx: { alignSelf: 'center' }, children: item.name }), _jsx(Text, { as: "p", children: new Intl.NumberFormat(undefined, {
|
|
919
874
|
style: 'currency',
|
|
@@ -923,38 +878,10 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
923
878
|
}, disabled: product === null || topUpPaymentIntentMutation.isPending || checkout, sx: { float: 'right' }, children: topUpPaymentIntentMutation.isPending
|
|
924
879
|
? 'Preparing top-up checkout...'
|
|
925
880
|
: 'Checkout' }), topUpConfirmation ? (_jsxs(Flash, { variant: "success", sx: { mt: 3 }, children: [_jsxs(Text, { as: "p", sx: { fontWeight: 'bold' }, children: ["Top-up confirmed: +", topUpConfirmation.purchasedCredits.toLocaleString(), " credits"] }), _jsx(Text, { as: "p", children: `Wallet balance: ${topUpConfirmation.oldWalletBalance.toLocaleString()} to ${topUpConfirmation.newWalletBalance.toLocaleString()}` }), _jsx(Text, { as: "p", children: `Available credits: ${topUpConfirmation.oldAvailableCredits.toLocaleString()} to ${topUpConfirmation.newAvailableCredits.toLocaleString()}` })] })) : null] }));
|
|
926
|
-
const topCards = showStatusUsageSummary && !isPaidSubscription ? (_jsx(Box, { sx: {
|
|
927
|
-
marginBottom: 'var(--stack-gap-normal)',
|
|
928
|
-
border: '1px solid',
|
|
929
|
-
borderColor: 'border.default',
|
|
930
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
931
|
-
backgroundColor: 'canvas.default',
|
|
932
|
-
padding: 'var(--stack-padding-normal)',
|
|
933
|
-
display: 'grid',
|
|
934
|
-
gap: 'var(--stack-gap-normal)',
|
|
935
|
-
}, children: _jsx(Box, { sx: {
|
|
936
|
-
display: 'grid',
|
|
937
|
-
gap: 'var(--stack-gap-normal)',
|
|
938
|
-
gridTemplateColumns: ['1fr'],
|
|
939
|
-
alignItems: 'start',
|
|
940
|
-
}, children: _jsxs(Box, { children: [_jsx(Text, { as: "h3", sx: {
|
|
881
|
+
const topCards = showStatusUsageSummary && !isPaidSubscription ? (_jsx(Box, { marginBottom: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.default", padding: "var(--stack-padding-normal)", display: "grid", gap: "var(--stack-gap-normal)", children: _jsx(Box, { display: "grid", gap: "var(--stack-gap-normal)", gridTemplateColumns: ['1fr'], alignItems: "start", children: _jsxs(Box, { children: [_jsx(Text, { as: "h3", sx: {
|
|
941
882
|
fontWeight: 'bold',
|
|
942
883
|
marginBottom: 'var(--stack-gap-condensed)',
|
|
943
|
-
}, children: "Plan status" }), _jsxs(Text, { as: "p", children: ["Plan: ", String(currentSubscriptionPlan)] }), isPendingSubscriptionCheckout && (_jsx(Flash, { variant: "warning", sx: { marginTop: 'var(--stack-gap-condensed)' }, children: "Upgrade pending payment. Your Team plan is not active until card payment succeeds." })), currentPlanPriceLabel !== 'N/A' && (_jsxs(Text, { as: "p", children: ["Price: ", currentPlanPriceLabel] })), displaySubscriptionStatus && (_jsxs(Text, { as: "p", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Status: ", displaySubscriptionStatus] })), _jsxs(Box, { sx: {
|
|
944
|
-
marginBottom: 'var(--stack-gap-normal)',
|
|
945
|
-
border: '1px solid',
|
|
946
|
-
borderColor: 'border.muted',
|
|
947
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
948
|
-
backgroundColor: 'canvas.subtle',
|
|
949
|
-
padding: 'var(--stack-padding-condensed)',
|
|
950
|
-
display: 'grid',
|
|
951
|
-
gap: 'var(--stack-gap-condensed)',
|
|
952
|
-
}, children: [_jsxs(Box, { sx: {
|
|
953
|
-
display: 'flex',
|
|
954
|
-
alignItems: 'center',
|
|
955
|
-
justifyContent: 'space-between',
|
|
956
|
-
gap: 2,
|
|
957
|
-
}, children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Current usage" }), _jsx(Label, { size: "small", children: String(currentSubscriptionPlan) })] }), _jsxs(Box, { children: [_jsxs(Text, { as: "p", sx: {
|
|
884
|
+
}, children: "Plan status" }), _jsxs(Text, { as: "p", children: ["Plan: ", String(currentSubscriptionPlan)] }), isPendingSubscriptionCheckout && (_jsx(Flash, { variant: "warning", sx: { marginTop: 'var(--stack-gap-condensed)' }, children: "Upgrade pending payment. Your Team plan is not active until card payment succeeds." })), currentPlanPriceLabel !== 'N/A' && (_jsxs(Text, { as: "p", children: ["Price: ", currentPlanPriceLabel] })), displaySubscriptionStatus && (_jsxs(Text, { as: "p", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Status: ", displaySubscriptionStatus] })), _jsxs(Box, { marginBottom: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.muted", borderRadius: "medium", backgroundColor: "canvas.subtle", padding: "var(--stack-padding-condensed)", display: "grid", gap: "var(--stack-gap-condensed)", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Current usage" }), _jsx(Label, { size: "small", children: String(currentSubscriptionPlan) })] }), _jsxs(Box, { children: [_jsxs(Text, { as: "p", sx: {
|
|
958
885
|
marginBottom: 'var(--stack-gap-condensed)',
|
|
959
886
|
color: isRunsOverQuota ? 'danger.fg' : 'fg.default',
|
|
960
887
|
fontWeight: isRunsOverQuota ? 'bold' : 'normal',
|
|
@@ -964,25 +891,7 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
964
891
|
backgroundColor: 'var(--bgColor-accent-emphasis)',
|
|
965
892
|
}, "aria-label": `Remaining: ${runsSegments.remainingPct.toFixed(1)}%` }), _jsx(ProgressBar.Item, { progress: runsSegments.overPct, style: {
|
|
966
893
|
backgroundColor: 'var(--bgColor-danger-emphasis)',
|
|
967
|
-
}, "aria-label": `Over quota: ${runsSegments.overPct.toFixed(1)}%` })] }), _jsxs(Box, { sx: {
|
|
968
|
-
display: 'flex',
|
|
969
|
-
alignItems: 'center',
|
|
970
|
-
gap: 3,
|
|
971
|
-
mt: 1,
|
|
972
|
-
flexWrap: 'wrap',
|
|
973
|
-
}, children: [_jsxs(Box, { sx: {
|
|
974
|
-
display: 'inline-flex',
|
|
975
|
-
alignItems: 'center',
|
|
976
|
-
gap: 1,
|
|
977
|
-
}, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-success-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Used in quota" })] }), _jsxs(Box, { sx: {
|
|
978
|
-
display: 'inline-flex',
|
|
979
|
-
alignItems: 'center',
|
|
980
|
-
gap: 1,
|
|
981
|
-
}, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-accent-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Remaining" })] }), _jsxs(Box, { sx: {
|
|
982
|
-
display: 'inline-flex',
|
|
983
|
-
alignItems: 'center',
|
|
984
|
-
gap: 1,
|
|
985
|
-
}, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-danger-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Over quota" })] })] })] }), periodProgress ? (_jsxs(Box, { children: [_jsxs(Text, { as: "p", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Usage period days: ", periodProgress.elapsedDays, " /", ' ', periodProgress.totalDays] }), _jsxs(ProgressBar, { barSize: "small", "aria-label": "Usage period progress", "aria-valuenow": periodProgress.elapsedPct, children: [_jsx(ProgressBar.Item, { progress: periodProgress.elapsedPct, style: {
|
|
894
|
+
}, "aria-label": `Over quota: ${runsSegments.overPct.toFixed(1)}%` })] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 3, mt: 1, flexWrap: "wrap", children: [_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-success-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Used in quota" })] }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-accent-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Remaining" })] }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(DotFillIcon, { fill: "var(--bgColor-danger-emphasis)" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Over quota" })] })] })] }), periodProgress ? (_jsxs(Box, { children: [_jsxs(Text, { as: "p", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Usage period days: ", periodProgress.elapsedDays, " /", ' ', periodProgress.totalDays] }), _jsxs(ProgressBar, { barSize: "small", "aria-label": "Usage period progress", "aria-valuenow": periodProgress.elapsedPct, children: [_jsx(ProgressBar.Item, { progress: periodProgress.elapsedPct, style: {
|
|
986
895
|
backgroundColor: 'var(--bgColor-success-emphasis)',
|
|
987
896
|
}, "aria-label": `Elapsed: ${periodProgress.elapsedPct.toFixed(1)}%` }), _jsx(ProgressBar.Item, { progress: periodProgress.remainingPct, style: {
|
|
988
897
|
backgroundColor: 'var(--bgColor-accent-emphasis)',
|
|
@@ -993,11 +902,7 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
993
902
|
}, children: [periodProgress.remainingDays, " day(s) remaining in current period"] })] })) : null, _jsxs(Box, { children: [_jsxs(Text, { as: "p", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Wallet balance: ", displayedWalletBalance.toLocaleString()] }), _jsxs(Text, { as: "p", sx: { color: 'fg.muted' }, children: ["Spent credits in current period:", ' ', usedCredits.toLocaleString(undefined, {
|
|
994
903
|
minimumFractionDigits: 2,
|
|
995
904
|
maximumFractionDigits: 2,
|
|
996
|
-
})] }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "Wallet credits are additive on renewal and top-ups." })] })] }), isCancellationScheduled && (_jsxs(Flash, { variant: "warning", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Plan will switch to Free at the end of the current period on", ' ', subscriptionPeriodEndLabel, "."] })), _jsxs(Box, {
|
|
997
|
-
display: 'flex',
|
|
998
|
-
gap: 'var(--stack-gap-condensed)',
|
|
999
|
-
flexWrap: 'wrap',
|
|
1000
|
-
}, children: [subscriptionPortalUrl && (_jsx(Button, { variant: "default", onClick: () => openPortal(subscriptionPortalUrl), children: "Open Stripe billing portal" })), _jsx(Button, { variant: "default", onClick: () => void onRefreshSubscriptionStatus(), disabled: isSubscriptionStatusRefreshing, children: isSubscriptionStatusRefreshing
|
|
905
|
+
})] }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "Wallet credits are additive on renewal and top-ups." })] })] }), isCancellationScheduled && (_jsxs(Flash, { variant: "warning", sx: { marginBottom: 'var(--stack-gap-condensed)' }, children: ["Plan will switch to Free at the end of the current period on", ' ', subscriptionPeriodEndLabel, "."] })), _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", children: [subscriptionPortalUrl && (_jsx(Button, { variant: "default", onClick: () => openPortal(subscriptionPortalUrl), children: "Open Stripe billing portal" })), _jsx(Button, { variant: "default", onClick: () => void onRefreshSubscriptionStatus(), disabled: isSubscriptionStatusRefreshing, children: isSubscriptionStatusRefreshing
|
|
1001
906
|
? 'Refreshing status...'
|
|
1002
907
|
: 'Refresh status' }), canCancelSubscription && !cancelViewOpen && (_jsx(Button, { variant: "danger", onClick: onCancelSubscription, children: "Downgrade to Free Plan" })), isIncompleteSubscription && !cancelViewOpen && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "primary", onClick: startPendingSubscriptionCheckout, disabled: subscriptionPaymentIntentMutation.isPending ||
|
|
1003
908
|
checkout ||
|
|
@@ -1009,24 +914,11 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
1009
914
|
? 'Your payment is pending. Open the in-app cancel view below to cancel this plan change or continue with payment.'
|
|
1010
915
|
: isPaidSubscription
|
|
1011
916
|
? 'Keep your plan active. You can top-up credits any time.'
|
|
1012
|
-
: 'Top-up credits are available on Free and Team plans.'] }), cancelViewOpen && (_jsxs(Box, { sx: {
|
|
1013
|
-
marginTop: 'var(--stack-gap-normal)',
|
|
1014
|
-
border: '1px solid',
|
|
1015
|
-
borderColor: 'border.default',
|
|
1016
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
1017
|
-
backgroundColor: 'canvas.subtle',
|
|
1018
|
-
padding: 'var(--stack-padding-normal)',
|
|
1019
|
-
display: 'grid',
|
|
1020
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1021
|
-
}, children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: isIncompleteSubscription
|
|
917
|
+
: 'Top-up credits are available on Free and Team plans.'] }), cancelViewOpen && (_jsxs(Box, { marginTop: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.subtle", padding: "var(--stack-padding-normal)", display: "grid", gap: "var(--stack-gap-condensed)", children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: isIncompleteSubscription
|
|
1022
918
|
? 'Cancel pending plan change'
|
|
1023
919
|
: 'Downgrade to Free Plan' }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: isIncompleteSubscription
|
|
1024
920
|
? 'This pending plan change will be canceled immediately.'
|
|
1025
|
-
: 'Your plan will switch at the end of the current usage period.' }), _jsxs(Box, {
|
|
1026
|
-
display: 'flex',
|
|
1027
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1028
|
-
flexWrap: 'wrap',
|
|
1029
|
-
}, children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? (_jsx(Spinner, { size: "small" })) : undefined, children: isCancelActionPending
|
|
921
|
+
: 'Your plan will switch at the end of the current usage period.' }), _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? (_jsx(Spinner, { size: "small" })) : undefined, children: isCancelActionPending
|
|
1030
922
|
? isIncompleteSubscription
|
|
1031
923
|
? 'Canceling pending plan change...'
|
|
1032
924
|
: 'Waiting for confirmation...'
|
|
@@ -1035,47 +927,16 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
1035
927
|
: 'Confirm downgrade' }), _jsx(Button, { variant: "default", onClick: onAbortCancelView, disabled: isCancelActionPending, children: isIncompleteSubscription
|
|
1036
928
|
? 'Keep pending plan change'
|
|
1037
929
|
: 'Keep current plan' })] })] }))] }) }) })) : null;
|
|
1038
|
-
const currentPlanSection = isPaidSubscription ? (_jsx(Box, { sx: {
|
|
1039
|
-
borderRight: ['none', '1px solid'],
|
|
1040
|
-
borderColor: 'border.muted',
|
|
1041
|
-
paddingRight: ['0', 'var(--stack-gap-normal)'],
|
|
1042
|
-
alignSelf: 'stretch',
|
|
1043
|
-
}, children: _jsxs(Box, { sx: {
|
|
1044
|
-
borderTop: 'none',
|
|
1045
|
-
paddingTop: 0,
|
|
1046
|
-
display: 'grid',
|
|
1047
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1048
|
-
}, children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Current plan" }), _jsx(Text, { as: "h4", sx: { fontSize: 3, fontWeight: 'bold' }, children: String(currentSubscriptionPlan) }), _jsxs(Text, { as: "p", sx: { color: 'fg.muted' }, children: ["You are currently on ", String(currentSubscriptionPlan), "."] }), currentPlanPriceLabel !== 'N/A' && (_jsx(Text, { as: "p", sx: { fontWeight: 'bold', fontSize: 2 }, children: currentPlanPriceLabel })), displaySubscriptionStatus && (_jsx(Box, { sx: { display: 'inline-flex', alignItems: 'center' }, children: _jsx(Label, { variant: "success", children: displaySubscriptionStatus }) })), isCancellationScheduled ? (_jsxs(Flash, { variant: "warning", sx: { marginTop: 'var(--stack-gap-condensed)' }, children: ["Your downgrade to Free Plan is scheduled at period end on", ' ', subscriptionPeriodEndLabel, "."] })) : null, !isCancellationScheduled || showResumeAction ? (_jsx(Text, { as: "p", sx: { color: 'fg.muted', marginTop: 'var(--stack-gap-condensed)' }, children: showResumeAction
|
|
930
|
+
const currentPlanSection = isPaidSubscription ? (_jsx(Box, { borderRight: ['none', '1px solid'], borderColor: "border.muted", paddingRight: ['0', 'var(--stack-gap-normal)'], alignSelf: "stretch", children: _jsxs(Box, { borderTop: "none", paddingTop: 0, display: "grid", gap: "var(--stack-gap-condensed)", children: [_jsx(Text, { as: "h3", sx: sectionTitleSx, children: "Current plan" }), _jsx(Text, { as: "h4", sx: { fontSize: 3, fontWeight: 'bold' }, children: String(currentSubscriptionPlan) }), _jsxs(Text, { as: "p", sx: { color: 'fg.muted' }, children: ["You are currently on ", String(currentSubscriptionPlan), "."] }), currentPlanPriceLabel !== 'N/A' && (_jsx(Text, { as: "p", sx: { fontWeight: 'bold', fontSize: 2 }, children: currentPlanPriceLabel })), displaySubscriptionStatus && (_jsx(Box, { display: "inline-flex", alignItems: "center", children: _jsx(Label, { variant: "success", children: displaySubscriptionStatus }) })), isCancellationScheduled ? (_jsxs(Flash, { variant: "warning", sx: { marginTop: 'var(--stack-gap-condensed)' }, children: ["Your downgrade to Free Plan is scheduled at period end on", ' ', subscriptionPeriodEndLabel, "."] })) : null, !isCancellationScheduled || showResumeAction ? (_jsx(Text, { as: "p", sx: { color: 'fg.muted', marginTop: 'var(--stack-gap-condensed)' }, children: showResumeAction
|
|
1049
931
|
? 'Possible action: Resume Team Plan.'
|
|
1050
|
-
: 'Possible action: Downgrade to Free Plan.' })) : null, _jsxs(Box, { sx: {
|
|
1051
|
-
display: 'flex',
|
|
1052
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1053
|
-
flexWrap: 'wrap',
|
|
1054
|
-
}, children: [canCancelSubscription && !cancelViewOpen && (_jsx(Button, { variant: "danger", onClick: onCancelSubscription, children: "Downgrade to Free Plan" })), showResumeAction && (_jsx(Button, { variant: "primary", onClick: () => void onResumeSubscription(), disabled: isResumeActionPending, leadingVisual: () => isResumeActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isResumeActionPending ? 'Resuming...' : 'Resume plan' }))] }), cancelViewOpen && (_jsxs(Box, { sx: {
|
|
1055
|
-
marginTop: 'var(--stack-gap-normal)',
|
|
1056
|
-
border: '1px solid',
|
|
1057
|
-
borderColor: 'border.default',
|
|
1058
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
1059
|
-
backgroundColor: 'canvas.subtle',
|
|
1060
|
-
padding: 'var(--stack-padding-normal)',
|
|
1061
|
-
display: 'grid',
|
|
1062
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1063
|
-
}, children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Downgrade to Free Plan" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "Your plan will switch at the end of the current usage period." }), _jsxs(Box, { sx: {
|
|
1064
|
-
display: 'flex',
|
|
1065
|
-
gap: 'var(--stack-gap-condensed)',
|
|
1066
|
-
flexWrap: 'wrap',
|
|
1067
|
-
}, children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isCancelActionPending
|
|
932
|
+
: 'Possible action: Downgrade to Free Plan.' })) : null, _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", children: [canCancelSubscription && !cancelViewOpen && (_jsx(Button, { variant: "danger", onClick: onCancelSubscription, children: "Downgrade to Free Plan" })), showResumeAction && (_jsx(Button, { variant: "primary", onClick: () => void onResumeSubscription(), disabled: isResumeActionPending, leadingVisual: () => isResumeActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isResumeActionPending ? 'Resuming...' : 'Resume plan' }))] }), cancelViewOpen && (_jsxs(Box, { marginTop: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.subtle", padding: "var(--stack-padding-normal)", display: "grid", gap: "var(--stack-gap-condensed)", children: [_jsx(Text, { as: "h4", sx: { fontWeight: 'bold' }, children: "Downgrade to Free Plan" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted' }, children: "Your plan will switch at the end of the current usage period." }), _jsxs(Box, { display: "flex", gap: "var(--stack-gap-condensed)", flexWrap: "wrap", children: [_jsx(Button, { variant: "danger", onClick: () => void onConfirmCancelSubscription(), disabled: isCancelActionPending, leadingVisual: () => isCancelActionPending ? _jsx(Spinner, { size: "small" }) : undefined, children: isCancelActionPending
|
|
1068
933
|
? 'Waiting for confirmation...'
|
|
1069
934
|
: 'Confirm downgrade' }), _jsx(Button, { variant: "default", onClick: onAbortCancelView, disabled: isCancelActionPending, children: "Keep current plan" })] })] }))] }) })) : null;
|
|
1070
935
|
let view;
|
|
1071
936
|
// While the Stripe payment form is shown, disable interaction with the
|
|
1072
937
|
// status / plan picker cards behind it so the only available action is the
|
|
1073
938
|
// "Cancel" button next to the form.
|
|
1074
|
-
const disabledTopCards = topCards ? (_jsx(Box, { "aria-disabled": "true",
|
|
1075
|
-
pointerEvents: 'none',
|
|
1076
|
-
opacity: 0.5,
|
|
1077
|
-
userSelect: 'none',
|
|
1078
|
-
}, children: topCards })) : null;
|
|
939
|
+
const disabledTopCards = topCards ? (_jsx(Box, { "aria-disabled": "true", pointerEvents: "none", opacity: 0.5, userSelect: "none", children: topCards })) : null;
|
|
1079
940
|
if (checkout) {
|
|
1080
941
|
if (stripe && paymentOptions && paymentClientSecret) {
|
|
1081
942
|
view = createElement(Box, { id: 'checkout', sx: { flex: '1 1 auto', display: 'grid', gap: 3 } }, createElement(Box, {
|
|
@@ -1124,36 +985,14 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
1124
985
|
}))), disabledTopCards);
|
|
1125
986
|
}
|
|
1126
987
|
else {
|
|
1127
|
-
view = (_jsxs(Box, {
|
|
1128
|
-
border: '1px solid',
|
|
1129
|
-
borderColor: 'border.default',
|
|
1130
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
1131
|
-
backgroundColor: 'canvas.default',
|
|
1132
|
-
padding: 'var(--stack-padding-normal)',
|
|
1133
|
-
display: 'flex',
|
|
1134
|
-
gap: 'var(--stack-gap-normal)',
|
|
1135
|
-
alignItems: 'center',
|
|
1136
|
-
justifyContent: 'space-between',
|
|
1137
|
-
flexWrap: 'wrap',
|
|
1138
|
-
}, children: [_jsx(Text, { as: "p", children: "Preparing Stripe checkout\u2026" }), _jsx(Button, { variant: "default", onClick: cancelStripeCheckout, children: "Cancel" })] }), disabledTopCards] }));
|
|
988
|
+
view = (_jsxs(Box, { flex: "1 1 auto", display: "grid", gap: 3, children: [_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.default", padding: "var(--stack-padding-normal)", display: "flex", gap: "var(--stack-gap-normal)", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", children: [_jsx(Text, { as: "p", children: "Preparing Stripe checkout\u2026" }), _jsx(Button, { variant: "default", onClick: cancelStripeCheckout, children: "Cancel" })] }), disabledTopCards] }));
|
|
1139
989
|
}
|
|
1140
990
|
}
|
|
1141
991
|
else if (isReturningFromCheckout) {
|
|
1142
|
-
view = (_jsxs(Box, {
|
|
1143
|
-
border: '1px solid',
|
|
1144
|
-
borderColor: 'border.default',
|
|
1145
|
-
borderRadius: 'var(--borderRadius-medium)',
|
|
1146
|
-
backgroundColor: 'canvas.default',
|
|
1147
|
-
padding: 'var(--stack-padding-normal)',
|
|
1148
|
-
display: 'flex',
|
|
1149
|
-
gap: 'var(--stack-gap-normal)',
|
|
1150
|
-
alignItems: 'center',
|
|
1151
|
-
justifyContent: 'center',
|
|
1152
|
-
flexWrap: 'wrap',
|
|
1153
|
-
}, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { as: "p", children: "Refreshing plan status\u2026" })] }), disabledTopCards] }));
|
|
992
|
+
view = (_jsxs(Box, { flex: "1 1 auto", display: "grid", gap: 3, children: [_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.default", padding: "var(--stack-padding-normal)", display: "flex", gap: "var(--stack-gap-normal)", alignItems: "center", justifyContent: "center", flexWrap: "wrap", children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { as: "p", children: "Refreshing plan status\u2026" })] }), disabledTopCards] }));
|
|
1154
993
|
}
|
|
1155
994
|
else if (isTopUpPricesPending) {
|
|
1156
|
-
view = (_jsx(Box, {
|
|
995
|
+
view = (_jsx(Box, { minHeight: "40px", display: "grid", placeItems: "center", children: _jsx(Spinner, {}) }));
|
|
1157
996
|
}
|
|
1158
997
|
else if (isTopUpPricesError) {
|
|
1159
998
|
view = (_jsxs(Box, { children: [topCards, _jsx(Flash, { variant: "danger", children: topUpPricesError instanceof Error
|
|
@@ -1161,38 +1000,15 @@ export function StripeCheckout({ checkoutPortal, appearance, accountUid, showSta
|
|
|
1161
1000
|
: 'Unable to fetch the available products. Please try again later.' })] }));
|
|
1162
1001
|
}
|
|
1163
1002
|
else {
|
|
1164
|
-
view = items.length ? (_jsxs(Box, {
|
|
1003
|
+
view = items.length ? (_jsxs(Box, { flex: "1 1 auto", onKeyDown: event => {
|
|
1165
1004
|
if (product && event.key === 'Enter') {
|
|
1166
1005
|
void startCheckout();
|
|
1167
1006
|
}
|
|
1168
|
-
}, children: [_jsxs(Box, {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
backgroundColor: 'canvas.default',
|
|
1174
|
-
padding: 'var(--stack-padding-normal)',
|
|
1175
|
-
display: 'grid',
|
|
1176
|
-
gap: 'var(--stack-gap-normal)',
|
|
1177
|
-
gridTemplateColumns: shouldShowMonthlySubscriptionSection || currentPlanSection
|
|
1178
|
-
? ['1fr', 'minmax(0, 1fr) minmax(0, 1fr)']
|
|
1179
|
-
: ['1fr'],
|
|
1180
|
-
alignItems: 'stretch',
|
|
1181
|
-
}, children: [shouldShowMonthlySubscriptionSection ? (_jsx(Box, { sx: {
|
|
1182
|
-
borderRight: ['none', '1px solid'],
|
|
1183
|
-
borderColor: 'border.muted',
|
|
1184
|
-
paddingRight: ['0', 'var(--stack-gap-normal)'],
|
|
1185
|
-
alignSelf: 'stretch',
|
|
1186
|
-
}, children: monthlySubscriptionSection })) : null, currentPlanSection, _jsx(Box, { sx: {
|
|
1187
|
-
paddingLeft: shouldShowMonthlySubscriptionSection || currentPlanSection
|
|
1188
|
-
? ['0', 'var(--stack-gap-normal)']
|
|
1189
|
-
: 0,
|
|
1190
|
-
}, children: topUpSection }), isStripeTestConfiguration ? (_jsx(Box, { sx: {
|
|
1191
|
-
gridColumn: ['1', '1 / -1'],
|
|
1192
|
-
borderTop: '1px solid',
|
|
1193
|
-
borderColor: 'border.muted',
|
|
1194
|
-
paddingTop: 'var(--stack-gap-normal)',
|
|
1195
|
-
}, children: _jsx(Label, { variant: "attention", children: "Stripe test configuration" }) })) : null] }), resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: resumeConfirmationMessage })), paymentMessage && !resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: paymentMessage })), topCards] })) : (_jsxs(Box, { children: [resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: resumeConfirmationMessage })), paymentMessage && !resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: paymentMessage })), topCards, _jsx(Flash, { variant: "default", children: "No products are available yet." })] }));
|
|
1007
|
+
}, children: [_jsxs(Box, { marginTop: "var(--stack-gap-normal)", border: "1px solid", borderColor: "border.default", borderRadius: "medium", backgroundColor: "canvas.default", padding: "var(--stack-padding-normal)", display: "grid", gap: "var(--stack-gap-normal)", gridTemplateColumns: shouldShowMonthlySubscriptionSection || currentPlanSection
|
|
1008
|
+
? ['1fr', 'minmax(0, 1fr) minmax(0, 1fr)']
|
|
1009
|
+
: ['1fr'], alignItems: "stretch", children: [shouldShowMonthlySubscriptionSection ? (_jsx(Box, { borderRight: ['none', '1px solid'], borderColor: "border.muted", paddingRight: ['0', 'var(--stack-gap-normal)'], alignSelf: "stretch", children: monthlySubscriptionSection })) : null, currentPlanSection, _jsx(Box, { paddingLeft: shouldShowMonthlySubscriptionSection || currentPlanSection
|
|
1010
|
+
? ['0', 'var(--stack-gap-normal)']
|
|
1011
|
+
: 0, children: topUpSection }), isStripeTestConfiguration ? (_jsx(Box, { gridColumn: ['1', '1 / -1'], borderTop: "1px solid", borderColor: "border.muted", paddingTop: "var(--stack-gap-normal)", children: _jsx(Label, { variant: "attention", children: "Stripe test configuration" }) })) : null] }), resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: resumeConfirmationMessage })), paymentMessage && !resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: paymentMessage })), topCards] })) : (_jsxs(Box, { children: [resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: resumeConfirmationMessage })), paymentMessage && !resumeConfirmationMessage && (_jsx(Flash, { variant: "success", sx: { mt: 3 }, children: paymentMessage })), topCards, _jsx(Flash, { variant: "default", children: "No products are available yet." })] }));
|
|
1196
1012
|
}
|
|
1197
1013
|
return view;
|
|
1198
1014
|
}
|
|
@@ -7,17 +7,8 @@ import { Label, Text } from '@primer/react';
|
|
|
7
7
|
import { Box } from '@datalayer/primer-addons';
|
|
8
8
|
import { contentSourceEffectiveRole, contentSourceLabel, } from '../../models/contents/index.js';
|
|
9
9
|
/** Compact, host-neutral catalog row shared by Datalayer clients. */
|
|
10
|
-
export const ContentSourceCard = ({ item, onOpen }) => (_jsx(Box, { as: "li", onClick: () => onOpen?.(item.source.uid), sx: {
|
|
11
|
-
p: 3,
|
|
10
|
+
export const ContentSourceCard = ({ item, onOpen }) => (_jsx(Box, { as: "li", onClick: () => onOpen?.(item.source.uid), p: 3, borderColor: "border.muted", cursor: onOpen ? 'pointer' : 'default', hover: onOpen ? { bg: 'canvas.subtle' } : undefined, sx: {
|
|
12
11
|
borderBottom: '1px solid',
|
|
13
|
-
borderColor: 'border.muted',
|
|
14
|
-
cursor: onOpen ? 'pointer' : 'default',
|
|
15
12
|
':last-child': { borderBottom: 0 },
|
|
16
|
-
|
|
17
|
-
}, children: _jsxs(Box, { sx: { display: 'flex', justifyContent: 'space-between', gap: 3 }, children: [_jsxs(Box, { sx: { minWidth: 0 }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: item.source.name }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 0, m: 0, mt: 1 }, children: item.source.description || contentSourceLabel(item.source.kind) }), _jsx(Text, { as: "p", sx: { color: 'fg.subtle', fontSize: 0, m: 0, mt: 1 }, children: item.source.uid })] }), _jsxs(Box, { sx: {
|
|
18
|
-
display: 'flex',
|
|
19
|
-
alignItems: 'center',
|
|
20
|
-
gap: 2,
|
|
21
|
-
flexShrink: 0,
|
|
22
|
-
}, children: [_jsx(Label, { children: contentSourceLabel(item.source.kind) }), _jsx(Label, { variant: item.source.status === 'ready' ? 'success' : 'secondary', children: item.source.status }), _jsx(Label, { variant: "accent", children: contentSourceEffectiveRole(item) })] })] }) }));
|
|
13
|
+
}, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", gap: 3, children: [_jsxs(Box, { minWidth: 0, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: item.source.name }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 0, m: 0, mt: 1 }, children: item.source.description || contentSourceLabel(item.source.kind) }), _jsx(Text, { as: "p", sx: { color: 'fg.subtle', fontSize: 0, m: 0, mt: 1 }, children: item.source.uid })] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, flexShrink: 0, children: [_jsx(Label, { children: contentSourceLabel(item.source.kind) }), _jsx(Label, { variant: item.source.status === 'ready' ? 'success' : 'secondary', children: item.source.status }), _jsx(Label, { variant: "accent", children: contentSourceEffectiveRole(item) })] })] }) }));
|
|
23
14
|
export default ContentSourceCard;
|
|
@@ -6,5 +6,5 @@ export type HomeFolderObjectsBrowserProps = {
|
|
|
6
6
|
selectionDisabled?: boolean;
|
|
7
7
|
};
|
|
8
8
|
/** Browser for the server-managed Home Folder metadata and version history. */
|
|
9
|
-
export declare const HomeFolderObjectsBrowser: ({ prefix, selectedObjectUids, onSelectedObjectsChange, selectionDisabled }: HomeFolderObjectsBrowserProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const HomeFolderObjectsBrowser: ({ prefix, selectedObjectUids, onSelectedObjectsChange, selectionDisabled, }: HomeFolderObjectsBrowserProps) => import("react").JSX.Element;
|
|
10
10
|
export default HomeFolderObjectsBrowser;
|
|
@@ -24,7 +24,7 @@ const mutationKey = (action, uid) => {
|
|
|
24
24
|
return `${action}:${uid}:${random}`;
|
|
25
25
|
};
|
|
26
26
|
/** Browser for the server-managed Home Folder metadata and version history. */
|
|
27
|
-
export const HomeFolderObjectsBrowser = ({ prefix, selectedObjectUids = [], onSelectedObjectsChange, selectionDisabled = false }) => {
|
|
27
|
+
export const HomeFolderObjectsBrowser = ({ prefix, selectedObjectUids = [], onSelectedObjectsChange, selectionDisabled = false, }) => {
|
|
28
28
|
const objects = useHomeFolderObjects({ prefix, limit: 100 });
|
|
29
29
|
const [selected, setSelected] = useState();
|
|
30
30
|
const [uploadProgress, setUploadProgress] = useState();
|
|
@@ -40,7 +40,9 @@ export const HomeFolderObjectsBrowser = ({ prefix, selectedObjectUids = [], onSe
|
|
|
40
40
|
if (!onSelectedObjectsChange)
|
|
41
41
|
return;
|
|
42
42
|
const selectedUids = new Set(selectedObjectUids);
|
|
43
|
-
selectedUids.has(object.uid)
|
|
43
|
+
selectedUids.has(object.uid)
|
|
44
|
+
? selectedUids.delete(object.uid)
|
|
45
|
+
: selectedUids.add(object.uid);
|
|
44
46
|
onSelectedObjectsChange((objects.data?.items ?? []).filter(item => selectedUids.has(item.uid)));
|
|
45
47
|
};
|
|
46
48
|
const onUpload = (file, overwrite = 'reject') => {
|
|
@@ -86,33 +88,19 @@ export const HomeFolderObjectsBrowser = ({ prefix, selectedObjectUids = [], onSe
|
|
|
86
88
|
});
|
|
87
89
|
};
|
|
88
90
|
if (objects.isPending) {
|
|
89
|
-
return (_jsx(Box, {
|
|
91
|
+
return (_jsx(Box, { p: 4, display: "flex", justifyContent: "center", children: _jsx(Spinner, {}) }));
|
|
90
92
|
}
|
|
91
93
|
if (objects.isError) {
|
|
92
|
-
return (_jsxs(Box, {
|
|
94
|
+
return (_jsxs(Box, { p: 3, border: "1px solid", borderColor: "danger.muted", children: [_jsx(Text, { sx: { color: 'danger.fg' }, children: objects.error instanceof Error
|
|
93
95
|
? objects.error.message
|
|
94
96
|
: 'The Home Folder could not be loaded.' }), _jsx(Button, { sx: { ml: 2 }, onClick: () => objects.refetch(), children: "Retry" })] }));
|
|
95
97
|
}
|
|
96
|
-
return (_jsxs(Box, { children: [_jsxs(Box, { sx: {
|
|
97
|
-
mb: 3,
|
|
98
|
-
display: 'flex',
|
|
99
|
-
alignItems: 'center',
|
|
100
|
-
justifyContent: 'space-between',
|
|
101
|
-
gap: 3,
|
|
102
|
-
}, children: [_jsx(Text, { sx: { color: 'fg.muted' }, children: prefix ? `home-folder:///${prefix}` : 'home-folder:///' }), _jsxs(_Fragment, { children: [_jsx("input", { ref: fileInput, type: "file", hidden: true, onChange: event => {
|
|
98
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { mb: 3, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 3, children: [_jsx(Text, { sx: { color: 'fg.muted' }, children: prefix ? `home-folder:///${prefix}` : 'home-folder:///' }), _jsxs(_Fragment, { children: [_jsx("input", { ref: fileInput, type: "file", hidden: true, onChange: event => {
|
|
103
99
|
onUpload(event.target.files?.[0]);
|
|
104
100
|
event.target.value = '';
|
|
105
|
-
} }), _jsx(Button, { leadingVisual: UploadIcon, disabled: uploadObject.isPending, onClick: () => fileInput.current?.click(), children: "Upload" })] })] }), uploadProgress && (_jsxs(Box, {
|
|
101
|
+
} }), _jsx(Button, { leadingVisual: UploadIcon, disabled: uploadObject.isPending, onClick: () => fileInput.current?.click(), children: "Upload" })] })] }), uploadProgress && (_jsxs(Box, { mb: 3, children: [_jsx(ProgressBar, { progress: uploadProgress.total
|
|
106
102
|
? (uploadProgress.uploaded / uploadProgress.total) * 100
|
|
107
|
-
: 100, "aria-label": "Upload progress" }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: [formatBytes(uploadProgress.uploaded), " of", ' ', formatBytes(uploadProgress.total)] })] })), uploadObject.isError && (_jsxs(Box, {
|
|
108
|
-
p: 4,
|
|
109
|
-
textAlign: 'center',
|
|
110
|
-
border: '1px dashed',
|
|
111
|
-
borderColor: 'border.default',
|
|
112
|
-
borderRadius: 2,
|
|
113
|
-
}, children: [_jsx(FileIcon, { size: 24 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, mt: 2 }, children: "Your Home Folder is empty" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', mb: 0 }, children: "Uploaded and transferred files will appear here." })] })) : (_jsxs(Box, { as: "table", sx: {
|
|
114
|
-
width: '100%',
|
|
115
|
-
borderCollapse: 'collapse',
|
|
103
|
+
: 100, "aria-label": "Upload progress" }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: [formatBytes(uploadProgress.uploaded), " of", ' ', formatBytes(uploadProgress.total)] })] })), uploadObject.isError && (_jsxs(Box, { mb: 3, children: [_jsx(Text, { as: "p", sx: { color: 'danger.fg', mb: 2 }, children: uploadObject.error.message }), failedUpload && (_jsxs(Box, { display: "flex", gap: 2, children: [_jsx(Button, { size: "small", onClick: () => onUpload(failedUpload), children: "Retry" }), _jsx(Button, { size: "small", variant: "primary", onClick: () => onUpload(failedUpload, 'new-version'), children: "Upload as new version" })] }))] })), (objects.data?.items.length ?? 0) === 0 ? (_jsxs(Box, { p: 4, textAlign: "center", border: "1px dashed", borderColor: "border.default", borderRadius: 2, children: [_jsx(FileIcon, { size: 24 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, mt: 2 }, children: "Your Home Folder is empty" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', mb: 0 }, children: "Uploaded and transferred files will appear here." })] })) : (_jsxs(Box, { as: "table", width: "100%", borderCollapse: "collapse", sx: {
|
|
116
104
|
'th, td': {
|
|
117
105
|
px: 3,
|
|
118
106
|
py: 2,
|
|
@@ -121,22 +109,10 @@ export const HomeFolderObjectsBrowser = ({ prefix, selectedObjectUids = [], onSe
|
|
|
121
109
|
borderColor: 'border.muted',
|
|
122
110
|
},
|
|
123
111
|
th: { color: 'fg.muted', fontSize: 0, fontWeight: 600 },
|
|
124
|
-
}, children: [_jsx("thead", { children: _jsxs("tr", { children: [selectable && _jsx("th", { "aria-label": "Select" }), _jsx("th", { children: "Path" }), _jsx("th", { children: "Size" }), _jsx("th", { children: "Updated" }), _jsx("th", { "aria-label": "Actions" })] }) }), _jsx("tbody", { children: objects.data?.items.map(object => (_jsxs("tr", { children: [selectable && (_jsx("td", { children: _jsx(Checkbox, { "aria-label": `Select ${object.path}`, checked: selectedObjectUids.includes(object.uid), disabled: selectionDisabled || !object.currentVersionUid, onChange: () => toggleSelection(object) }) })), _jsx("td", { children: _jsxs(Box, {
|
|
125
|
-
mt: 3,
|
|
126
|
-
p: 3,
|
|
127
|
-
border: '1px solid',
|
|
128
|
-
borderColor: 'border.default',
|
|
129
|
-
borderRadius: 2,
|
|
130
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', justifyContent: 'space-between', gap: 2 }, children: [_jsxs(Heading, { as: "h3", sx: { fontSize: 2 }, children: ["Versions of ", selected.path] }), _jsx(Button, { size: "small", onClick: () => setSelected(undefined), children: "Close" })] }), versions.isPending ? (_jsx(Spinner, { size: "small" })) : versions.isError ? (_jsx(Text, { sx: { color: 'danger.fg' }, children: "Version history could not be loaded." })) : (_jsx(Box, { as: "ul", sx: { listStyle: 'none', p: 0, mb: 0 }, children: versions.data?.items.map(version => {
|
|
112
|
+
}, children: [_jsx("thead", { children: _jsxs("tr", { children: [selectable && _jsx("th", { "aria-label": "Select" }), _jsx("th", { children: "Path" }), _jsx("th", { children: "Size" }), _jsx("th", { children: "Updated" }), _jsx("th", { "aria-label": "Actions" })] }) }), _jsx("tbody", { children: objects.data?.items.map(object => (_jsxs("tr", { children: [selectable && (_jsx("td", { children: _jsx(Checkbox, { "aria-label": `Select ${object.path}`, checked: selectedObjectUids.includes(object.uid), disabled: selectionDisabled || !object.currentVersionUid, onChange: () => toggleSelection(object) }) })), _jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(FileIcon, {}), _jsx(Text, { sx: { fontFamily: 'mono' }, children: object.path })] }) }), _jsx("td", { children: formatBytes(object.size) }), _jsx("td", { children: new Date(object.updatedAt).toLocaleString() }), _jsx("td", { children: _jsxs(Box, { display: "flex", justifyContent: "flex-end", gap: 2, children: [_jsx(Button, { size: "small", leadingVisual: HistoryIcon, onClick: () => setSelected(object), children: "Versions" }), _jsx(Button, { size: "small", leadingVisual: DownloadIcon, disabled: downloadObject.isPending, onClick: () => onDownload(object), children: "Download" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: TrashIcon, disabled: deleteObject.isPending, onClick: () => onDelete(object), children: "Delete" })] }) })] }, object.uid))) })] })), selected && (_jsxs(Box, { mt: 3, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", gap: 2, children: [_jsxs(Heading, { as: "h3", sx: { fontSize: 2 }, children: ["Versions of ", selected.path] }), _jsx(Button, { size: "small", onClick: () => setSelected(undefined), children: "Close" })] }), versions.isPending ? (_jsx(Spinner, { size: "small" })) : versions.isError ? (_jsx(Text, { sx: { color: 'danger.fg' }, children: "Version history could not be loaded." })) : (_jsx(Box, { as: "ul", listStyle: "none", p: 0, mb: 0, children: versions.data?.items.map(version => {
|
|
131
113
|
const isCurrent = version.uid === selected.currentVersionUid;
|
|
132
|
-
return (_jsxs(Box, { as: "li", sx: {
|
|
133
|
-
py: 2,
|
|
134
|
-
display: 'flex',
|
|
135
|
-
alignItems: 'center',
|
|
136
|
-
justifyContent: 'space-between',
|
|
137
|
-
gap: 3,
|
|
114
|
+
return (_jsxs(Box, { as: "li", py: 2, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 3, borderColor: "border.muted", sx: {
|
|
138
115
|
borderBottom: '1px solid',
|
|
139
|
-
borderColor: 'border.muted',
|
|
140
116
|
':last-child': { borderBottom: 0 },
|
|
141
117
|
}, children: [_jsxs(Box, { children: [_jsx(Text, { sx: { fontFamily: 'mono', fontSize: 0 }, children: version.uid }), _jsxs(Text, { as: "p", sx: { color: 'fg.muted', m: 0, fontSize: 0 }, children: [new Date(version.createdAt).toLocaleString(), " \u00B7", ' ', formatBytes(version.size)] })] }), isCurrent ? (_jsx(Label, { variant: "success", children: "Current" })) : version.deleted ? (_jsx(Label, { children: "Deletion marker" })) : (_jsx(Button, { size: "small", leadingVisual: SyncIcon, disabled: restoreObject.isPending, onClick: () => restoreObject.mutate({
|
|
142
118
|
objectUid: selected.uid,
|
|
@@ -6,11 +6,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Spinner, Text } from '@primer/react';
|
|
7
7
|
import { Box } from '@datalayer/primer-addons';
|
|
8
8
|
export const CenteredSpinner = ({ message, size = 'medium', }) => {
|
|
9
|
-
return (_jsxs(Box, { sx: {
|
|
10
|
-
display: 'flex',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
justifyContent: 'center',
|
|
13
|
-
minHeight: '40px',
|
|
14
|
-
}, children: [_jsx(Spinner, { size: size }), message && _jsx(Text, { sx: { marginLeft: 3 }, children: message })] }));
|
|
9
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", minHeight: "40px", children: [_jsx(Spinner, { size: size }), message && _jsx(Text, { sx: { marginLeft: 3 }, children: message })] }));
|
|
15
10
|
};
|
|
16
11
|
export default CenteredSpinner;
|
|
@@ -10,23 +10,11 @@ import { useNavigate } from '../../hooks/index.js';
|
|
|
10
10
|
export const DatalayerBox = (props) => {
|
|
11
11
|
const { title, linkLabel, linkRoute, titleAction, children } = props;
|
|
12
12
|
const navigate = useNavigate();
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Box, { sx: {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
alignItems: 'center',
|
|
16
|
-
justifyContent: 'space-between',
|
|
17
|
-
paddingRight: 4,
|
|
18
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Text, { as: "h2", sx: { borderLeft: '6px solid #28b899', paddingLeft: 2 }, children: title }), titleAction] }), linkRoute && linkLabel && (_jsxs(Link, { href: "javascript: return false;", onClick: e => navigate(linkRoute), sx: {
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", paddingRight: 4, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Text, { as: "h2", sx: { borderLeft: '6px solid #28b899', paddingLeft: 2 }, children: title }), titleAction] }), linkRoute && linkLabel && (_jsxs(Link, { href: "javascript: return false;", onClick: e => navigate(linkRoute), sx: {
|
|
19
14
|
display: 'inline-flex',
|
|
20
15
|
alignItems: 'center',
|
|
21
16
|
gap: 1,
|
|
22
17
|
whiteSpace: 'nowrap',
|
|
23
|
-
}, children: [linkLabel, _jsx(ArrowRightIcon, {})] }))] }), _jsx(Box, {
|
|
24
|
-
borderColor: 'border.default',
|
|
25
|
-
borderStyle: 'solid',
|
|
26
|
-
borderWidth: '1',
|
|
27
|
-
borderRadius: '2',
|
|
28
|
-
padding: 4,
|
|
29
|
-
marginTop: 2,
|
|
30
|
-
}, children: children })] }));
|
|
18
|
+
}, children: [linkLabel, _jsx(ArrowRightIcon, {})] }))] }), _jsx(Box, { borderColor: "border.default", borderStyle: "solid", borderWidth: "1", borderRadius: "2", padding: 4, marginTop: 2, children: children })] }));
|
|
31
19
|
};
|
|
32
20
|
export default DatalayerBox;
|
|
@@ -29,27 +29,12 @@ export const FlashClosable = ({ actions, children, closable = true, variant, sx,
|
|
|
29
29
|
'. actions actions'
|
|
30
30
|
`,
|
|
31
31
|
},
|
|
32
|
-
}, children: [_jsx(Box, { sx: {
|
|
33
|
-
display: 'grid',
|
|
34
|
-
paddingBlock: 'var(--base-size-8)',
|
|
35
|
-
alignSelf: 'center',
|
|
36
|
-
gridArea: 'visual',
|
|
37
|
-
}, children: visual }), _jsx(Box, { sx: {
|
|
38
|
-
alignSelf: 'center',
|
|
39
|
-
display: 'grid',
|
|
40
|
-
gridArea: 'message',
|
|
41
|
-
}, children: children }), _jsx(Box, { sx: {
|
|
42
|
-
display: 'grid',
|
|
43
|
-
gap: 'var(--stack-gap-condensed)',
|
|
44
|
-
marginLeft: 'actions',
|
|
32
|
+
}, children: [_jsx(Box, { display: "grid", paddingBlock: "var(--base-size-8)", alignSelf: "center", gridArea: "visual", children: visual }), _jsx(Box, { alignSelf: "center", display: "grid", gridArea: "message", children: children }), _jsx(Box, { display: "grid", gap: "var(--stack-gap-condensed)", marginLeft: "actions", sx: {
|
|
45
33
|
'@media screen and (max-width: 544px)': {
|
|
46
34
|
alignSelf: 'start',
|
|
47
35
|
margin: 'var(--base-size-8) 0 0 var(--base-size-8)',
|
|
48
36
|
},
|
|
49
|
-
}, children: actions }), closable && (_jsx(Box, { sx: {
|
|
50
|
-
alignSelf: 'start',
|
|
51
|
-
marginLeft: 'close',
|
|
52
|
-
}, children: _jsx(IconButton, { "aria-label": "Dismiss flash message", title: "Dismiss", onClick: onClose, variant: "invisible", icon: XIcon, sx: {
|
|
37
|
+
}, children: actions }), closable && (_jsx(Box, { alignSelf: "start", marginLeft: "close", children: _jsx(IconButton, { "aria-label": "Dismiss flash message", title: "Dismiss", onClick: onClose, variant: "invisible", icon: XIcon, sx: {
|
|
53
38
|
'& > svg': { marginRight: 0, color: 'var(--fgColor-default)' },
|
|
54
39
|
} }) }))] })) : (_jsx(_Fragment, {}));
|
|
55
40
|
};
|