@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
package/lib/cli-login.js
CHANGED
|
@@ -5,9 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
*/
|
|
6
6
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
|
-
import {
|
|
8
|
+
import { Button, Spinner, Text } from '@primer/react';
|
|
9
9
|
import { ShieldLockIcon } from '@primer/octicons-react';
|
|
10
|
-
import { DatalayerThemeProvider, themeConfigs, createThemeStore, } from '@datalayer/primer-addons';
|
|
10
|
+
import { Box, DatalayerThemeProvider, themeConfigs, createThemeStore, } from '@datalayer/primer-addons';
|
|
11
11
|
import { SvgLinesLogo, SvgUsecasesHero } from '@datalayer/design';
|
|
12
12
|
import { AppearanceControlsWithStore } from '@datalayer/primer-addons/lib/components/appearance';
|
|
13
13
|
import { ConfettiSuccess } from './components/confetti/index.js';
|
|
@@ -90,58 +90,12 @@ function SignInCLIApp() {
|
|
|
90
90
|
setState('signin');
|
|
91
91
|
});
|
|
92
92
|
}, [finalizeCliAuthentication]);
|
|
93
|
-
const renderLayout = (content) => (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: cfg.primerTheme, themeStyles: cfg.themeStyles, children: _jsxs(Box, {
|
|
94
|
-
minHeight: '100vh',
|
|
95
|
-
bg: 'canvas.default',
|
|
96
|
-
color: 'fg.default',
|
|
97
|
-
position: 'relative',
|
|
98
|
-
}, children: [_jsx(Box, { sx: {
|
|
99
|
-
position: 'fixed',
|
|
100
|
-
top: 0,
|
|
101
|
-
right: 0,
|
|
102
|
-
zIndex: 20,
|
|
103
|
-
p: 3,
|
|
104
|
-
display: 'flex',
|
|
105
|
-
justifyContent: 'flex-end',
|
|
106
|
-
}, children: _jsx(AppearanceControlsWithStore, { useStore: useCliThemeStore }) }), content] }) }));
|
|
93
|
+
const renderLayout = (content) => (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: cfg.primerTheme, themeStyles: cfg.themeStyles, children: _jsxs(Box, { minHeight: "100vh", bg: "canvas.default", color: "fg.default", position: "relative", children: [_jsx(Box, { position: "fixed", top: 0, right: 0, zIndex: 20, p: 3, display: "flex", justifyContent: "flex-end", children: _jsx(AppearanceControlsWithStore, { useStore: useCliThemeStore }) }), content] }) }));
|
|
107
94
|
if (state === 'checking') {
|
|
108
|
-
return renderLayout(_jsx(Box, {
|
|
109
|
-
display: 'flex',
|
|
110
|
-
alignItems: 'center',
|
|
111
|
-
justifyContent: 'center',
|
|
112
|
-
minHeight: '100vh',
|
|
113
|
-
}, children: _jsx(Spinner, {}) }));
|
|
95
|
+
return renderLayout(_jsx(Box, { display: "flex", alignItems: "center", justifyContent: "center", minHeight: "100vh", children: _jsx(Spinner, {}) }));
|
|
114
96
|
}
|
|
115
97
|
if (state === 'success') {
|
|
116
|
-
return renderLayout(_jsxs(Box, { sx: {
|
|
117
|
-
minHeight: '100vh',
|
|
118
|
-
display: 'flex',
|
|
119
|
-
alignItems: 'center',
|
|
120
|
-
justifyContent: 'center',
|
|
121
|
-
px: 3,
|
|
122
|
-
position: 'relative',
|
|
123
|
-
overflow: 'hidden',
|
|
124
|
-
}, children: [_jsx(Box, { sx: {
|
|
125
|
-
position: 'absolute',
|
|
126
|
-
inset: 0,
|
|
127
|
-
opacity: 0.45,
|
|
128
|
-
pointerEvents: 'none',
|
|
129
|
-
}, children: _jsx(SvgUsecasesHero, {}) }), _jsx(Box, { sx: {
|
|
130
|
-
position: 'absolute',
|
|
131
|
-
inset: 0,
|
|
132
|
-
pointerEvents: 'none',
|
|
133
|
-
zIndex: 2,
|
|
134
|
-
}, children: _jsx(ConfettiSuccess, {}) }), _jsxs(Box, { sx: {
|
|
135
|
-
position: 'relative',
|
|
136
|
-
zIndex: 3,
|
|
137
|
-
textAlign: 'center',
|
|
138
|
-
maxWidth: 560,
|
|
139
|
-
p: 4,
|
|
140
|
-
borderRadius: 2,
|
|
141
|
-
border: '1px solid',
|
|
142
|
-
borderColor: 'border.default',
|
|
143
|
-
bg: 'canvas.default',
|
|
144
|
-
}, children: [_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', mb: 3 }, children: _jsx(Box, { sx: { width: 210 }, children: _jsx(SvgLinesLogo, { height: 32 }) }) }), _jsx(Text, { as: "h2", sx: { display: 'block', fontSize: 3, fontWeight: 600, mb: 2 }, children: message || 'Successfully logged in.' }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', mb: 3 }, children: "You can close this window." }), closeHelp && (_jsx(Text, { as: "p", sx: { color: 'fg.accent', mb: 3 }, children: closeHelp })), _jsx(Box, { sx: { display: 'flex', justifyContent: 'center' }, children: _jsx(Button, { onClick: handleCloseWindow, children: "Close this window" }) })] })] }));
|
|
98
|
+
return renderLayout(_jsxs(Box, { minHeight: "100vh", display: "flex", alignItems: "center", justifyContent: "center", px: 3, position: "relative", overflow: "hidden", children: [_jsx(Box, { position: "absolute", inset: 0, opacity: 0.45, pointerEvents: "none", children: _jsx(SvgUsecasesHero, {}) }), _jsx(Box, { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 2, children: _jsx(ConfettiSuccess, {}) }), _jsxs(Box, { position: "relative", zIndex: 3, textAlign: "center", maxWidth: 560, p: 4, borderRadius: 2, border: "1px solid", borderColor: "border.default", bg: "canvas.default", children: [_jsx(Box, { display: "flex", justifyContent: "center", mb: 3, children: _jsx(Box, { width: 210, children: _jsx(SvgLinesLogo, { height: 32 }) }) }), _jsx(Text, { as: "h2", sx: { display: 'block', fontSize: 3, fontWeight: 600, mb: 2 }, children: message || 'Successfully logged in.' }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', mb: 3 }, children: "You can close this window." }), closeHelp && (_jsx(Text, { as: "p", sx: { color: 'fg.accent', mb: 3 }, children: closeHelp })), _jsx(Box, { display: "flex", justifyContent: "center", children: _jsx(Button, { onClick: handleCloseWindow, children: "Close this window" }) })] })] }));
|
|
145
99
|
}
|
|
146
100
|
return renderLayout(_jsx(SignInSimple, { name: "Datalayer CLI", description: "Sign in to continue in your CLI session.", icon: _jsx(ShieldLockIcon, { size: 24 }), github: true, google: true, linkedin: true, signUp: true, apiKey: false, socialSignInNavigationTarget: null, onSignIn: async (token, handle) => {
|
|
147
101
|
window.localStorage.setItem(DATALAYER_IAM_TOKEN_KEY, token);
|
|
@@ -24,21 +24,7 @@ export function AnonymousKeyExpired({ agentName, sandboxStillRuns = false, tempo
|
|
|
24
24
|
// the key — so clearing it is `onSignedIn`'s job, not this panel's.
|
|
25
25
|
onSignedIn?.();
|
|
26
26
|
}, [onSignedIn]);
|
|
27
|
-
return (_jsx(Box, { sx: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
minHeight: 0,
|
|
30
|
-
overflowY: 'auto',
|
|
31
|
-
bg: 'canvas.default',
|
|
32
|
-
px: 4,
|
|
33
|
-
py: 4,
|
|
34
|
-
}, children: _jsxs(Box, { sx: { maxWidth: 440, mx: 'auto' }, children: [_jsxs(Box, { sx: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center',
|
|
38
|
-
gap: 2,
|
|
39
|
-
color: 'attention.fg',
|
|
40
|
-
mb: 2,
|
|
41
|
-
}, children: [_jsx(KeyIcon, { size: 20 }), _jsx(Text, { sx: { fontSize: 2, fontWeight: 'semibold', color: 'fg.default' }, children: temporary
|
|
27
|
+
return (_jsx(Box, { height: "100%", minHeight: 0, overflowY: "auto", bg: "canvas.default", px: 4, py: 4, children: _jsxs(Box, { maxWidth: 440, mx: "auto", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: 2, color: "attention.fg", mb: 2, children: [_jsx(KeyIcon, { size: 20 }), _jsx(Text, { sx: { fontSize: 2, fontWeight: 'semibold', color: 'fg.default' }, children: temporary
|
|
42
28
|
? 'This demo runs on a shared key'
|
|
43
29
|
: 'Your key has expired' })] }), _jsxs(Text, { as: "p", sx: {
|
|
44
30
|
fontSize: 1,
|
|
@@ -81,20 +81,10 @@ export function AnonymousKeyTimer({ expiresAt, grantedMs, label = 'Trial key', w
|
|
|
81
81
|
: fraction <= warnAt
|
|
82
82
|
? 'attention.fg'
|
|
83
83
|
: 'fg.muted';
|
|
84
|
-
return (_jsxs(Box, {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
px: 2,
|
|
89
|
-
py: '2px',
|
|
90
|
-
borderRadius: '999px',
|
|
91
|
-
border: '1px solid',
|
|
92
|
-
borderColor: 'border.muted',
|
|
93
|
-
bg: 'canvas.subtle',
|
|
94
|
-
color: tone,
|
|
95
|
-
// The clock is the point; the row it sits in must not resize as the
|
|
96
|
-
// digits change width.
|
|
97
|
-
fontVariantNumeric: 'tabular-nums',
|
|
84
|
+
return (_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, px: 2, py: "2px", borderRadius: "999px", border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", color: tone,
|
|
85
|
+
// The clock is the point; the row it sits in must not resize as the
|
|
86
|
+
// digits change width.
|
|
87
|
+
fontVariantNumeric: "tabular-nums", sx: {
|
|
98
88
|
/*
|
|
99
89
|
The last few percent, breathing.
|
|
100
90
|
|
|
@@ -135,6 +125,6 @@ export function AnonymousKeyTimer({ expiresAt, grantedMs, label = 'Trial key', w
|
|
|
135
125
|
A status readout rather than a control, so the hint rides on the native
|
|
136
126
|
attribute: Primer's `Tooltip` requires an interactive child.
|
|
137
127
|
*/
|
|
138
|
-
title: `${label}: this workspace is talking to the agent on a temporary key issued to nobody in particular. When it runs out the chat asks you to sign in. Sign in now for an account of your own.`, children: [_jsx(Box, {
|
|
128
|
+
title: `${label}: this workspace is talking to the agent on a temporary key issued to nobody in particular. When it runs out the chat asks you to sign in. Sign in now for an account of your own.`, children: [_jsx(Box, { display: "flex", alignItems: "center", color: tone, children: _jsx(KeyIcon, { size: 12 }) }), _jsxs(Box, { as: "svg", "aria-hidden": "true", focusable: "false", width: RING, height: RING, viewBox: `0 0 ${RING} ${RING}`, display: "block", flexShrink: 0, children: [_jsx("circle", { cx: RING / 2, cy: RING / 2, r: RADIUS, fill: "none", stroke: "currentColor", strokeWidth: STROKE, opacity: 0.2 }), _jsx("circle", { cx: RING / 2, cy: RING / 2, r: RADIUS, fill: "none", stroke: "currentColor", strokeWidth: STROKE, strokeLinecap: "round", strokeDasharray: CIRCUMFERENCE, strokeDashoffset: CIRCUMFERENCE * (1 - fraction), transform: `rotate(-90 ${RING / 2} ${RING / 2})`, style: { transition: 'stroke-dashoffset 0.5s linear' } })] }), _jsx(Text, { sx: { fontSize: 0, color: tone, fontWeight: 'semibold' }, children: format(left) })] }));
|
|
139
129
|
}
|
|
140
130
|
export default AnonymousKeyTimer;
|
|
@@ -179,7 +179,7 @@ export const SignIn = (props) => {
|
|
|
179
179
|
: 'Your password may not be empty.',
|
|
180
180
|
});
|
|
181
181
|
}, [formValues]);
|
|
182
|
-
return (_jsxs(PageLayout, { containerWidth: "medium", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsx(Heading, { children: heading || 'Sign in to Datalayer' }) }), _jsx(PageLayout.Content, { children: loadingWithToken < 0 ? (_jsx(_Fragment, { children: _jsxs(Box, { display: "flex", children: [showEmailLogin && (_jsxs(Box, { sx: { label: { marginTop: 2 }
|
|
182
|
+
return (_jsxs(PageLayout, { containerWidth: "medium", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsx(Heading, { children: heading || 'Sign in to Datalayer' }) }), _jsx(PageLayout.Content, { children: loadingWithToken < 0 ? (_jsx(_Fragment, { children: _jsxs(Box, { display: "flex", children: [showEmailLogin && (_jsxs(Box, { paddingRight: "10%", sx: { label: { marginTop: 2 } }, children: [_jsx(Box, { mt: 5, children: _jsxs(FormControl, { required: true, children: [_jsx(FormControl.Label, { children: "Your username" }), _jsx(TextInput, { autoFocus: true, placeholder: "Your username", value: formValues.handle, disabled: loading, onChange: handleHandleChange, onKeyDown: handleKeyDown }), validationResult.handle && (_jsx(FormControl.Validation, { variant: validationResult.handle ? 'error' : 'success', children: validationResult.handle }))] }) }), _jsx(Box, { children: _jsxs(FormControl, { required: true, children: [_jsx(FormControl.Label, { children: "Your password" }), _jsx(TextInput, { placeholder: "Your password", type: passwordVisibility ? 'text' : 'password', value: formValues.password, disabled: loading, onChange: handlePasswordChange, onKeyDown: handleKeyDown, trailingAction: _jsx(TextInput.Action, { onClick: () => {
|
|
183
183
|
setPasswordVisibility(!passwordVisibility);
|
|
184
184
|
}, disabled: loading, icon: passwordVisibility ? EyeClosedIcon : EyeIcon, "aria-label": passwordVisibility
|
|
185
185
|
? 'Hide password'
|
|
@@ -189,7 +189,7 @@ export const SignIn = (props) => {
|
|
|
189
189
|
? 'Sign In…'
|
|
190
190
|
: heading
|
|
191
191
|
? 'Sign in with Datalayer'
|
|
192
|
-
: 'Sign In' }), _jsx(Box, { pt: 6 }), _jsx(Link, { href: "https://datalayer.ai/password", target: "_blank", children: "Forgot password?" })] })] })), _jsx(Box, { children: _jsxs(Box, { display: "flex", flexDirection: "column",
|
|
192
|
+
: 'Sign In' }), _jsx(Box, { pt: 6 }), _jsx(Link, { href: "https://datalayer.ai/password", target: "_blank", children: "Forgot password?" })] })] })), _jsx(Box, { children: _jsxs(Box, { display: "flex", flexDirection: "column", margin: "auto", children: [showGitHubLogin &&
|
|
193
193
|
iamProvidersAuthorizationURL[IAMProvidersSpecs.GitHub.name] && (_jsx(Button, { leadingVisual: pendingOAuthProvider === IAMProvidersSpecs.GitHub.name
|
|
194
194
|
? () => _jsx(Spinner, { size: "small" })
|
|
195
195
|
: MarkGithubIcon, onClick: () => startOAuthSignIn(IAMProvidersSpecs.GitHub), disabled: socialButtonsDisabled, style: { margin: '10px 0' }, children: "Sign in with GitHub" })), showGoogleLogin &&
|
|
@@ -30,28 +30,11 @@ export const UserAvatar = ({ avatarUrl, avatarIcon, avatarEmoji, size = 100, squ
|
|
|
30
30
|
? { boxShadow: '0 0 0 1px var(--borderColor-default, currentColor)' }
|
|
31
31
|
: undefined;
|
|
32
32
|
if (avatarEmoji) {
|
|
33
|
-
return (_jsx(Box, { role: "img", "aria-label": avatarEmoji, className: className, sx: {
|
|
34
|
-
width: size,
|
|
35
|
-
height: size,
|
|
36
|
-
borderRadius: square ? 2 : '50%',
|
|
37
|
-
display: 'flex',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
justifyContent: 'center',
|
|
40
|
-
bg: fallbackBackground || 'canvas.default',
|
|
41
|
-
...ringSx,
|
|
42
|
-
}, children: _jsx(FluentEmoji, { emoji: avatarEmoji, size: iconSize ?? Math.round(size * 0.6), label: "" }) }));
|
|
33
|
+
return (_jsx(Box, { role: "img", "aria-label": avatarEmoji, className: className, width: size, height: size, borderRadius: square ? 2 : '50%', display: "flex", alignItems: "center", justifyContent: "center", bg: fallbackBackground || 'canvas.default', sx: ringSx, children: _jsx(FluentEmoji, { emoji: avatarEmoji, size: iconSize ?? Math.round(size * 0.6), label: "" }) }));
|
|
43
34
|
}
|
|
44
35
|
const SelectedIcon = getPrincipalAvatarIcon(avatarIcon);
|
|
45
36
|
if (SelectedIcon) {
|
|
46
|
-
return (_jsx(Box, { className: className, sx: {
|
|
47
|
-
width: size,
|
|
48
|
-
height: size,
|
|
49
|
-
borderRadius: square ? 2 : '50%',
|
|
50
|
-
overflow: 'hidden',
|
|
51
|
-
display: 'flex',
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
bg: fallbackBackground || 'accent.subtle',
|
|
37
|
+
return (_jsx(Box, { className: className, width: size, height: size, borderRadius: square ? 2 : '50%', overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center", bg: fallbackBackground || 'accent.subtle', sx: {
|
|
55
38
|
'--datalayer-icon-fg': fallbackForeground || palette.primary,
|
|
56
39
|
...ringSx,
|
|
57
40
|
}, children: _jsx(SelectedIcon, { size: iconSize ?? Math.round(size * 0.62), themed: true, colormode: true }) }));
|
|
@@ -60,14 +43,7 @@ export const UserAvatar = ({ avatarUrl, avatarIcon, avatarEmoji, size = 100, squ
|
|
|
60
43
|
return (_jsx(DLAvatar, { className: className, square: square, src: avatarUrl, size: size, sx: ringSx }));
|
|
61
44
|
}
|
|
62
45
|
const resolvedIconSize = iconSize ?? Math.round(size * 0.48);
|
|
63
|
-
return (_jsx(Box, { className: className, sx: {
|
|
64
|
-
width: size,
|
|
65
|
-
height: size,
|
|
66
|
-
borderRadius: square ? 2 : '50%',
|
|
67
|
-
bg: fallbackBackground || 'accent.subtle',
|
|
68
|
-
display: 'flex',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
justifyContent: 'center',
|
|
46
|
+
return (_jsx(Box, { className: className, width: size, height: size, borderRadius: square ? 2 : '50%', bg: fallbackBackground || 'accent.subtle', display: "flex", alignItems: "center", justifyContent: "center", sx: {
|
|
71
47
|
'--datalayer-icon-fg': fallbackForeground || palette.primary,
|
|
72
48
|
...ringSx,
|
|
73
49
|
}, children: _jsx(AlienIcon, { size: resolvedIconSize, themed: true, colormode: true }) }));
|
|
@@ -313,50 +313,21 @@ export function BillingEntitySelect({ value, onChange, onSelectedAccountChange,
|
|
|
313
313
|
hasEligibleAccount,
|
|
314
314
|
onAccountsResolved,
|
|
315
315
|
]);
|
|
316
|
-
return (_jsxs(FormControl, { children: [_jsx(FormControl.Label, { children: label }), _jsx(Box, {
|
|
317
|
-
display: 'inline-flex',
|
|
318
|
-
alignItems: 'center',
|
|
319
|
-
gap: 2,
|
|
320
|
-
}, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1 }, children: "Loading plan status..." })] })) : selectedAccount ? (_jsxs(Box, { sx: {
|
|
321
|
-
display: 'flex',
|
|
322
|
-
alignItems: 'center',
|
|
323
|
-
justifyContent: 'space-between',
|
|
324
|
-
width: '100%',
|
|
325
|
-
minWidth: 0,
|
|
326
|
-
gap: 2,
|
|
327
|
-
}, children: [_jsxs(Text, { sx: {
|
|
316
|
+
return (_jsxs(FormControl, { children: [_jsx(FormControl.Label, { children: label }), _jsx(Box, { display: "flex", justifyContent: "center", children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Button, { variant: "default", disabled: disabled || !hasEligibleAccount, sx: { width, justifyContent: 'space-between' }, children: isLoading ? (_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1 }, children: "Loading plan status..." })] })) : selectedAccount ? (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", minWidth: 0, gap: 2, children: [_jsxs(Text, { sx: {
|
|
328
317
|
minWidth: 0,
|
|
329
318
|
overflow: 'hidden',
|
|
330
319
|
textOverflow: 'ellipsis',
|
|
331
320
|
whiteSpace: 'nowrap',
|
|
332
|
-
}, children: ["@", selectedAccount.accountName] }), _jsxs(Box, {
|
|
333
|
-
display: 'flex',
|
|
334
|
-
alignItems: 'center',
|
|
335
|
-
justifyContent: 'flex-end',
|
|
336
|
-
gap: 1,
|
|
337
|
-
flexShrink: 0,
|
|
338
|
-
}, children: [_jsx(Label, { size: "small", variant: "secondary", title: selectedAccount.accountType === 'organization'
|
|
321
|
+
}, children: ["@", selectedAccount.accountName] }), _jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 1, flexShrink: 0, children: [_jsx(Label, { size: "small", variant: "secondary", title: selectedAccount.accountType === 'organization'
|
|
339
322
|
? 'Organization'
|
|
340
323
|
: selectedAccount.accountType === 'team'
|
|
341
324
|
? 'Team'
|
|
342
|
-
: 'User', children: selectedAccount.accountType === 'organization' ? (_jsx(OrganizationIcon, { size: 12 })) : selectedAccount.accountType === 'team' ? (_jsx(PeopleIcon, { size: 12 })) : (_jsx(PersonIcon, { size: 12 })) }), selectedAccount.isAwsBilled ? _jsx(AwsBilledLabel, {}) : null, _jsx(Label, { size: "small", variant: selectedAccount.isPaidPlan ? 'success' : 'attention', children: formatBillingEntityPlanLabel(selectedAccount.planName) })] })] })) : !hasEligibleAccount ? (emptyMessage) : ('Select a billing entity') }) }), _jsxs(ActionMenu.Overlay, { width: "large", children: [_jsx(Box, {
|
|
343
|
-
borderRadius: 2,
|
|
344
|
-
border: '1px solid',
|
|
345
|
-
borderColor: 'border.default',
|
|
346
|
-
bg: 'canvas.subtle',
|
|
347
|
-
color: 'fg.muted',
|
|
348
|
-
px: 3,
|
|
349
|
-
py: 2,
|
|
350
|
-
}, children: [_jsx(Text, { sx: { fontSize: 1, lineHeight: 1.5 }, children: flashMessage }), accounts.some(account => account.isAwsBilled) ? (_jsx(Text, { sx: {
|
|
325
|
+
: 'User', children: selectedAccount.accountType === 'organization' ? (_jsx(OrganizationIcon, { size: 12 })) : selectedAccount.accountType === 'team' ? (_jsx(PeopleIcon, { size: 12 })) : (_jsx(PersonIcon, { size: 12 })) }), selectedAccount.isAwsBilled ? _jsx(AwsBilledLabel, {}) : null, _jsx(Label, { size: "small", variant: selectedAccount.isPaidPlan ? 'success' : 'attention', children: formatBillingEntityPlanLabel(selectedAccount.planName) })] })] })) : !hasEligibleAccount ? (emptyMessage) : ('Select a billing entity') }) }), _jsxs(ActionMenu.Overlay, { width: "large", children: [_jsx(Box, { p: 2, children: _jsxs(Box, { borderRadius: 2, border: "1px solid", borderColor: "border.default", bg: "canvas.subtle", color: "fg.muted", px: 3, py: 2, children: [_jsx(Text, { sx: { fontSize: 1, lineHeight: 1.5 }, children: flashMessage }), accounts.some(account => account.isAwsBilled) ? (_jsx(Text, { sx: {
|
|
351
326
|
display: 'block',
|
|
352
327
|
fontSize: 1,
|
|
353
328
|
lineHeight: 1.5,
|
|
354
329
|
mt: 2,
|
|
355
|
-
}, children: "Entries marked AWS are billed through AWS Marketplace: only work started under them is reported to AWS. Work started under any other entry is charged to the credits of that account and never reaches the AWS bill." })) : null] }) }), _jsx(ActionList, { selectionVariant: "single", children: isLoading ? (_jsx(ActionList.Item, { disabled: true, children: _jsxs(Box, { sx: {
|
|
356
|
-
display: 'inline-flex',
|
|
357
|
-
alignItems: 'center',
|
|
358
|
-
gap: 2,
|
|
359
|
-
}, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1 }, children: "Loading plan status..." })] }) })) : !hasEligibleAccount ? (_jsx(ActionList.Item, { disabled: true, children: emptyMessage })) : ((() => {
|
|
330
|
+
}, children: "Entries marked AWS are billed through AWS Marketplace: only work started under them is reported to AWS. Work started under any other entry is charged to the credits of that account and never reaches the AWS bill." })) : null] }) }), _jsx(ActionList, { selectionVariant: "single", children: isLoading ? (_jsx(ActionList.Item, { disabled: true, children: _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1 }, children: "Loading plan status..." })] }) })) : !hasEligibleAccount ? (_jsx(ActionList.Item, { disabled: true, children: emptyMessage })) : ((() => {
|
|
360
331
|
const typeOrder = {
|
|
361
332
|
user: 0,
|
|
362
333
|
organization: 1,
|
|
@@ -372,25 +343,12 @@ export function BillingEntitySelect({ value, onChange, onSelectedAccountChange,
|
|
|
372
343
|
if (account.isEligible) {
|
|
373
344
|
handleAccountSelect(account.accountUid);
|
|
374
345
|
}
|
|
375
|
-
}, children: [_jsxs(Box, { sx: {
|
|
376
|
-
display: 'flex',
|
|
377
|
-
alignItems: 'center',
|
|
378
|
-
justifyContent: 'space-between',
|
|
379
|
-
width: '100%',
|
|
380
|
-
minWidth: 0,
|
|
381
|
-
gap: 2,
|
|
382
|
-
}, children: [_jsxs(Text, { sx: {
|
|
346
|
+
}, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", minWidth: 0, gap: 2, children: [_jsxs(Text, { sx: {
|
|
383
347
|
minWidth: 0,
|
|
384
348
|
overflow: 'hidden',
|
|
385
349
|
textOverflow: 'ellipsis',
|
|
386
350
|
whiteSpace: 'nowrap',
|
|
387
|
-
}, children: ["@", account.accountName] }), _jsxs(Box, {
|
|
388
|
-
display: 'flex',
|
|
389
|
-
alignItems: 'center',
|
|
390
|
-
justifyContent: 'flex-end',
|
|
391
|
-
gap: 1,
|
|
392
|
-
flexShrink: 0,
|
|
393
|
-
}, children: [_jsx(Label, { size: "small", variant: "secondary", title: account.accountType === 'organization'
|
|
351
|
+
}, children: ["@", account.accountName] }), _jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 1, flexShrink: 0, children: [_jsx(Label, { size: "small", variant: "secondary", title: account.accountType === 'organization'
|
|
394
352
|
? 'Organization'
|
|
395
353
|
: account.accountType === 'team'
|
|
396
354
|
? 'Team'
|