@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
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from 'react';
3
- import { AnchoredOverlay, Box, ThemeProvider } from '@primer/react';
3
+ import { Box } from '@datalayer/primer-addons';
4
+ import { AnchoredOverlay, ThemeProvider } from '@primer/react';
4
5
  import { PrincipalDetailsCard, } from './PrincipalDetailsOverlay.js';
5
6
  /** How long the card lingers after the pointer leaves, to let it be entered. */
6
7
  const HIDE_DELAY_MS = 200;
@@ -30,23 +31,19 @@ export function PrincipalHoverCard({ children, className, ...principal }) {
30
31
  onMouseEnter: show,
31
32
  onMouseLeave: hide,
32
33
  preventFocusOnOpen: true,
33
- }, renderAnchor: anchorProps => (_jsx(Box, { ...anchorProps, className: [className, anchorProps.className]
34
+ }, renderAnchor: anchorProps => (_jsx(Box
35
+ // Primer's anchor props, as the record of props Box takes.
36
+ , { ...anchorProps, className: [className, anchorProps.className]
34
37
  .filter(Boolean)
35
- .join(' '), onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, sx: {
36
- display: 'flex',
37
- alignItems: 'center',
38
- justifyContent: 'center',
39
- cursor: 'pointer',
40
- /*
41
- * Round, like the face it holds.
42
- *
43
- * This box stands between the stack and the avatar — it is the
44
- * element `AvatarStack` sizes and clips as one of its items — so a
45
- * square one clipped a round avatar into a square. It takes the
46
- * shape of what it wraps.
47
- */
48
- borderRadius: '50%',
49
- overflow: 'hidden',
50
- }, children: children })), children: _jsx(ThemeProvider, { children: _jsx(PrincipalDetailsCard, { ...principal }) }) }));
38
+ .join(' '), onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer",
39
+ /*
40
+ * Round, like the face it holds.
41
+ *
42
+ * This box stands between the stack and the avatar — it is the
43
+ * element `AvatarStack` sizes and clips as one of its items — so a
44
+ * square one clipped a round avatar into a square. It takes the
45
+ * shape of what it wraps.
46
+ */
47
+ borderRadius: "50%", overflow: "hidden", children: children })), children: _jsx(ThemeProvider, { children: _jsx(PrincipalDetailsCard, { ...principal }) }) }));
51
48
  }
52
49
  export default PrincipalHoverCard;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from 'react';
3
- import { ActionList, ActionMenu, Box, Button, Text, ThemeProvider, } from '@primer/react';
3
+ import { Box } from '@datalayer/primer-addons';
4
+ import { ActionList, ActionMenu, Button, Text, ThemeProvider, } from '@primer/react';
4
5
  import { OrganizationIcon, PeopleIcon, PersonIcon, TriangleDownIcon, } from '@primer/octicons-react';
5
6
  import { useCache, useAuthorization } from '../../hooks/index.js';
6
7
  import { useCoreStore } from '../../state/index.js';
@@ -198,38 +199,12 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
198
199
  color: 'accent.fg',
199
200
  fontWeight: 'semibold',
200
201
  };
201
- return (_jsx(ThemeProvider, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: showClosedBorder ? (_jsxs(Box, { as: "button", type: "button", "aria-label": "Switch principal", sx: {
202
- width: fullWidth ? '100%' : 'auto',
203
- boxSizing: 'border-box',
204
- px: 2,
205
- py: 2,
206
- fontSize: 0,
207
- display: 'flex',
208
- alignItems: 'center',
209
- justifyContent: 'space-between',
210
- gap: 2,
202
+ return (_jsx(ThemeProvider, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: showClosedBorder ? (_jsxs(Box, { as: "button", type: "button", "aria-label": "Switch principal", width: fullWidth ? '100%' : 'auto', boxSizing: "border-box", px: 2, py: 2, fontSize: 0, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, bg: "canvas.subtle", border: "1px solid", borderColor: "border.default", borderRadius: 2, cursor: "pointer", textAlign: "left", transition: "background-color 120ms ease", hover: { bg: 'canvas.subtle' }, focusVisible: {
211
203
  bg: 'canvas.subtle',
212
- border: '1px solid',
213
- borderColor: 'border.default',
214
- borderRadius: 2,
215
- cursor: 'pointer',
216
- textAlign: 'left',
217
- transition: 'background-color 120ms ease',
218
- ':hover': {
219
- bg: 'canvas.subtle',
220
- },
221
- ':focus-visible': {
222
- bg: 'canvas.subtle',
223
- outline: '2px solid',
224
- outlineColor: 'accent.emphasis',
225
- outlineOffset: '2px',
226
- },
227
- }, children: [_jsx(Box, { sx: {
228
- display: 'inline-flex',
229
- alignItems: 'center',
230
- color: 'fg.muted',
231
- flexShrink: 0,
232
- }, children: selectedPrincipalKind === 'organization' ? (_jsx(PeopleIcon, { size: 16 })) : selectedPrincipalKind === 'team' ? (_jsx(OrganizationIcon, { size: 16 })) : (_jsx(PersonIcon, { size: 16 })) }), _jsx(Box, { sx: { minWidth: 0, flex: 1 }, children: _jsx(Text, { sx: {
204
+ outline: '2px solid',
205
+ outlineColor: 'accent.emphasis',
206
+ outlineOffset: '2px',
207
+ }, children: [_jsx(Box, { display: "inline-flex", alignItems: "center", color: "fg.muted", flexShrink: 0, children: selectedPrincipalKind === 'organization' ? (_jsx(PeopleIcon, { size: 16 })) : selectedPrincipalKind === 'team' ? (_jsx(OrganizationIcon, { size: 16 })) : (_jsx(PersonIcon, { size: 16 })) }), _jsx(Box, { minWidth: 0, flex: 1, children: _jsx(Text, { sx: {
233
208
  display: 'block',
234
209
  color: 'accent.fg',
235
210
  fontWeight: 'semibold',
@@ -238,35 +213,10 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
238
213
  overflow: 'hidden',
239
214
  textOverflow: 'ellipsis',
240
215
  maxWidth: '100%',
241
- }, children: selectedPrincipalLabelClosed }) }), isPlatformAdmin && isCurrentUserPrincipal ? (_jsx(Box, { sx: {
242
- flexShrink: 0,
243
- display: 'inline-flex',
244
- alignItems: 'center',
245
- }, children: _jsx(AdminLabel, {}) })) : null, _jsx(Box, { sx: {
246
- display: 'inline-flex',
247
- alignItems: 'center',
248
- color: 'fg.muted',
249
- flexShrink: 0,
250
- ml: isPlatformAdmin && isCurrentUserPrincipal ? 1 : 0,
251
- }, children: _jsx(TriangleDownIcon, { size: 12 }) })] })) : (_jsx(Button, { variant: "invisible", size: "small", "aria-label": "Switch principal", trailingVisual: TriangleDownIcon, sx: {
216
+ }, children: selectedPrincipalLabelClosed }) }), isPlatformAdmin && isCurrentUserPrincipal ? (_jsx(Box, { flexShrink: 0, display: "inline-flex", alignItems: "center", children: _jsx(AdminLabel, {}) })) : null, _jsx(Box, { display: "inline-flex", alignItems: "center", color: "fg.muted", flexShrink: 0, ml: isPlatformAdmin && isCurrentUserPrincipal ? 1 : 0, children: _jsx(TriangleDownIcon, { size: 12 }) })] })) : (_jsx(Button, { variant: "invisible", size: "small", "aria-label": "Switch principal", trailingVisual: TriangleDownIcon, sx: {
252
217
  maxWidth: fullWidth ? '100%' : ['200px', '260px', '360px'],
253
218
  width: fullWidth ? '100%' : 'auto',
254
- }, children: _jsxs(Box, { sx: {
255
- display: 'inline-flex',
256
- alignItems: 'center',
257
- gap: 1,
258
- minWidth: 0,
259
- }, children: [_jsx(Box, { sx: {
260
- display: 'inline-flex',
261
- alignItems: 'center',
262
- color: 'fg.muted',
263
- flexShrink: 0,
264
- }, children: selectedPrincipalKind === 'organization' ? (_jsx(PeopleIcon, { size: 16 })) : selectedPrincipalKind === 'team' ? (_jsx(OrganizationIcon, { size: 16 })) : (_jsx(PersonIcon, { size: 16 })) }), _jsx(Box, { sx: {
265
- minWidth: 0,
266
- overflow: 'hidden',
267
- textOverflow: 'ellipsis',
268
- whiteSpace: 'nowrap',
269
- }, children: _jsx(Text, { sx: {
219
+ }, children: _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, minWidth: 0, children: [_jsx(Box, { display: "inline-flex", alignItems: "center", color: "fg.muted", flexShrink: 0, children: selectedPrincipalKind === 'organization' ? (_jsx(PeopleIcon, { size: 16 })) : selectedPrincipalKind === 'team' ? (_jsx(OrganizationIcon, { size: 16 })) : (_jsx(PersonIcon, { size: 16 })) }), _jsx(Box, { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: _jsx(Text, { sx: {
270
220
  color: 'accent.fg',
271
221
  fontWeight: 'semibold',
272
222
  }, children: selectedPrincipalLabelClosed }) }), isPlatformAdmin && isCurrentUserPrincipal ? (_jsx(AdminLabel, {})) : null] }) })) }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Personal" }), _jsxs(ActionList.Item, { disabled: isCurrentUserPrincipal, selected: isCurrentUserPrincipal, sx: isCurrentUserPrincipal ? selectedItemSx : undefined, onSelect: () => {
@@ -276,16 +226,10 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
276
226
  if (personalUid && personalHandle) {
277
227
  selectUser(personalUid, personalHandle);
278
228
  }
279
- }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl, avatarIcon: user?.avatarIcon, size: 16, square: false, ring: true }) }), _jsxs(Box, { as: "span", sx: {
280
- display: 'block',
281
- minWidth: 0,
282
- overflow: 'hidden',
283
- textOverflow: 'ellipsis',
284
- whiteSpace: 'nowrap',
285
- }, children: [String(user?.friendlyName ||
229
+ }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl, avatar: user?.avatarIcon, size: 16, square: false, ring: true }) }), _jsxs(Box, { as: "span", display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: [String(user?.friendlyName ||
286
230
  user?.displayName ||
287
231
  personalHandle ||
288
- 'Me').trim(), _jsxs(Box, { as: "span", sx: { color: 'fg.muted' }, children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: personalHandle || 'me' })] })] }), isPlatformAdmin ? (_jsx(ActionList.TrailingVisual, { children: _jsx(AdminLabel, {}) })) : null] })] }), _jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Organizations" }), organizations.length === 0 ? (_jsx(ActionList.Item, { disabled: true, children: "No organizations" })) : (organizations.map((organization) => {
232
+ 'Me').trim(), _jsxs(Box, { as: "span", color: "fg.muted", children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: personalHandle || 'me' })] })] }), isPlatformAdmin ? (_jsx(ActionList.TrailingVisual, { children: _jsx(AdminLabel, {}) })) : null] })] }), _jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Organizations" }), organizations.length === 0 ? (_jsx(ActionList.Item, { disabled: true, children: "No organizations" })) : (organizations.map((organization) => {
289
233
  const organizationUid = getOrganizationUid(organization);
290
234
  const isCurrentOrganizationPrincipal = selectedPrincipalKind === 'organization' &&
291
235
  selectedPrincipalUid === organizationUid;
@@ -298,17 +242,11 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
298
242
  if (organizationUid && organization.handle) {
299
243
  selectOrganization(organizationUid, organization.handle);
300
244
  }
301
- }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(PeopleIcon, {}) }), _jsxs(Box, { as: "span", title: displayHandleText(organization.handle), sx: {
302
- display: 'block',
303
- minWidth: 0,
304
- overflow: 'hidden',
305
- textOverflow: 'ellipsis',
306
- whiteSpace: 'nowrap',
307
- }, children: [String(organization?.display_name ||
245
+ }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(PeopleIcon, {}) }), _jsxs(Box, { as: "span", title: displayHandleText(organization.handle), display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: [String(organization?.display_name ||
308
246
  organization?.displayName ||
309
247
  organization?.name ||
310
248
  organization?.handle ||
311
- 'Organization').trim(), _jsxs(Box, { as: "span", sx: { color: 'fg.muted' }, children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: organization.handle })] })] })] }, organizationUid));
249
+ 'Organization').trim(), _jsxs(Box, { as: "span", color: "fg.muted", children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: organization.handle })] })] })] }, organizationUid));
312
250
  }))] }), _jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Teams" }), teams.length === 0 ? (_jsx(ActionList.Item, { disabled: true, children: "No teams" })) : (teams.map(team => {
313
251
  const isCurrentTeamPrincipal = selectedPrincipalKind === 'team' &&
314
252
  selectedPrincipalUid === team.uid;
@@ -320,16 +258,10 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
320
258
  return;
321
259
  }
322
260
  selectTeam(team, orgHandle);
323
- }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(OrganizationIcon, {}) }), _jsxs(Box, { as: "span", title: `${displayHandleText(orgHandle)}/${displayHandleText(team.handle, { withAt: false })}`, sx: {
324
- display: 'block',
325
- minWidth: 0,
326
- overflow: 'hidden',
327
- textOverflow: 'ellipsis',
328
- whiteSpace: 'nowrap',
329
- }, children: [String(team.displayName ||
261
+ }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(OrganizationIcon, {}) }), _jsxs(Box, { as: "span", title: `${displayHandleText(orgHandle)}/${displayHandleText(team.handle, { withAt: false })}`, display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: [String(team.displayName ||
330
262
  team.name ||
331
263
  team.handle ||
332
- 'Team').trim(), _jsxs(Box, { as: "span", sx: { color: 'fg.muted' }, children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: orgHandle }), "/", _jsx(DisplayHandle, { handle: team.handle, withAt: false })] })] })] }, team.uid));
264
+ 'Team').trim(), _jsxs(Box, { as: "span", color: "fg.muted", children: [' ', "\u00B7 ", _jsx(DisplayHandle, { handle: orgHandle }), "/", _jsx(DisplayHandle, { handle: team.handle, withAt: false })] })] })] }, team.uid));
333
265
  }))] })] }) })] }) }));
334
266
  }
335
267
  export default PrincipalSwitcherMenu;
@@ -66,5 +66,5 @@ export function ConsumptionBar(props) {
66
66
  ...(paddingRight !== undefined ? { paddingRight } : {}),
67
67
  ...(paddingTop !== undefined ? { paddingTop } : {}),
68
68
  ...(paddingBottom !== undefined ? { paddingBottom } : {}),
69
- }, children: _jsx(Box, { sx: { width: '70px' }, children: _jsx(ProgressBar, { style: style, animated: expiredAt ? false : true, bg: bg, progress: progress }) }) }) }) }));
69
+ }, children: _jsx(Box, { width: "70px", children: _jsx(ProgressBar, { style: style, animated: expiredAt ? false : true, bg: bg, progress: progress }) }) }) }) }));
70
70
  }
@@ -314,13 +314,7 @@ export function hydrateAccessFromSharing(sharing, levels) {
314
314
  // Avatar shimmer (used while a user row is being hydrated).
315
315
  // ---------------------------------------------------------------------------
316
316
  function AvatarShimmer({ size = 20 }) {
317
- return (_jsx(Box, { sx: {
318
- width: size,
319
- height: size,
320
- borderRadius: '50%',
321
- backgroundImage: 'linear-gradient(90deg, var(--bgColor-muted, #d0d7de) 25%, var(--bgColor-default, #ffffff) 50%, var(--bgColor-muted, #d0d7de) 75%)',
322
- backgroundSize: '220% 100%',
323
- animation: 'avatarShimmerAcl 1.2s ease-in-out infinite',
317
+ return (_jsx(Box, { width: size, height: size, borderRadius: "50%", backgroundImage: "linear-gradient(90deg, var(--bgColor-muted, #d0d7de) 25%, var(--bgColor-default, #ffffff) 50%, var(--bgColor-muted, #d0d7de) 75%)", backgroundSize: "220% 100%", animation: "avatarShimmerAcl 1.2s ease-in-out infinite", sx: {
324
318
  '@keyframes avatarShimmerAcl': {
325
319
  '0%': { backgroundPosition: '100% 0' },
326
320
  '100%': { backgroundPosition: '-100% 0' },
@@ -336,28 +330,12 @@ function AvatarShimmer({ size = 20 }) {
336
330
  * pushed through the personal/team/organization avatar system.
337
331
  */
338
332
  function AgentAvatar({ size = 20 }) {
339
- return (_jsx(Box, { sx: {
340
- display: 'inline-flex',
341
- alignItems: 'center',
342
- justifyContent: 'center',
343
- width: size,
344
- height: size,
345
- borderRadius: 2,
346
- bg: 'canvas.subtle',
347
- color: 'fg.muted',
348
- flexShrink: 0,
349
- }, "aria-label": "Agent", children: _jsx(KeyIcon, { size: Math.max(12, Math.round(size * 0.6)) }) }));
333
+ return (_jsx(Box, { display: "inline-flex", alignItems: "center", justifyContent: "center", width: size, height: size, borderRadius: 2, bg: "canvas.subtle", color: "fg.muted", flexShrink: 0, "aria-label": "Agent", children: _jsx(KeyIcon, { size: Math.max(12, Math.round(size * 0.6)) }) }));
350
334
  }
351
335
  /** An agent as it appears in a row of principals: key, name, and the label
352
336
  * that says what it is, so an agent is never mistaken for a person. */
353
337
  function AgentPrincipalChip({ displayName, size = 20, }) {
354
- return (_jsxs(Box, { sx: {
355
- display: 'inline-flex',
356
- alignItems: 'center',
357
- gap: 1,
358
- minWidth: 0,
359
- flexWrap: 'wrap',
360
- }, children: [_jsx(AgentAvatar, { size: size }), _jsx(Text, { sx: { minWidth: 0 }, children: displayName }), _jsx(Label, { size: "small", children: "Agent" })] }));
338
+ return (_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, minWidth: 0, flexWrap: "wrap", children: [_jsx(AgentAvatar, { size: size }), _jsx(Text, { sx: { minWidth: 0 }, children: displayName }), _jsx(Label, { size: "small", children: "Agent" })] }));
361
339
  }
362
340
  function OwnerPrincipalRow({ ownerPrincipal, cache, showAvatarSkeleton = false, isPlatformAdmin, }) {
363
341
  const entry = cache[principalKey(ownerPrincipal.kind, ownerPrincipal.uid)] || {};
@@ -373,12 +351,7 @@ function OwnerPrincipalRow({ ownerPrincipal, cache, showAvatarSkeleton = false,
373
351
  const resolvedOrigin = ownerPrincipal.origin ||
374
352
  entry.origin ||
375
353
  (ownerPrincipal.kind === 'personal' ? 'Datalayer' : undefined);
376
- return (_jsx(Box, { sx: {
377
- display: 'inline-flex',
378
- alignItems: 'center',
379
- gap: 1,
380
- flexWrap: 'wrap',
381
- }, children: showAvatarSkeleton ? (_jsxs(_Fragment, { children: [_jsx(AvatarShimmer, { size: 20 }), _jsx(Text, { sx: { fontWeight: 'semibold' }, children: resolvedDisplayName })] })) : (_jsx(PrincipalBadge, { principal: {
354
+ return (_jsx(Box, { display: "inline-flex", alignItems: "center", gap: 1, flexWrap: "wrap", children: showAvatarSkeleton ? (_jsxs(_Fragment, { children: [_jsx(AvatarShimmer, { size: 20 }), _jsx(Text, { sx: { fontWeight: 'semibold' }, children: resolvedDisplayName })] })) : (_jsx(PrincipalBadge, { principal: {
382
355
  kind: ownerPrincipal.kind,
383
356
  uid: ownerPrincipal.uid,
384
357
  displayName: resolvedDisplayName,
@@ -394,12 +367,7 @@ function AccessPrincipalRow({ entry, cache, showAvatarSkeleton = false, isPlatfo
394
367
  const safeCachedHandle = cachedHandle && cachedHandle !== entry.uid ? cachedHandle : '';
395
368
  const resolvedHandle = safeCachedHandle || cached.accountHandle;
396
369
  const resolvedDisplayName = ensurePrincipalDisplayName(entry.kind, cached.displayName, formatPrincipalHandle(entry.kind, resolvedHandle, cached.accountHandle), resolvedHandle, entry.uid);
397
- return (_jsx(Box, { sx: {
398
- display: 'inline-flex',
399
- alignItems: 'center',
400
- gap: 1,
401
- flexWrap: 'wrap',
402
- }, children: showAvatarSkeleton ? (_jsxs(_Fragment, { children: [_jsx(AvatarShimmer, { size: 20 }), _jsx(Text, { children: resolvedDisplayName })] })) : entry.kind === 'agent' ? (_jsx(AgentPrincipalChip, { displayName: resolvedDisplayName })) : (_jsx(PrincipalBadge, { principal: {
370
+ return (_jsx(Box, { display: "inline-flex", alignItems: "center", gap: 1, flexWrap: "wrap", children: showAvatarSkeleton ? (_jsxs(_Fragment, { children: [_jsx(AvatarShimmer, { size: 20 }), _jsx(Text, { children: resolvedDisplayName })] })) : entry.kind === 'agent' ? (_jsx(AgentPrincipalChip, { displayName: resolvedDisplayName })) : (_jsx(PrincipalBadge, { principal: {
403
371
  kind: entry.kind,
404
372
  uid: entry.uid,
405
373
  displayName: resolvedDisplayName,
@@ -1228,142 +1196,34 @@ export function ShareAccessComponent({ isOpen, requestUrl, transport, resourceLa
1228
1196
  if (!alreadyAdded) {
1229
1197
  addPrincipal(principal.kind, principal.uid);
1230
1198
  }
1231
- }, disabled: alreadyAdded || isSaving || isReadOnly, sx: {
1232
- all: 'unset',
1233
- display: 'flex',
1234
- alignItems: 'center',
1235
- justifyContent: 'space-between',
1236
- gap: 2,
1237
- px: 2,
1238
- py: 2,
1239
- cursor: alreadyAdded || isSaving || isReadOnly ? 'not-allowed' : 'pointer',
1240
- opacity: alreadyAdded ? 0.55 : 1,
1241
- borderRadius: 2,
1242
- borderWidth: 1,
1243
- borderStyle: 'solid',
1244
- borderColor: 'border.default',
1245
- bg: 'canvas.default',
1246
- ':hover': {
1247
- bg: alreadyAdded || isSaving || isReadOnly
1248
- ? 'canvas.default'
1249
- : 'canvas.subtle',
1250
- },
1251
- }, children: [_jsxs(Box, { sx: {
1252
- display: 'inline-flex',
1253
- alignItems: 'center',
1254
- gap: 2,
1255
- minWidth: 0,
1256
- }, children: [principal.kind === 'agent' ? (_jsx(AgentAvatar, { size: 22 })) : (_jsx(PrincipalAvatar, { kind: principal.kind, avatarUrl: principal.avatarUrl || undefined, alt: displayName, size: 22 })), _jsxs(Box, { sx: { display: 'grid', minWidth: 0 }, children: [_jsxs(Box, { sx: {
1257
- display: 'inline-flex',
1258
- alignItems: 'center',
1259
- gap: 1,
1260
- flexWrap: 'wrap',
1261
- }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: displayName }), principal.kind === 'personal' &&
1199
+ }, disabled: alreadyAdded || isSaving || isReadOnly, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, px: 2, py: 2, cursor: alreadyAdded || isSaving || isReadOnly ? 'not-allowed' : 'pointer', opacity: alreadyAdded ? 0.55 : 1, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.default", hover: {
1200
+ bg: alreadyAdded || isSaving || isReadOnly
1201
+ ? 'canvas.default'
1202
+ : 'canvas.subtle',
1203
+ }, all: "unset", children: [_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 2, minWidth: 0, children: [principal.kind === 'agent' ? (_jsx(AgentAvatar, { size: 22 })) : (_jsx(PrincipalAvatar, { kind: principal.kind, avatarUrl: principal.avatarUrl || undefined, alt: displayName, size: 22 })), _jsxs(Box, { display: "grid", minWidth: 0, children: [_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, flexWrap: "wrap", children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: displayName }), principal.kind === 'personal' &&
1262
1204
  user?.uid &&
1263
- principal.uid === user.uid && (_jsx(Label, { size: "small", variant: "accent", children: "You" }))] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["@", principal.handle, principal.kind === 'team' && principal.organizationHandle && (_jsxs(Text, { as: "span", sx: { color: 'fg.muted' }, children: [' · ', "org @", principal.organizationHandle] }))] })] })] }), _jsxs(Box, { sx: { display: 'inline-flex', alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { size: 14 }), alreadyAdded ? (_jsx(Label, { size: "small", variant: "success", children: "Added" })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Add" }))] })] }, principalKey(principal.kind, principal.uid)));
1205
+ principal.uid === user.uid && (_jsx(Label, { size: "small", variant: "accent", children: "You" }))] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["@", principal.handle, principal.kind === 'team' && principal.organizationHandle && (_jsxs(Text, { as: "span", sx: { color: 'fg.muted' }, children: [' · ', "org @", principal.organizationHandle] }))] })] })] }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(Icon, { size: 14 }), alreadyAdded ? (_jsx(Label, { size: "small", variant: "success", children: "Added" })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Add" }))] })] }, principalKey(principal.kind, principal.uid)));
1264
1206
  };
1265
1207
  const renderShareableGroup = (label, items) => {
1266
1208
  if (items.length === 0) {
1267
1209
  return null;
1268
1210
  }
1269
- return (_jsxs(Box, { sx: { display: 'grid', gap: 1 }, children: [_jsx(Text, { sx: {
1211
+ return (_jsxs(Box, { display: "grid", gap: 1, children: [_jsx(Text, { sx: {
1270
1212
  fontSize: 0,
1271
1213
  color: 'fg.muted',
1272
1214
  textTransform: 'uppercase',
1273
1215
  letterSpacing: 0.4,
1274
- }, children: label }), _jsx(Box, { sx: { display: 'grid', gap: 1 }, children: items.map(renderShareablePrincipalRow) })] }));
1216
+ }, children: label }), _jsx(Box, { display: "grid", gap: 1, children: items.map(renderShareablePrincipalRow) })] }));
1275
1217
  };
1276
- const content = (_jsxs(Box, { sx: { p: 3, display: 'flex', flexDirection: 'column', gap: 3 }, children: [sharingAccessMessage && (_jsxs(Box, { sx: {
1277
- px: 3,
1278
- py: 3,
1279
- borderRadius: 2,
1280
- borderWidth: 1,
1281
- borderStyle: 'solid',
1282
- borderColor: 'attention.muted',
1283
- bg: 'attention.subtle',
1284
- display: 'grid',
1285
- gap: 1,
1286
- }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "Sharing access is restricted" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: sharingAccessMessage })] })), _jsxs(Box, { sx: {
1287
- opacity: isReadOnly ? 0.6 : 1,
1288
- pointerEvents: isReadOnly ? 'none' : 'auto',
1289
- display: 'flex',
1290
- flexDirection: 'column',
1291
- gap: 3,
1292
- }, "aria-disabled": isReadOnly, children: [_jsxs(Box, { sx: {
1293
- px: 3,
1294
- py: 2,
1295
- borderRadius: 2,
1296
- borderWidth: 1,
1297
- borderStyle: 'solid',
1298
- borderColor: 'border.default',
1299
- bg: 'canvas.subtle',
1300
- display: 'flex',
1301
- alignItems: 'flex-start',
1302
- justifyContent: 'space-between',
1303
- gap: 2,
1304
- }, children: [_jsx(Box, { sx: { display: 'grid', gap: 1 }, children: _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: ["Share ", resourceName || `this ${resourceLabel.toLowerCase()}`, ". Pick a principal below \u2014 they will be granted the selected access level."] }) }), _jsxs(ActionMenu, { children: [_jsxs(Box, { sx: { display: 'inline-flex', alignItems: 'center', gap: 1 }, children: [_jsx(ActionMenu.Anchor, { children: _jsxs(Button, { variant: "default", size: "small", leadingVisual: KeyIcon, disabled: isSaving || isReadOnly, children: ["Access:", ' ', levelLabels[selectedAccessLevel] || selectedAccessLevel] }) }), _jsx(Button, { variant: "invisible", size: "small", leadingVisual: isExpanded ? ChevronUpIcon : ChevronDownIcon, onClick: () => setIsExpanded(previous => !previous), "aria-label": isExpanded
1218
+ const content = (_jsxs(Box, { p: 3, display: "flex", flexDirection: "column", gap: 3, children: [sharingAccessMessage && (_jsxs(Box, { px: 3, py: 3, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "attention.muted", bg: "attention.subtle", display: "grid", gap: 1, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "Sharing access is restricted" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: sharingAccessMessage })] })), _jsxs(Box, { opacity: isReadOnly ? 0.6 : 1, pointerEvents: isReadOnly ? 'none' : 'auto', display: "flex", flexDirection: "column", gap: 3, "aria-disabled": isReadOnly, children: [_jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.subtle", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { display: "grid", gap: 1, children: _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: ["Share ", resourceName || `this ${resourceLabel.toLowerCase()}`, ". Pick a principal below \u2014 they will be granted the selected access level."] }) }), _jsxs(ActionMenu, { children: [_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(ActionMenu.Anchor, { children: _jsxs(Button, { variant: "default", size: "small", leadingVisual: KeyIcon, disabled: isSaving || isReadOnly, children: ["Access:", ' ', levelLabels[selectedAccessLevel] || selectedAccessLevel] }) }), _jsx(Button, { variant: "invisible", size: "small", leadingVisual: isExpanded ? ChevronUpIcon : ChevronDownIcon, onClick: () => setIsExpanded(previous => !previous), "aria-label": isExpanded
1305
1219
  ? 'Shrink sharing details'
1306
- : 'Expand sharing details', children: isExpanded ? 'Shrink details' : 'Expand details' })] }), _jsx(ActionMenu.Overlay, { width: "small", children: _jsx(ActionList, { selectionVariant: "single", children: levels.map(({ level, label }) => (_jsx(ActionList.Item, { selected: selectedAccessLevel === level, onSelect: () => setSelectedAccessLevel(level), children: label }, level))) }) })] })] }), !isExpanded && (_jsxs(Box, { sx: {
1307
- px: 3,
1308
- py: 2,
1309
- borderRadius: 2,
1310
- borderWidth: 1,
1311
- borderStyle: 'solid',
1312
- borderColor: 'border.default',
1313
- bg: 'canvas.default',
1314
- display: 'grid',
1315
- gap: 1,
1316
- }, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Sharing details are collapsed." }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [aclEntries.length, " principal", aclEntries.length === 1 ? '' : 's', ' ', "currently granted access."] })] })), isExpanded && (_jsxs(_Fragment, { children: [_jsxs(Box, { sx: {
1317
- px: 3,
1318
- py: 2,
1319
- borderRadius: 2,
1320
- borderWidth: 1,
1321
- borderStyle: 'solid',
1322
- borderColor: 'border.default',
1323
- bg: 'canvas.default',
1324
- display: 'grid',
1325
- gap: 1,
1326
- }, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Owner" }), ownerPrincipals.length > 0 ? (_jsx(Box, { sx: { display: 'grid' }, children: ownerPrincipals.map((ownerPrincipal, index) => (_jsx(Box, { sx: {
1327
- py: 1,
1328
- borderTopWidth: index === 0 ? 0 : 1,
1329
- borderTopStyle: 'solid',
1330
- borderColor: 'border.subtle',
1331
- }, children: _jsx(OwnerPrincipalRow, { ownerPrincipal: ownerPrincipal, cache: principalCache, showAvatarSkeleton: ownerPrincipal.kind === 'personal' &&
1332
- Boolean(hydratingUserUids[ownerPrincipal.uid]), isPlatformAdmin: isPlatformAdmin }) }, principalKey(ownerPrincipal.kind, ownerPrincipal.uid)))) })) : (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Owner information is not available." }))] }), _jsxs(Box, { sx: {
1333
- px: 3,
1334
- py: 2,
1335
- borderRadius: 2,
1336
- borderWidth: 1,
1337
- borderStyle: 'solid',
1338
- borderColor: 'border.default',
1339
- bg: 'canvas.default',
1340
- display: 'grid',
1341
- gap: 2,
1342
- }, children: [_jsxs(Box, { sx: {
1343
- display: 'flex',
1344
- alignItems: 'center',
1345
- justifyContent: 'space-between',
1346
- gap: 2,
1347
- }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Share with\u2026" }), isLoadingShareable && (_jsxs(Box, { sx: {
1348
- display: 'inline-flex',
1349
- alignItems: 'center',
1350
- gap: 1,
1351
- }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading\u2026" })] }))] }), !isLoadingShareable &&
1220
+ : 'Expand sharing details', children: isExpanded ? 'Shrink details' : 'Expand details' })] }), _jsx(ActionMenu.Overlay, { width: "small", children: _jsx(ActionList, { selectionVariant: "single", children: levels.map(({ level, label }) => (_jsx(ActionList.Item, { selected: selectedAccessLevel === level, onSelect: () => setSelectedAccessLevel(level), children: label }, level))) }) })] })] }), !isExpanded && (_jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.default", display: "grid", gap: 1, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Sharing details are collapsed." }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [aclEntries.length, " principal", aclEntries.length === 1 ? '' : 's', ' ', "currently granted access."] })] })), isExpanded && (_jsxs(_Fragment, { children: [_jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.default", display: "grid", gap: 1, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Owner" }), ownerPrincipals.length > 0 ? (_jsx(Box, { display: "grid", children: ownerPrincipals.map((ownerPrincipal, index) => (_jsx(Box, { py: 1, borderTopWidth: index === 0 ? 0 : 1, borderTopStyle: "solid", borderColor: "border.subtle", children: _jsx(OwnerPrincipalRow, { ownerPrincipal: ownerPrincipal, cache: principalCache, showAvatarSkeleton: ownerPrincipal.kind === 'personal' &&
1221
+ Boolean(hydratingUserUids[ownerPrincipal.uid]), isPlatformAdmin: isPlatformAdmin }) }, principalKey(ownerPrincipal.kind, ownerPrincipal.uid)))) })) : (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Owner information is not available." }))] }), _jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.default", display: "grid", gap: 2, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Share with\u2026" }), isLoadingShareable && (_jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading\u2026" })] }))] }), !isLoadingShareable &&
1352
1222
  groupedShareable.self.length === 0 &&
1353
1223
  groupedShareable.otherUsers.length === 0 &&
1354
1224
  groupedShareable.orgs.length === 0 &&
1355
1225
  groupedShareable.teams.length === 0 &&
1356
- groupedShareable.agents.length === 0 ? (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals available to share with." })) : (_jsxs(Box, { sx: { display: 'grid', gap: 2 }, children: [renderShareableGroup('You', groupedShareable.self), renderShareableGroup('Other users', groupedShareable.otherUsers), renderShareableGroup('Your organizations', groupedShareable.orgs), renderShareableGroup('Your teams', groupedShareable.teams), renderShareableGroup('Agents', groupedShareable.agents)] }))] }), _jsxs(Box, { sx: {
1357
- px: 3,
1358
- py: 2,
1359
- borderRadius: 2,
1360
- borderWidth: 1,
1361
- borderStyle: 'solid',
1362
- borderColor: 'border.subtle',
1363
- bg: 'canvas.subtle',
1364
- display: 'grid',
1365
- gap: 1,
1366
- }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Or search for any user, team, or organization" }), _jsxs(Box, { sx: { position: 'relative' }, ref: searchContainerRef, children: [_jsx(TextInput, { ref: searchInputRef, block: true, value: searchQuery, onChange: e => {
1226
+ groupedShareable.agents.length === 0 ? (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals available to share with." })) : (_jsxs(Box, { display: "grid", gap: 2, children: [renderShareableGroup('You', groupedShareable.self), renderShareableGroup('Other users', groupedShareable.otherUsers), renderShareableGroup('Your organizations', groupedShareable.orgs), renderShareableGroup('Your teams', groupedShareable.teams), renderShareableGroup('Agents', groupedShareable.agents)] }))] }), _jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.subtle", bg: "canvas.subtle", display: "grid", gap: 1, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Or search for any user, team, or organization" }), _jsxs(Box, { position: "relative", ref: searchContainerRef, children: [_jsx(TextInput, { ref: searchInputRef, block: true, value: searchQuery, onChange: e => {
1367
1227
  const next = e.target.value;
1368
1228
  setSearchQuery(next);
1369
1229
  setIsSearchOverlayOpen(next.trim().length > 0);
@@ -1376,82 +1236,14 @@ export function ShareAccessComponent({ isOpen, requestUrl, transport, resourceLa
1376
1236
  e.preventDefault();
1377
1237
  setIsSearchOverlayOpen(false);
1378
1238
  }
1379
- }, placeholder: "Search by handle, name, or email", "aria-label": "Search principals", disabled: isSaving }), canShowSearchResults && (_jsx(Box, { sx: {
1380
- position: 'absolute',
1381
- top: 'calc(100% + 8px)',
1382
- left: 0,
1383
- right: 0,
1384
- zIndex: 100,
1385
- borderWidth: 1,
1386
- borderStyle: 'solid',
1387
- borderColor: 'border.default',
1388
- borderRadius: 2,
1389
- maxHeight: '220px',
1390
- overflowY: 'auto',
1391
- bg: 'canvas.overlay',
1392
- boxShadow: 'shadow.medium',
1393
- }, children: isSearching ? (_jsxs(Box, { sx: {
1394
- px: 3,
1395
- py: 2,
1396
- display: 'inline-flex',
1397
- alignItems: 'center',
1398
- gap: 2,
1399
- }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Searching\u2026" })] })) : searchResults.length === 0 ? (_jsx(Box, { sx: { px: 3, py: 2 }, children: _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals found." }) })) : (_jsx(ActionList, { children: searchResults.map(result => (_jsxs(ActionList.Item, { onSelect: () => handleSearchResultSelect(result), children: [_jsx(ActionList.LeadingVisual, { children: result.kind === 'agent' ? (_jsx(AgentAvatar, { size: 18 })) : (_jsx(PrincipalAvatar, { kind: result.kind, avatarUrl: result.avatarUrl, alt: result.displayName, size: 18 })) }), _jsxs(Box, { sx: {
1400
- display: 'inline-flex',
1401
- alignItems: 'center',
1402
- gap: 1,
1403
- flexWrap: 'wrap',
1404
- }, children: [_jsx(Text, { children: result.displayName }), result.kind === 'personal' && (_jsx(Label, { size: "small", variant: "secondary", children: result.origin ||
1239
+ }, placeholder: "Search by handle, name, or email", "aria-label": "Search principals", disabled: isSaving }), canShowSearchResults && (_jsx(Box, { position: "absolute", top: "calc(100% + 8px)", left: 0, right: 0, zIndex: 100, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", borderRadius: 2, maxHeight: "220px", overflowY: "auto", bg: "canvas.overlay", boxShadow: "shadow.medium", children: isSearching ? (_jsxs(Box, { px: 3, py: 2, display: "inline-flex", alignItems: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Searching\u2026" })] })) : searchResults.length === 0 ? (_jsx(Box, { px: 3, py: 2, children: _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals found." }) })) : (_jsx(ActionList, { children: searchResults.map(result => (_jsxs(ActionList.Item, { onSelect: () => handleSearchResultSelect(result), children: [_jsx(ActionList.LeadingVisual, { children: result.kind === 'agent' ? (_jsx(AgentAvatar, { size: 18 })) : (_jsx(PrincipalAvatar, { kind: result.kind, avatarUrl: result.avatarUrl, alt: result.displayName, size: 18 })) }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, flexWrap: "wrap", children: [_jsx(Text, { children: result.displayName }), result.kind === 'personal' && (_jsx(Label, { size: "small", variant: "secondary", children: result.origin ||
1405
1240
  principalCache[principalKey('personal', result.uid)]?.origin ||
1406
- 'Datalayer' }))] }), _jsxs(ActionList.Description, { variant: "block", children: ["@", result.handle] })] }, principalKey(result.kind, result.uid)))) })) }))] })] }), _jsxs(Box, { sx: {
1407
- px: 3,
1408
- py: 2,
1409
- borderRadius: 2,
1410
- borderWidth: 1,
1411
- borderStyle: 'solid',
1412
- borderColor: 'border.default',
1413
- bg: 'canvas.default',
1414
- display: 'grid',
1415
- gap: 1,
1416
- }, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Access Control List (ACL)" }), _jsx(Box, { sx: {
1417
- borderWidth: 1,
1418
- borderStyle: 'solid',
1419
- borderColor: 'border.default',
1420
- borderRadius: 2,
1421
- maxHeight: '220px',
1422
- overflowY: 'auto',
1423
- bg: 'canvas.subtle',
1424
- }, children: aclEntries.length === 0 ? (_jsx(Box, { sx: { px: 3, py: 2 }, children: _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals shared yet." }) })) : (_jsx(Box, { sx: { display: 'grid' }, children: aclEntries.map(entry => (_jsxs(Box, { sx: {
1425
- px: 3,
1426
- py: 2,
1427
- display: 'flex',
1428
- alignItems: 'center',
1429
- justifyContent: 'space-between',
1430
- gap: 2,
1431
- borderTopWidth: 1,
1432
- borderTopStyle: 'solid',
1433
- borderColor: 'border.subtle',
1241
+ 'Datalayer' }))] }), _jsxs(ActionList.Description, { variant: "block", children: ["@", result.handle] })] }, principalKey(result.kind, result.uid)))) })) }))] })] }), _jsxs(Box, { px: 3, py: 2, borderRadius: 2, borderWidth: 1, borderStyle: "solid", borderColor: "border.default", bg: "canvas.default", display: "grid", gap: 1, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Access Control List (ACL)" }), _jsx(Box, { borderWidth: 1, borderStyle: "solid", borderColor: "border.default", borderRadius: 2, maxHeight: "220px", overflowY: "auto", bg: "canvas.subtle", children: aclEntries.length === 0 ? (_jsx(Box, { px: 3, py: 2, children: _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "No principals shared yet." }) })) : (_jsx(Box, { display: "grid", children: aclEntries.map(entry => (_jsxs(Box, { px: 3, py: 2, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, borderTopWidth: 1, borderTopStyle: "solid", borderColor: "border.subtle", sx: {
1434
1242
  '&:first-of-type': { borderTop: 'none' },
1435
1243
  }, children: [_jsx(AccessPrincipalRow, { entry: entry, cache: principalCache, showAvatarSkeleton: entry.kind === 'personal' &&
1436
- Boolean(hydratingUserUids[entry.uid]), isPlatformAdmin: isPlatformAdmin }), _jsx(Box, { sx: {
1437
- display: 'flex',
1438
- flexWrap: 'wrap',
1439
- gap: 1,
1440
- justifyContent: 'flex-end',
1441
- }, children: entry.levels.map(level => (_jsx(Label, { size: "small", variant: "secondary", children: levelLabels[level] || level }, level))) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => removePrincipal(entry.kind, entry.uid), disabled: isSaving, children: "Remove" })] }, principalKey(entry.kind, entry.uid)))) })) })] })] }))] }), _jsxs(Box, { sx: {
1442
- display: 'flex',
1443
- justifyContent: 'flex-end',
1444
- alignItems: 'center',
1445
- gap: 2,
1446
- }, children: [isSaving && (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Saving\u2026" })] })), displayMode === 'dialog' && (_jsx(Button, { onClick: onClose, disabled: isSaving, children: "Close" }))] }), isLoading && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading current sharing settings\u2026" }))] }));
1244
+ Boolean(hydratingUserUids[entry.uid]), isPlatformAdmin: isPlatformAdmin }), _jsx(Box, { display: "flex", flexWrap: "wrap", gap: 1, justifyContent: "flex-end", children: entry.levels.map(level => (_jsx(Label, { size: "small", variant: "secondary", children: levelLabels[level] || level }, level))) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => removePrincipal(entry.kind, entry.uid), disabled: isSaving, children: "Remove" })] }, principalKey(entry.kind, entry.uid)))) })) })] })] }))] }), _jsxs(Box, { display: "flex", justifyContent: "flex-end", alignItems: "center", gap: 2, children: [isSaving && (_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Saving\u2026" })] })), displayMode === 'dialog' && (_jsx(Button, { onClick: onClose, disabled: isSaving, children: "Close" }))] }), isLoading && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading current sharing settings\u2026" }))] }));
1447
1245
  if (displayMode === 'inline') {
1448
- return (_jsx(Box, { sx: {
1449
- borderWidth: 1,
1450
- borderStyle: 'solid',
1451
- borderColor: 'border.default',
1452
- borderRadius: 2,
1453
- bg: 'canvas.default',
1454
- }, children: content }));
1246
+ return (_jsx(Box, { borderWidth: 1, borderStyle: "solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", children: content }));
1455
1247
  }
1456
1248
  return (_jsx(Dialog, { title: `Share ${resourceLabel.toLowerCase()}`, onClose: onClose,
1457
1249
  // Wider than any preset — Primer's `xlarge` stops at 640px, and the
@@ -45,6 +45,6 @@ export function SharingEditor({ value, onChange, label = 'Sharing', caption = 'E
45
45
  catch (reason) {
46
46
  setError(reason?.message || 'Invalid JSON');
47
47
  }
48
- }, sx: { width: '100%', fontFamily: 'mono' } }), _jsx(FormControl.Caption, { children: caption }), error && (_jsx(Box, { sx: { mt: 1 }, children: _jsx(Text, { sx: { color: 'danger.fg', fontSize: 1 }, children: error }) }))] }));
48
+ }, sx: { width: '100%', fontFamily: 'mono' } }), _jsx(FormControl.Caption, { children: caption }), error && (_jsx(Box, { mt: 1, children: _jsx(Text, { sx: { color: 'danger.fg', fontSize: 1 }, children: error }) }))] }));
49
49
  }
50
50
  export default SharingEditor;