@datalayer/core 1.2.18 → 1.2.20

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.
Files changed (228) hide show
  1. package/lib/cli-login.js +5 -51
  2. package/lib/components/anonymous/AnonymousKeyExpired.js +1 -15
  3. package/lib/components/anonymous/AnonymousKeyTimer.js +5 -15
  4. package/lib/components/auth/SignIn.js +2 -2
  5. package/lib/components/avatars/UserAvatar.d.ts +10 -11
  6. package/lib/components/avatars/UserAvatar.js +23 -52
  7. package/lib/components/avatars/UserProfileAvatar.js +1 -1
  8. package/lib/components/avatars/avatarChoice.d.ts +42 -0
  9. package/lib/components/avatars/avatarChoice.js +65 -0
  10. package/lib/components/avatars/index.d.ts +1 -0
  11. package/lib/components/avatars/index.js +1 -0
  12. package/lib/components/billing/BillingEntitySelect.js +6 -48
  13. package/lib/components/checkout/StripeCheckout.js +33 -217
  14. package/lib/components/collaboration/LiveEditorCollaborators.d.ts +3 -4
  15. package/lib/components/collaboration/LiveEditorCollaborators.js +7 -5
  16. package/lib/components/contents/ContentSourceCard.js +2 -11
  17. package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +1 -1
  18. package/lib/components/contents/HomeFolderObjectsBrowser.js +11 -35
  19. package/lib/components/display/CenteredSpinner.js +1 -6
  20. package/lib/components/display/DatalayerBox.js +2 -14
  21. package/lib/components/emoji/faceEmojis.js +48 -0
  22. package/lib/components/emoji/fluent/loaders.js +46 -0
  23. package/lib/components/emoji/fluent/svg/1f30a.d.ts +2 -0
  24. package/lib/components/emoji/fluent/svg/1f30a.js +5 -0
  25. package/lib/components/emoji/fluent/svg/1f310.d.ts +2 -0
  26. package/lib/components/emoji/fluent/svg/1f310.js +5 -0
  27. package/lib/components/emoji/fluent/svg/1f324.d.ts +2 -0
  28. package/lib/components/emoji/fluent/svg/1f324.js +5 -0
  29. package/lib/components/emoji/fluent/svg/1f326.d.ts +2 -0
  30. package/lib/components/emoji/fluent/svg/1f326.js +5 -0
  31. package/lib/components/emoji/fluent/svg/1f327.d.ts +2 -0
  32. package/lib/components/emoji/fluent/svg/1f327.js +5 -0
  33. package/lib/components/emoji/fluent/svg/1f33e.d.ts +2 -0
  34. package/lib/components/emoji/fluent/svg/1f33e.js +5 -0
  35. package/lib/components/emoji/fluent/svg/1f372.d.ts +2 -0
  36. package/lib/components/emoji/fluent/svg/1f372.js +5 -0
  37. package/lib/components/emoji/fluent/svg/1f373.d.ts +2 -0
  38. package/lib/components/emoji/fluent/svg/1f373.js +5 -0
  39. package/lib/components/emoji/fluent/svg/1f39b.d.ts +2 -0
  40. package/lib/components/emoji/fluent/svg/1f39b.js +5 -0
  41. package/lib/components/emoji/fluent/svg/1f3ab.d.ts +2 -0
  42. package/lib/components/emoji/fluent/svg/1f3ab.js +5 -0
  43. package/lib/components/emoji/fluent/svg/1f41b.d.ts +2 -0
  44. package/lib/components/emoji/fluent/svg/1f41b.js +5 -0
  45. package/lib/components/emoji/fluent/svg/1f441.d.ts +2 -0
  46. package/lib/components/emoji/fluent/svg/1f441.js +5 -0
  47. package/lib/components/emoji/fluent/svg/1f465.d.ts +2 -0
  48. package/lib/components/emoji/fluent/svg/1f465.js +5 -0
  49. package/lib/components/emoji/fluent/svg/1f4b9.d.ts +2 -0
  50. package/lib/components/emoji/fluent/svg/1f4b9.js +5 -0
  51. package/lib/components/emoji/fluent/svg/1f4be.d.ts +2 -0
  52. package/lib/components/emoji/fluent/svg/1f4be.js +5 -0
  53. package/lib/components/emoji/fluent/svg/1f4c1.d.ts +2 -0
  54. package/lib/components/emoji/fluent/svg/1f4c1.js +5 -0
  55. package/lib/components/emoji/fluent/svg/1f4c2.d.ts +2 -0
  56. package/lib/components/emoji/fluent/svg/1f4c2.js +5 -0
  57. package/lib/components/emoji/fluent/svg/1f4c4.d.ts +2 -0
  58. package/lib/components/emoji/fluent/svg/1f4c4.js +5 -0
  59. package/lib/components/emoji/fluent/svg/1f4d3.d.ts +2 -0
  60. package/lib/components/emoji/fluent/svg/1f4d3.js +5 -0
  61. package/lib/components/emoji/fluent/svg/1f4d6.d.ts +2 -0
  62. package/lib/components/emoji/fluent/svg/1f4d6.js +5 -0
  63. package/lib/components/emoji/fluent/svg/1f4dc.d.ts +2 -0
  64. package/lib/components/emoji/fluent/svg/1f4dc.js +5 -0
  65. package/lib/components/emoji/fluent/svg/1f4e1.d.ts +2 -0
  66. package/lib/components/emoji/fluent/svg/1f4e1.js +5 -0
  67. package/lib/components/emoji/fluent/svg/1f4e2.d.ts +2 -0
  68. package/lib/components/emoji/fluent/svg/1f4e2.js +5 -0
  69. package/lib/components/emoji/fluent/svg/1f4e7.d.ts +2 -0
  70. package/lib/components/emoji/fluent/svg/1f4e7.js +5 -0
  71. package/lib/components/emoji/fluent/svg/1f500.d.ts +2 -0
  72. package/lib/components/emoji/fluent/svg/1f500.js +5 -0
  73. package/lib/components/emoji/fluent/svg/1f501.d.ts +2 -0
  74. package/lib/components/emoji/fluent/svg/1f501.js +5 -0
  75. package/lib/components/emoji/fluent/svg/1f504.d.ts +2 -0
  76. package/lib/components/emoji/fluent/svg/1f504.js +5 -0
  77. package/lib/components/emoji/fluent/svg/1f52d.d.ts +2 -0
  78. package/lib/components/emoji/fluent/svg/1f52d.js +5 -0
  79. package/lib/components/emoji/fluent/svg/1f552.d.ts +2 -0
  80. package/lib/components/emoji/fluent/svg/1f552.js +5 -0
  81. package/lib/components/emoji/fluent/svg/1f58b.d.ts +2 -0
  82. package/lib/components/emoji/fluent/svg/1f58b.js +5 -0
  83. package/lib/components/emoji/fluent/svg/1f5b2.d.ts +2 -0
  84. package/lib/components/emoji/fluent/svg/1f5b2.js +5 -0
  85. package/lib/components/emoji/fluent/svg/1f5c3.d.ts +2 -0
  86. package/lib/components/emoji/fluent/svg/1f5c3.js +5 -0
  87. package/lib/components/emoji/fluent/svg/1f5d1.d.ts +2 -0
  88. package/lib/components/emoji/fluent/svg/1f5d1.js +5 -0
  89. package/lib/components/emoji/fluent/svg/1f5dc.d.ts +2 -0
  90. package/lib/components/emoji/fluent/svg/1f5dc.js +5 -0
  91. package/lib/components/emoji/fluent/svg/1f604.d.ts +2 -0
  92. package/lib/components/emoji/fluent/svg/1f604.js +5 -0
  93. package/lib/components/emoji/fluent/svg/1f917.d.ts +2 -0
  94. package/lib/components/emoji/fluent/svg/1f917.js +5 -0
  95. package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.d.ts +2 -0
  96. package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.js +5 -0
  97. package/lib/components/emoji/fluent/svg/1fa79.d.ts +2 -0
  98. package/lib/components/emoji/fluent/svg/1fa79.js +5 -0
  99. package/lib/components/emoji/fluent/svg/1fa9d.d.ts +2 -0
  100. package/lib/components/emoji/fluent/svg/1fa9d.js +5 -0
  101. package/lib/components/emoji/fluent/svg/1fa9f.d.ts +2 -0
  102. package/lib/components/emoji/fluent/svg/1fa9f.js +5 -0
  103. package/lib/components/emoji/fluent/svg/23f3.d.ts +2 -0
  104. package/lib/components/emoji/fluent/svg/23f3.js +5 -0
  105. package/lib/components/emoji/fluent/svg/2611.d.ts +2 -0
  106. package/lib/components/emoji/fluent/svg/2611.js +5 -0
  107. package/lib/components/emoji/fluent/svg/2702.d.ts +2 -0
  108. package/lib/components/emoji/fluent/svg/2702.js +5 -0
  109. package/lib/components/emoji/fluent/svg/270f.d.ts +2 -0
  110. package/lib/components/emoji/fluent/svg/270f.js +5 -0
  111. package/lib/components/emoji/fluent/svg/2728.d.ts +2 -0
  112. package/lib/components/emoji/fluent/svg/2728.js +5 -0
  113. package/lib/components/emoji/fluent/svg/2b1c.d.ts +2 -0
  114. package/lib/components/emoji/fluent/svg/2b1c.js +5 -0
  115. package/lib/components/flashes/FlashClosable.js +2 -17
  116. package/lib/components/mcp/ClientBadge.js +1 -1
  117. package/lib/components/mcp/McpErrorBlankslate.js +1 -1
  118. package/lib/components/mcp/ScopeList.js +1 -1
  119. package/lib/components/notebooks/JupyterNotebook.js +1 -2
  120. package/lib/components/principal/Principal.js +2 -10
  121. package/lib/components/principal/PrincipalAppearance.d.ts +24 -1
  122. package/lib/components/principal/PrincipalAppearance.js +107 -80
  123. package/lib/components/principal/PrincipalAvatar.d.ts +5 -7
  124. package/lib/components/principal/PrincipalAvatar.js +12 -38
  125. package/lib/components/principal/PrincipalBadge.js +3 -13
  126. package/lib/components/principal/PrincipalBanner.js +4 -32
  127. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +4 -7
  128. package/lib/components/principal/PrincipalDetailsOverlay.js +8 -24
  129. package/lib/components/principal/PrincipalHoverCard.js +15 -18
  130. package/lib/components/principal/PrincipalSwitcherMenu.js +15 -83
  131. package/lib/components/progress/ConsumptionBar.js +1 -1
  132. package/lib/components/sharing/ShareAccessComponent.js +21 -229
  133. package/lib/components/sharing/SharingEditor.js +1 -1
  134. package/lib/components/spaces/SpaceDetailsOverlay.js +4 -35
  135. package/lib/components/spaces/SpaceDisplay.js +1 -8
  136. package/lib/components/storage/ContentsBrowser.js +3 -26
  137. package/lib/components/storage/ContentsTable.js +4 -23
  138. package/lib/components/students/StudentResultCircle.js +7 -29
  139. package/lib/components/timeline/Timeline.js +4 -36
  140. package/lib/hooks/layouts/LayoutBackdrop.js +2 -1
  141. package/lib/hooks/layouts/LayoutScreencapture.js +1 -1
  142. package/lib/hooks/libraryApp.d.ts +6 -1
  143. package/lib/hooks/libraryApp.js +10 -1
  144. package/lib/hooks/unlinkIAMProvider.d.ts +22 -0
  145. package/lib/hooks/unlinkIAMProvider.js +24 -0
  146. package/lib/hooks/useAuthorization.js +6 -1
  147. package/lib/hooks/useCache.d.ts +8 -1
  148. package/lib/hooks/useCache.js +35 -4
  149. package/lib/hooks/useNavigate.js +8 -2
  150. package/lib/mocks/components/FlashMock.js +3 -8
  151. package/lib/mocks/views/DashboardMock.js +6 -72
  152. package/lib/mocks/views/FormMock.js +3 -2
  153. package/lib/mocks/views/TableMock.js +3 -2
  154. package/lib/mocks/views/WipMock.js +2 -1
  155. package/lib/models/IAMProviderLinked.d.ts +9 -0
  156. package/lib/models/IAMProviderLinked.js +34 -5
  157. package/lib/models/McpTask.d.ts +18 -1
  158. package/lib/models/McpTask.js +15 -0
  159. package/lib/models/Person.d.ts +9 -0
  160. package/lib/models/Person.js +23 -0
  161. package/lib/models/Profile.d.ts +2 -2
  162. package/lib/models/User.js +5 -12
  163. package/lib/models/UserOnboarding.d.ts +9 -0
  164. package/lib/models/UserOnboarding.js +33 -0
  165. package/lib/otel/views/OtelLive.js +4 -62
  166. package/lib/otel/views/OtelLiveSpans.js +4 -29
  167. package/lib/otel/views/OtelLogsList.js +13 -64
  168. package/lib/otel/views/OtelMetricsChart.js +4 -19
  169. package/lib/otel/views/OtelMetricsList.js +8 -77
  170. package/lib/otel/views/OtelSearchBar.js +3 -12
  171. package/lib/otel/views/OtelSpanDetail.js +9 -79
  172. package/lib/otel/views/OtelSpanTree.js +7 -57
  173. package/lib/otel/views/OtelSqlView.js +5 -99
  174. package/lib/otel/views/OtelSystemView.js +4 -34
  175. package/lib/otel/views/OtelTimeline.js +7 -37
  176. package/lib/otel/views/OtelTimelineRangeSlider.js +7 -140
  177. package/lib/otel/views/OtelTracesList.js +12 -76
  178. package/lib/portable/index.d.ts +9 -0
  179. package/lib/portable/index.js +14 -0
  180. package/lib/portable/states.d.ts +39 -0
  181. package/lib/portable/states.js +71 -0
  182. package/lib/state/substates/NavigationState.d.ts +10 -6
  183. package/lib/state/substates/NavigationState.js +18 -8
  184. package/lib/views/api-keys/APIKeyEdit.js +2 -11
  185. package/lib/views/api-keys/APIKeyNew.js +3 -19
  186. package/lib/views/api-keys/APIKeys.js +6 -11
  187. package/lib/views/api-keys/APIKeysStandalone.js +1 -1
  188. package/lib/views/datasources/DatasourceDetail.d.ts +1 -1
  189. package/lib/views/datasources/DatasourceDetail.js +24 -17
  190. package/lib/views/datasources/DatasourceNew.js +2 -6
  191. package/lib/views/datasources/Datasources.js +2 -14
  192. package/lib/views/iam/SignInSimple.js +8 -64
  193. package/lib/views/mcp/AdmittedClients.js +3 -16
  194. package/lib/views/mcp/AlertDestinations.js +3 -11
  195. package/lib/views/mcp/AlertRules.js +4 -9
  196. package/lib/views/mcp/ApprovalQueue.js +5 -22
  197. package/lib/views/mcp/AuditLog.js +7 -44
  198. package/lib/views/mcp/ConnectedAgents.js +1 -6
  199. package/lib/views/mcp/EnterpriseConsole.js +11 -24
  200. package/lib/views/mcp/IdentityProviders.js +7 -31
  201. package/lib/views/mcp/McpDashboard.js +15 -31
  202. package/lib/views/mcp/McpHome.js +8 -55
  203. package/lib/views/mcp/McpObservability.js +14 -86
  204. package/lib/views/mcp/NotebookRuns.js +6 -13
  205. package/lib/views/mcp/OrganizationPolicy.js +3 -9
  206. package/lib/views/mcp/OrganizationUsage.js +5 -12
  207. package/lib/views/mcp/PersonalPolicy.js +3 -3
  208. package/lib/views/mcp/Policies.js +6 -47
  209. package/lib/views/mcp/PolicyForm.js +1 -9
  210. package/lib/views/mcp/PolicyHistory.js +2 -8
  211. package/lib/views/mcp/RunDetail.d.ts +1 -1
  212. package/lib/views/mcp/RunDetail.js +7 -26
  213. package/lib/views/mcp/ScimProvisioning.js +4 -16
  214. package/lib/views/mcp/ServiceAgents.js +4 -17
  215. package/lib/views/mcp/TeamPolicies.js +7 -19
  216. package/lib/views/mcp/ToolAccess.js +16 -23
  217. package/lib/views/mcp/TraceTimeline.js +8 -23
  218. package/lib/views/otel/DashboardView.js +2 -2
  219. package/lib/views/otel/LogsView.js +2 -2
  220. package/lib/views/otel/MetricsView.js +2 -2
  221. package/lib/views/otel/OtelHeader.js +6 -40
  222. package/lib/views/otel/SqlView.js +2 -2
  223. package/lib/views/otel/SystemView.js +2 -2
  224. package/lib/views/otel/TracesView.js +2 -2
  225. package/lib/views/profile/UserBadge.js +6 -98
  226. package/lib/views/secrets/SecretEdit.js +2 -11
  227. package/lib/views/secrets/SecretNew.js +1 -1
  228. 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 { Box, Button, Spinner, Text } from '@primer/react';
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, { sx: {
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, { sx: {
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, { sx: {
85
- display: 'inline-flex',
86
- alignItems: 'center',
87
- gap: 1,
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, { sx: { 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}`, sx: { 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) })] }));
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 }, paddingRight: '10%' }, 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: () => {
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", sx: { margin: 'auto' }, children: [showGitHubLogin &&
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 &&
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * UserAvatar – Single source of truth for rendering a user's avatar.
3
3
  *
4
- * When a real (non-Gravatar) avatar URL is available it renders a
5
- * {@link DLAvatar}. Otherwise it falls back to a themed, colormoded
6
- * {@link AlienIcon} placeholder so every consumer (profile, sidebar,
7
- * principal overlay, …) shares the same default look.
4
+ * Drawn by primer-addons' `EntityAvatar`, so its ground, shape and ring are
5
+ * the theme's — a person's emoji, chosen icon or photograph, or a themed,
6
+ * colormoded {@link AlienIcon} placeholder, so every consumer (profile,
7
+ * sidebar, principal overlay, …) shares the same look, in every theme.
8
8
  */
9
9
  import type { JSX } from 'react';
10
10
  /**
@@ -14,14 +14,13 @@ import type { JSX } from 'react';
14
14
  export declare function hasRealAvatar(url?: string): boolean;
15
15
  export type UserAvatarProps = {
16
16
  avatarUrl?: string;
17
- avatarIcon?: string;
18
17
  /**
19
- * A literal emoji, checked before `avatarIcon`/`avatarUrl` — an agent's
20
- * face is its emoji, not a photograph or a chosen icon standing in for
21
- * one. Drawn in Fluent Emoji, the same on every platform (LOOP T-20); the
22
- * system's, as text, only for one Datalayer ships no drawing of.
18
+ * The chosen avatar, as it is kept (`components/avatars/avatarChoice`):
19
+ * `emoji:👀` — drawn in Fluent Emoji, the same on every platform (LOOP
20
+ * T-20) — or `@datalayer/icons-react:RobotIcon`. Checked before
21
+ * `avatarUrl`: a chosen picture wins over a photograph.
23
22
  */
24
- avatarEmoji?: string;
23
+ avatar?: string;
25
24
  /** Avatar edge length in pixels. Defaults to 100. */
26
25
  size?: number;
27
26
  /** Render with rounded square corners instead of a circle. Defaults to true. */
@@ -42,5 +41,5 @@ export type UserAvatarProps = {
42
41
  ring?: boolean;
43
42
  className?: string;
44
43
  };
45
- export declare const UserAvatar: ({ avatarUrl, avatarIcon, avatarEmoji, size, square, iconSize, fallbackBackground, fallbackForeground, ring, className, }: UserAvatarProps) => JSX.Element;
44
+ export declare const UserAvatar: ({ avatarUrl, avatar, size, square, iconSize, fallbackBackground, fallbackForeground, ring, className, }: UserAvatarProps) => JSX.Element;
46
45
  export default UserAvatar;
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { AlienIcon } from '@datalayer/icons-react';
3
- import { Box, useColorPalette } from '@datalayer/primer-addons';
4
- import { DLAvatar } from './DLAvatar.js';
5
- import { getPrincipalAvatarIcon } from '../principal/PrincipalAppearance.js';
6
- import { FluentEmoji } from '../emoji/FluentEmoji.js';
3
+ import { EntityAvatar, useColorPalette } from '@datalayer/primer-addons';
4
+ import { getAvatarURL } from '../../utils/index.js';
5
+ import { ChosenAvatar, principalAvatarOf, } from '../principal/PrincipalAppearance.js';
7
6
  /**
8
7
  * Returns `true` when the given URL points to a real user avatar (i.e. not a
9
8
  * Gravatar default placeholder).
@@ -17,59 +16,31 @@ export function hasRealAvatar(url) {
17
16
  }
18
17
  return true;
19
18
  }
20
- export const UserAvatar = ({ avatarUrl, avatarIcon, avatarEmoji, size = 100, square = true, iconSize, fallbackBackground, fallbackForeground, ring = false, className, }) => {
19
+ export const UserAvatar = ({ avatarUrl, avatar, size = 100, square = true, iconSize, fallbackBackground, fallbackForeground, ring = false, className, }) => {
21
20
  const palette = useColorPalette();
21
+ // A rounded square takes the theme's corner, a circle is a circle; the
22
+ // ring is drawn just outside the edge, so the avatar keeps its size.
23
+ const shape = square ? 'rounded' : 'circle';
24
+ const chosen = principalAvatarOf(avatar);
25
+ if (chosen?.kind === 'emoji') {
26
+ return (_jsx(EntityAvatar, { alt: chosen.emoji, className: className, size: size, shape: shape, ring: ring, bg: fallbackBackground || 'canvas.default', children: _jsx(ChosenAvatar, { avatar: avatar, size: iconSize ?? Math.round(size * 0.6) }) }));
27
+ }
22
28
  /*
23
- * The ring, as a shadow rather than a border.
24
- *
25
- * A border would take from the size asked for — the avatar is laid out
26
- * against others of the same measure — so it is drawn just outside the
27
- * edge instead, following whatever shape the avatar has.
29
+ * A chosen icon and the default one are the same drawing in two shapes:
30
+ * the plain icon, coloured by the theme, on the accent's wash.
28
31
  */
29
- const ringSx = ring
30
- ? { boxShadow: '0 0 0 1px var(--borderColor-default, currentColor)' }
31
- : undefined;
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: "" }) }));
43
- }
44
- const SelectedIcon = getPrincipalAvatarIcon(avatarIcon);
45
- 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',
55
- '--datalayer-icon-fg': fallbackForeground || palette.primary,
56
- ...ringSx,
57
- }, children: _jsx(SelectedIcon, { size: iconSize ?? Math.round(size * 0.62), themed: true, colormode: true }) }));
32
+ const iconGround = {
33
+ ...(fallbackBackground ? { bg: fallbackBackground } : undefined),
34
+ style: {
35
+ '--datalayer-icon-fg': fallbackForeground || palette.primary,
36
+ },
37
+ };
38
+ if (chosen?.kind === 'icon') {
39
+ return (_jsx(EntityAvatar, { className: className, size: size, shape: shape, ring: ring, ...iconGround, children: _jsx(ChosenAvatar, { avatar: avatar, size: iconSize ?? Math.round(size * 0.62) }) }));
58
40
  }
59
41
  if (hasRealAvatar(avatarUrl)) {
60
- return (_jsx(DLAvatar, { className: className, square: square, src: avatarUrl, size: size, sx: ringSx }));
42
+ return (_jsx(EntityAvatar, { className: className, src: getAvatarURL(avatarUrl), size: size, shape: shape, ring: ring }));
61
43
  }
62
- 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',
71
- '--datalayer-icon-fg': fallbackForeground || palette.primary,
72
- ...ringSx,
73
- }, children: _jsx(AlienIcon, { size: resolvedIconSize, themed: true, colormode: true }) }));
44
+ return (_jsx(EntityAvatar, { className: className, size: size, shape: shape, ring: ring, ...iconGround, children: _jsx(AlienIcon, { size: iconSize ?? Math.round(size * 0.48), themed: true, colormode: true }) }));
74
45
  };
75
46
  export default UserAvatar;
@@ -8,7 +8,7 @@ import { Box } from '@datalayer/primer-addons';
8
8
  import { AvatarSkeleton } from '../../components/display/index.js';
9
9
  import { UserAvatar } from './UserAvatar.js';
10
10
  const Profile = ({ user, size = 100, onClick }) => {
11
- return (_jsx(Box, { style: { width: size }, onClick: onClick, children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl, avatarIcon: user?.avatarIcon, size: size }) }));
11
+ return (_jsx(Box, { style: { width: size }, onClick: onClick, children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl, avatar: user?.avatarIcon, size: size }) }));
12
12
  };
13
13
  export const UserProfileAvatar = ({ onClick, user, size = 100, }) => {
14
14
  return user ? (onClick ? (_jsx(Link, { href: "javascript: return false;", onClick: onClick, children: _jsx(Profile, { user: user, size: size, onClick: onClick }) })) : (_jsx(Profile, { user: user, size: size, onClick: onClick }))) : (_jsx(AvatarSkeleton, { size: size }));
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The avatar a person, an organization, a team or an application chose, as it
3
+ * is kept: one string, prefixed by what it is.
4
+ *
5
+ * - `emoji:👀` — an emoji, drawn in Fluent Emoji (`FluentEmoji`);
6
+ * - `@datalayer/icons-react:RobotIcon` — a drawing of the avatar set
7
+ * (`PRINCIPAL_AVATAR_ICONS`), by its component name.
8
+ *
9
+ * Nothing else is an avatar: a bare name, an unknown prefix, an icon outside
10
+ * the set or an emoji that is not one is refused, in a sentence.
11
+ *
12
+ * @module components/avatars/avatarChoice
13
+ */
14
+ /** The prefix of an emoji avatar. */
15
+ export declare const AVATAR_EMOJI_PREFIX = "emoji:";
16
+ /** The prefix of an avatar drawn from `@datalayer/icons-react`. */
17
+ export declare const AVATAR_ICON_PREFIX = "@datalayer/icons-react:";
18
+ /** What an avatar is: an emoji, or an icon of the set by name. */
19
+ export type AvatarChoice = {
20
+ kind: 'emoji';
21
+ emoji: string;
22
+ } | {
23
+ kind: 'icon';
24
+ name: string;
25
+ };
26
+ /** Why a value is not an avatar, in a sentence. */
27
+ export declare class AvatarRefused extends Error {
28
+ constructor(message: string);
29
+ }
30
+ /**
31
+ * The avatar a value names.
32
+ *
33
+ * `icons` is the set an icon must belong to (the names of
34
+ * `PRINCIPAL_AVATAR_ICONS`); throws `AvatarRefused` for anything else.
35
+ */
36
+ export declare function parseAvatar(value: string, icons: ReadonlySet<string>): AvatarChoice;
37
+ /** The value an avatar is kept as. */
38
+ export declare function avatarValue(choice: AvatarChoice): string;
39
+ /** An emoji, as an avatar value. */
40
+ export declare const emojiAvatar: (emoji: string) => string;
41
+ /** An icon of the set, by its component name, as an avatar value. */
42
+ export declare const iconAvatar: (name: string) => string;
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * The avatar a person, an organization, a team or an application chose, as it
7
+ * is kept: one string, prefixed by what it is.
8
+ *
9
+ * - `emoji:👀` — an emoji, drawn in Fluent Emoji (`FluentEmoji`);
10
+ * - `@datalayer/icons-react:RobotIcon` — a drawing of the avatar set
11
+ * (`PRINCIPAL_AVATAR_ICONS`), by its component name.
12
+ *
13
+ * Nothing else is an avatar: a bare name, an unknown prefix, an icon outside
14
+ * the set or an emoji that is not one is refused, in a sentence.
15
+ *
16
+ * @module components/avatars/avatarChoice
17
+ */
18
+ /** The prefix of an emoji avatar. */
19
+ export const AVATAR_EMOJI_PREFIX = 'emoji:';
20
+ /** The prefix of an avatar drawn from `@datalayer/icons-react`. */
21
+ export const AVATAR_ICON_PREFIX = '@datalayer/icons-react:';
22
+ /** Why a value is not an avatar, in a sentence. */
23
+ export class AvatarRefused extends Error {
24
+ constructor(message) {
25
+ super(message);
26
+ this.name = 'AvatarRefused';
27
+ }
28
+ }
29
+ /** One emoji: a pictograph, optionally joined and varied, nothing else. */
30
+ const EMOJI = /^(?:\p{Extended_Pictographic}|\p{Regional_Indicator})(?:\p{Extended_Pictographic}|\p{Regional_Indicator}|\p{Emoji_Modifier}|‍|️|⃣)*$/u;
31
+ /** An icon component name of `@datalayer/icons-react`. */
32
+ const ICON_NAME = /^[A-Z][A-Za-z0-9]*Icon$/;
33
+ /**
34
+ * The avatar a value names.
35
+ *
36
+ * `icons` is the set an icon must belong to (the names of
37
+ * `PRINCIPAL_AVATAR_ICONS`); throws `AvatarRefused` for anything else.
38
+ */
39
+ export function parseAvatar(value, icons) {
40
+ if (value.startsWith(AVATAR_EMOJI_PREFIX)) {
41
+ const emoji = value.slice(AVATAR_EMOJI_PREFIX.length);
42
+ if (!emoji || emoji.length > 32 || !EMOJI.test(emoji)) {
43
+ throw new AvatarRefused(`“${emoji}” is not an emoji.`);
44
+ }
45
+ return { kind: 'emoji', emoji };
46
+ }
47
+ if (value.startsWith(AVATAR_ICON_PREFIX)) {
48
+ const name = value.slice(AVATAR_ICON_PREFIX.length);
49
+ if (!ICON_NAME.test(name) || !icons.has(name)) {
50
+ throw new AvatarRefused(`“${name}” is not an avatar of the set.`);
51
+ }
52
+ return { kind: 'icon', name };
53
+ }
54
+ throw new AvatarRefused(`An avatar is “${AVATAR_EMOJI_PREFIX}…” or “${AVATAR_ICON_PREFIX}…”, not “${value}”.`);
55
+ }
56
+ /** The value an avatar is kept as. */
57
+ export function avatarValue(choice) {
58
+ return choice.kind === 'emoji'
59
+ ? `${AVATAR_EMOJI_PREFIX}${choice.emoji}`
60
+ : `${AVATAR_ICON_PREFIX}${choice.name}`;
61
+ }
62
+ /** An emoji, as an avatar value. */
63
+ export const emojiAvatar = (emoji) => `${AVATAR_EMOJI_PREFIX}${emoji}`;
64
+ /** An icon of the set, by its component name, as an avatar value. */
65
+ export const iconAvatar = (name) => `${AVATAR_ICON_PREFIX}${name}`;
@@ -1,4 +1,5 @@
1
1
  export * from './BoringAvatar';
2
2
  export * from './DLAvatar';
3
3
  export * from './UserAvatar';
4
+ export * from './avatarChoice';
4
5
  export * from './UserProfileAvatar';
@@ -5,4 +5,5 @@
5
5
  export * from './BoringAvatar.js';
6
6
  export * from './DLAvatar.js';
7
7
  export * from './UserAvatar.js';
8
+ export * from './avatarChoice.js';
8
9
  export * from './UserProfileAvatar.js';
@@ -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, { sx: { 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, { sx: {
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, { sx: {
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, { sx: { p: 2 }, children: _jsxs(Box, { sx: {
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, { sx: {
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'