@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
@@ -122,7 +122,9 @@ function StripePaymentForm({ clientSecret, intentType = 'payment', onPaymentSucc
122
122
  },
123
123
  };
124
124
  }, [themeIsDark]);
125
- const handleSubmit = useCallback(async (event) => {
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, sx: { display: 'grid', gap: 3 }, children: [_jsx(CardElement, { options: cardOptions, onReady: element => {
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", sx: {
875
- display: 'grid',
876
- gap: 'var(--stack-gap-condensed)',
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", sx: {
898
- display: 'grid',
899
- gap: 'var(--stack-gap-normal)',
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
- }, sx: {
908
- borderStyle: 'solid',
909
- borderRadius: 'var(--borderRadius-medium)',
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, { sx: {
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, { sx: {
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", sx: {
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, { sx: { flex: '1 1 auto', display: 'grid', gap: 3 }, children: [_jsxs(Box, { sx: {
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, { sx: { flex: '1 1 auto', display: 'grid', gap: 3 }, children: [_jsxs(Box, { sx: {
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, { sx: { minHeight: '40px', display: 'grid', placeItems: 'center' }, children: _jsx(Spinner, {}) }));
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, { sx: { flex: '1 1 auto' }, onKeyDown: event => {
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, { sx: {
1169
- marginTop: 'var(--stack-gap-normal)',
1170
- border: '1px solid',
1171
- borderColor: 'border.default',
1172
- borderRadius: 'var(--borderRadius-medium)',
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
  }
@@ -23,12 +23,11 @@ export type LiveCollaborator = {
23
23
  id: string;
24
24
  name: string;
25
25
  avatarUrl?: string;
26
- avatarIcon?: string;
27
26
  /**
28
- * A literal emoji, for a face this platform draws rather than a person's
29
- * own — an agent's — checked before `avatarUrl`/`avatarIcon`.
27
+ * The chosen avatar, as it is kept: `emoji:…` or
28
+ * `@datalayer/icons-react:…`; an agent's face is its emoji (`emoji:…`).
30
29
  */
31
- avatarEmoji?: string;
30
+ avatar?: string;
32
31
  /** Cursor color of the presence, worn by the initials disc. */
33
32
  color?: string;
34
33
  /** The platform uid, when the face is a real account — for its profile. */
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from 'react';
3
3
  import { AvatarStack } from '@primer/react';
4
+ import { emojiAvatar } from '../avatars/avatarChoice.js';
4
5
  import { PrincipalAvatar } from '../principal/PrincipalAvatar.js';
5
6
  import { PrincipalHoverCard } from '../principal/PrincipalHoverCard.js';
6
7
  /** The `user` field of an awareness state, in its several spellings. */
@@ -36,8 +37,10 @@ function collaboratorOfState(clientId, state) {
36
37
  id: String(uid ?? user.username ?? clientId),
37
38
  name,
38
39
  avatarUrl: user.avatar_url || user.avatarUrl || undefined,
39
- avatarIcon: user.avatar_icon_s || user.avatarIcon || undefined,
40
- avatarEmoji: user.avatar_emoji_s || user.avatarEmoji || undefined,
40
+ // A person's chosen avatar; an agent announces its face as an emoji.
41
+ avatar: user.avatar_icon_s ||
42
+ user.avatarIcon ||
43
+ (user.avatar_emoji_s ? emojiAvatar(user.avatar_emoji_s) : undefined),
41
44
  color: user.color || undefined,
42
45
  uid: uid ? String(uid) : undefined,
43
46
  handle: user.handle || username || undefined,
@@ -58,8 +61,7 @@ function mergeCollaborators(known, incoming) {
58
61
  uid: known.uid || incoming.uid,
59
62
  handle: known.handle || incoming.handle,
60
63
  avatarUrl: known.avatarUrl || incoming.avatarUrl,
61
- avatarIcon: known.avatarIcon || incoming.avatarIcon,
62
- avatarEmoji: known.avatarEmoji || incoming.avatarEmoji,
64
+ avatar: known.avatar || incoming.avatar,
63
65
  color: known.color || incoming.color,
64
66
  };
65
67
  }
@@ -159,6 +161,6 @@ export function LiveEditorCollaborators(props) {
159
161
  // person arrives now under their uid, now under a client id, and a
160
162
  // key that followed that would unmount the hover card mid-open and
161
163
  // leak its overlay. Their identity, not their arrival, names them.
162
- , { kind: "personal", uid: face.uid, handle: face.handle, displayName: face.name, name: face.name, avatarUrl: face.avatarUrl, avatarIcon: face.avatarIcon, avatarEmoji: face.avatarEmoji, onNavigate: onNavigate, children: _jsx(PrincipalAvatar, { kind: "personal", size: size, alt: face.name, avatarUrl: face.avatarUrl, avatarIcon: face.avatarIcon, avatarEmoji: face.avatarEmoji, square: false }) }, face.uid || face.handle || face.name.trim().toLowerCase()))) }));
164
+ , { kind: "personal", uid: face.uid, handle: face.handle, displayName: face.name, name: face.name, avatarUrl: face.avatarUrl, avatar: face.avatar, onNavigate: onNavigate, children: _jsx(PrincipalAvatar, { kind: "personal", size: size, alt: face.name, avatarUrl: face.avatarUrl, avatar: face.avatar, square: false }) }, face.uid || face.handle || face.name.trim().toLowerCase()))) }));
163
165
  }
164
166
  export default LiveEditorCollaborators;
@@ -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
- ':hover': onOpen ? { bg: 'canvas.subtle' } : undefined,
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) ? selectedUids.delete(object.uid) : selectedUids.add(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, { sx: { p: 4, display: 'flex', justifyContent: 'center' }, children: _jsx(Spinner, {}) }));
91
+ return (_jsx(Box, { p: 4, display: "flex", justifyContent: "center", children: _jsx(Spinner, {}) }));
90
92
  }
91
93
  if (objects.isError) {
92
- return (_jsxs(Box, { sx: { p: 3, border: '1px solid', borderColor: 'danger.muted' }, children: [_jsx(Text, { sx: { color: 'danger.fg' }, children: objects.error instanceof Error
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, { sx: { mb: 3 }, children: [_jsx(ProgressBar, { progress: uploadProgress.total
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, { sx: { mb: 3 }, children: [_jsx(Text, { as: "p", sx: { color: 'danger.fg', mb: 2 }, children: uploadObject.error.message }), failedUpload && (_jsxs(Box, { sx: { 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, { sx: {
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, { sx: { 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, { sx: { 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, { sx: {
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;