@bayonai/mui-design 1.9.0 → 1.10.0

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 (296) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +18 -0
  3. package/package.json +1 -1
  4. package/dist/cjs/actions/ActionMenu.d.ts +0 -24
  5. package/dist/cjs/actions/ActionMenu.js +0 -36
  6. package/dist/cjs/actions/DialogActionButtons.d.ts +0 -23
  7. package/dist/cjs/actions/DialogActionButtons.js +0 -33
  8. package/dist/cjs/actions/LoadingIconButton.d.ts +0 -11
  9. package/dist/cjs/actions/LoadingIconButton.js +0 -10
  10. package/dist/cjs/actions/StickyActionFooter.d.ts +0 -14
  11. package/dist/cjs/actions/StickyActionFooter.js +0 -27
  12. package/dist/cjs/actions/StickySubmitButton.d.ts +0 -10
  13. package/dist/cjs/actions/StickySubmitButton.js +0 -10
  14. package/dist/cjs/actions/index.d.ts +0 -5
  15. package/dist/cjs/actions/index.js +0 -18
  16. package/dist/cjs/client.d.ts +0 -4
  17. package/dist/cjs/client.js +0 -21
  18. package/dist/cjs/components/BayonFlowVisual.d.ts +0 -12
  19. package/dist/cjs/components/BayonFlowVisual.js +0 -87
  20. package/dist/cjs/components/BayonThemeModeToggle.d.ts +0 -6
  21. package/dist/cjs/components/BayonThemeModeToggle.js +0 -34
  22. package/dist/cjs/components/IconTooltipButton.d.ts +0 -10
  23. package/dist/cjs/components/IconTooltipButton.js +0 -50
  24. package/dist/cjs/components/panels.d.ts +0 -37
  25. package/dist/cjs/components/panels.js +0 -92
  26. package/dist/cjs/drawers/BottomDrawer.d.ts +0 -16
  27. package/dist/cjs/drawers/BottomDrawer.js +0 -43
  28. package/dist/cjs/drawers/MobileBottomDrawer.d.ts +0 -20
  29. package/dist/cjs/drawers/MobileBottomDrawer.js +0 -102
  30. package/dist/cjs/drawers/MobileBottomDrawerHeader.d.ts +0 -11
  31. package/dist/cjs/drawers/MobileBottomDrawerHeader.js +0 -36
  32. package/dist/cjs/drawers/ResponsiveDrawer.d.ts +0 -25
  33. package/dist/cjs/drawers/ResponsiveDrawer.js +0 -22
  34. package/dist/cjs/drawers/WorkspaceSidePane.d.ts +0 -29
  35. package/dist/cjs/drawers/WorkspaceSidePane.js +0 -222
  36. package/dist/cjs/drawers/WorkspaceSidePaneRoot.d.ts +0 -1
  37. package/dist/cjs/drawers/WorkspaceSidePaneRoot.js +0 -93
  38. package/dist/cjs/drawers/drawerAppearance.d.ts +0 -8
  39. package/dist/cjs/drawers/drawerAppearance.js +0 -10
  40. package/dist/cjs/drawers/index.d.ts +0 -7
  41. package/dist/cjs/drawers/index.js +0 -19
  42. package/dist/cjs/drawers/useVisualViewportBottomInset.d.ts +0 -6
  43. package/dist/cjs/drawers/useVisualViewportBottomInset.js +0 -33
  44. package/dist/cjs/drawers/workspaceSidePaneGeometry.d.ts +0 -11
  45. package/dist/cjs/drawers/workspaceSidePaneGeometry.js +0 -15
  46. package/dist/cjs/feedback/StatusNotice.d.ts +0 -13
  47. package/dist/cjs/feedback/StatusNotice.js +0 -62
  48. package/dist/cjs/feedback/index.d.ts +0 -1
  49. package/dist/cjs/feedback/index.js +0 -7
  50. package/dist/cjs/index.d.ts +0 -9
  51. package/dist/cjs/index.js +0 -25
  52. package/dist/cjs/internal/DialogChoiceTile.d.ts +0 -20
  53. package/dist/cjs/internal/DialogChoiceTile.js +0 -60
  54. package/dist/cjs/links/LinkAddressPreview.d.ts +0 -19
  55. package/dist/cjs/links/LinkAddressPreview.js +0 -80
  56. package/dist/cjs/links/index.d.ts +0 -3
  57. package/dist/cjs/links/index.js +0 -9
  58. package/dist/cjs/links/useLinkAddressPreview.d.ts +0 -26
  59. package/dist/cjs/links/useLinkAddressPreview.js +0 -162
  60. package/dist/cjs/location/GeographicLocationField.d.ts +0 -26
  61. package/dist/cjs/location/GeographicLocationField.js +0 -49
  62. package/dist/cjs/location/GoogleMapsAttribution.d.ts +0 -1
  63. package/dist/cjs/location/GoogleMapsAttribution.js +0 -12
  64. package/dist/cjs/location/MetadataFieldGroup.d.ts +0 -5
  65. package/dist/cjs/location/MetadataFieldGroup.js +0 -13
  66. package/dist/cjs/location/MetadataValueField.d.ts +0 -23
  67. package/dist/cjs/location/MetadataValueField.js +0 -27
  68. package/dist/cjs/location/SearchInputAction.d.ts +0 -9
  69. package/dist/cjs/location/SearchInputAction.js +0 -14
  70. package/dist/cjs/location/TemplateBadge.d.ts +0 -5
  71. package/dist/cjs/location/TemplateBadge.js +0 -9
  72. package/dist/cjs/location/VenueSearchDialog.d.ts +0 -33
  73. package/dist/cjs/location/VenueSearchDialog.js +0 -112
  74. package/dist/cjs/location/index.d.ts +0 -6
  75. package/dist/cjs/location/index.js +0 -20
  76. package/dist/cjs/package.json +0 -3
  77. package/dist/cjs/pending/PendingChangesDialogShell.d.ts +0 -2
  78. package/dist/cjs/pending/PendingChangesDialogShell.js +0 -16
  79. package/dist/cjs/pending/PendingChangesDialogView.d.ts +0 -2
  80. package/dist/cjs/pending/PendingChangesDialogView.js +0 -140
  81. package/dist/cjs/pending/PendingChangesIndicatorView.d.ts +0 -10
  82. package/dist/cjs/pending/PendingChangesIndicatorView.js +0 -27
  83. package/dist/cjs/pending/index.d.ts +0 -3
  84. package/dist/cjs/pending/index.js +0 -9
  85. package/dist/cjs/pending/types.d.ts +0 -55
  86. package/dist/cjs/pending/types.js +0 -2
  87. package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +0 -17
  88. package/dist/cjs/pricing/PlanUpgradeDialog.js +0 -22
  89. package/dist/cjs/pricing/PricingTable.d.ts +0 -28
  90. package/dist/cjs/pricing/PricingTable.js +0 -60
  91. package/dist/cjs/pricing/index.d.ts +0 -3
  92. package/dist/cjs/pricing/index.js +0 -8
  93. package/dist/cjs/providers/BayonThemeProvider.d.ts +0 -20
  94. package/dist/cjs/providers/BayonThemeProvider.js +0 -163
  95. package/dist/cjs/sections/ExpandableSectionToggle.d.ts +0 -12
  96. package/dist/cjs/sections/ExpandableSectionToggle.js +0 -32
  97. package/dist/cjs/sections/index.d.ts +0 -2
  98. package/dist/cjs/sections/index.js +0 -7
  99. package/dist/cjs/styles/pageStyles.d.ts +0 -15
  100. package/dist/cjs/styles/pageStyles.js +0 -103
  101. package/dist/cjs/swipe/SwipeActionRow.d.ts +0 -8
  102. package/dist/cjs/swipe/SwipeActionRow.js +0 -123
  103. package/dist/cjs/swipe/index.d.ts +0 -1
  104. package/dist/cjs/swipe/index.js +0 -8
  105. package/dist/cjs/theme/components.d.ts +0 -2
  106. package/dist/cjs/theme/components.js +0 -123
  107. package/dist/cjs/theme/createBayonTheme.d.ts +0 -4
  108. package/dist/cjs/theme/createBayonTheme.js +0 -45
  109. package/dist/cjs/theme/palette.d.ts +0 -146
  110. package/dist/cjs/theme/palette.js +0 -109
  111. package/dist/cjs/theme/shadows.d.ts +0 -2
  112. package/dist/cjs/theme/shadows.js +0 -21
  113. package/dist/cjs/theme/types.d.ts +0 -47
  114. package/dist/cjs/theme/types.js +0 -2
  115. package/dist/cjs/theme/typography.d.ts +0 -2
  116. package/dist/cjs/theme/typography.js +0 -58
  117. package/dist/cjs/toasts/ActionToast.d.ts +0 -11
  118. package/dist/cjs/toasts/ActionToast.js +0 -12
  119. package/dist/cjs/toasts/Toast.d.ts +0 -16
  120. package/dist/cjs/toasts/Toast.js +0 -55
  121. package/dist/cjs/toasts/index.d.ts +0 -5
  122. package/dist/cjs/toasts/index.js +0 -12
  123. package/dist/cjs/toasts/useUpwardToastDismiss.d.ts +0 -15
  124. package/dist/cjs/toasts/useUpwardToastDismiss.js +0 -73
  125. package/dist/cjs/uploads/CameraCaptureDialog.d.ts +0 -22
  126. package/dist/cjs/uploads/CameraCaptureDialog.js +0 -187
  127. package/dist/cjs/uploads/FileRow.d.ts +0 -10
  128. package/dist/cjs/uploads/FileRow.js +0 -23
  129. package/dist/cjs/uploads/FileSwipeActionRow.d.ts +0 -1
  130. package/dist/cjs/uploads/FileSwipeActionRow.js +0 -11
  131. package/dist/cjs/uploads/FileThumbnail.d.ts +0 -5
  132. package/dist/cjs/uploads/FileThumbnail.js +0 -104
  133. package/dist/cjs/uploads/FileUpload.d.ts +0 -26
  134. package/dist/cjs/uploads/FileUpload.js +0 -98
  135. package/dist/cjs/uploads/FileViewer.d.ts +0 -9
  136. package/dist/cjs/uploads/FileViewer.js +0 -155
  137. package/dist/cjs/uploads/ImageCropDialog.d.ts +0 -26
  138. package/dist/cjs/uploads/ImageCropDialog.js +0 -215
  139. package/dist/cjs/uploads/ImageInfoPanel.d.ts +0 -24
  140. package/dist/cjs/uploads/ImageInfoPanel.js +0 -41
  141. package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +0 -13
  142. package/dist/cjs/uploads/ImageUploadQualityDialog.js +0 -57
  143. package/dist/cjs/uploads/UploadProgressRing.d.ts +0 -24
  144. package/dist/cjs/uploads/UploadProgressRing.js +0 -32
  145. package/dist/cjs/uploads/cameraCropPresentation.d.ts +0 -2
  146. package/dist/cjs/uploads/cameraCropPresentation.js +0 -12
  147. package/dist/cjs/uploads/index.d.ts +0 -12
  148. package/dist/cjs/uploads/index.js +0 -24
  149. package/dist/cjs/utils/createBayonEmotionCache.d.ts +0 -1
  150. package/dist/cjs/utils/createBayonEmotionCache.js +0 -21
  151. package/dist/esm/actions/ActionMenu.js +0 -30
  152. package/dist/esm/actions/DialogActionButtons.js +0 -24
  153. package/dist/esm/actions/LoadingIconButton.js +0 -7
  154. package/dist/esm/actions/StickyActionFooter.js +0 -24
  155. package/dist/esm/actions/StickySubmitButton.js +0 -7
  156. package/dist/esm/actions/index.js +0 -7
  157. package/dist/esm/client.js +0 -5
  158. package/dist/esm/components/BayonFlowVisual.js +0 -81
  159. package/dist/esm/components/BayonThemeModeToggle.js +0 -28
  160. package/dist/esm/components/IconTooltipButton.js +0 -11
  161. package/dist/esm/components/panels.js +0 -76
  162. package/dist/esm/drawers/BottomDrawer.js +0 -37
  163. package/dist/esm/drawers/MobileBottomDrawer.js +0 -95
  164. package/dist/esm/drawers/MobileBottomDrawerHeader.js +0 -30
  165. package/dist/esm/drawers/ResponsiveDrawer.js +0 -19
  166. package/dist/esm/drawers/WorkspaceSidePane.js +0 -216
  167. package/dist/esm/drawers/WorkspaceSidePaneRoot.js +0 -90
  168. package/dist/esm/drawers/drawerAppearance.js +0 -7
  169. package/dist/esm/drawers/index.js +0 -8
  170. package/dist/esm/drawers/useVisualViewportBottomInset.js +0 -29
  171. package/dist/esm/drawers/workspaceSidePaneGeometry.js +0 -11
  172. package/dist/esm/feedback/StatusNotice.js +0 -56
  173. package/dist/esm/feedback/index.js +0 -3
  174. package/dist/esm/index.js +0 -9
  175. package/dist/esm/internal/DialogChoiceTile.js +0 -54
  176. package/dist/esm/links/LinkAddressPreview.js +0 -74
  177. package/dist/esm/links/index.js +0 -4
  178. package/dist/esm/links/useLinkAddressPreview.js +0 -159
  179. package/dist/esm/location/GeographicLocationField.js +0 -43
  180. package/dist/esm/location/GoogleMapsAttribution.js +0 -9
  181. package/dist/esm/location/MetadataFieldGroup.js +0 -9
  182. package/dist/esm/location/MetadataValueField.js +0 -23
  183. package/dist/esm/location/SearchInputAction.js +0 -8
  184. package/dist/esm/location/TemplateBadge.js +0 -6
  185. package/dist/esm/location/VenueSearchDialog.js +0 -109
  186. package/dist/esm/location/index.js +0 -7
  187. package/dist/esm/pending/PendingChangesDialogShell.js +0 -10
  188. package/dist/esm/pending/PendingChangesDialogView.js +0 -134
  189. package/dist/esm/pending/PendingChangesIndicatorView.js +0 -21
  190. package/dist/esm/pending/index.js +0 -4
  191. package/dist/esm/pending/types.js +0 -1
  192. package/dist/esm/pricing/PlanUpgradeDialog.js +0 -19
  193. package/dist/esm/pricing/PricingTable.js +0 -54
  194. package/dist/esm/pricing/index.js +0 -3
  195. package/dist/esm/providers/BayonThemeProvider.js +0 -123
  196. package/dist/esm/sections/ExpandableSectionToggle.js +0 -26
  197. package/dist/esm/sections/index.js +0 -3
  198. package/dist/esm/styles/pageStyles.js +0 -100
  199. package/dist/esm/swipe/SwipeActionRow.js +0 -116
  200. package/dist/esm/swipe/index.js +0 -3
  201. package/dist/esm/theme/components.js +0 -120
  202. package/dist/esm/theme/createBayonTheme.js +0 -41
  203. package/dist/esm/theme/palette.js +0 -106
  204. package/dist/esm/theme/shadows.js +0 -18
  205. package/dist/esm/theme/types.js +0 -1
  206. package/dist/esm/theme/typography.js +0 -55
  207. package/dist/esm/toasts/ActionToast.js +0 -9
  208. package/dist/esm/toasts/Toast.js +0 -52
  209. package/dist/esm/toasts/index.js +0 -5
  210. package/dist/esm/toasts/useUpwardToastDismiss.js +0 -69
  211. package/dist/esm/uploads/CameraCaptureDialog.js +0 -181
  212. package/dist/esm/uploads/FileRow.js +0 -17
  213. package/dist/esm/uploads/FileSwipeActionRow.js +0 -7
  214. package/dist/esm/uploads/FileThumbnail.js +0 -98
  215. package/dist/esm/uploads/FileUpload.js +0 -92
  216. package/dist/esm/uploads/FileViewer.js +0 -149
  217. package/dist/esm/uploads/ImageCropDialog.js +0 -212
  218. package/dist/esm/uploads/ImageInfoPanel.js +0 -35
  219. package/dist/esm/uploads/ImageUploadQualityDialog.js +0 -51
  220. package/dist/esm/uploads/UploadProgressRing.js +0 -29
  221. package/dist/esm/uploads/cameraCropPresentation.js +0 -5
  222. package/dist/esm/uploads/index.js +0 -11
  223. package/dist/esm/utils/createBayonEmotionCache.js +0 -15
  224. package/dist/types/actions/ActionMenu.d.ts +0 -24
  225. package/dist/types/actions/DialogActionButtons.d.ts +0 -23
  226. package/dist/types/actions/LoadingIconButton.d.ts +0 -11
  227. package/dist/types/actions/StickyActionFooter.d.ts +0 -14
  228. package/dist/types/actions/StickySubmitButton.d.ts +0 -10
  229. package/dist/types/actions/index.d.ts +0 -5
  230. package/dist/types/client.d.ts +0 -4
  231. package/dist/types/components/BayonFlowVisual.d.ts +0 -12
  232. package/dist/types/components/BayonThemeModeToggle.d.ts +0 -6
  233. package/dist/types/components/IconTooltipButton.d.ts +0 -10
  234. package/dist/types/components/panels.d.ts +0 -37
  235. package/dist/types/drawers/BottomDrawer.d.ts +0 -16
  236. package/dist/types/drawers/MobileBottomDrawer.d.ts +0 -20
  237. package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +0 -11
  238. package/dist/types/drawers/ResponsiveDrawer.d.ts +0 -25
  239. package/dist/types/drawers/WorkspaceSidePane.d.ts +0 -29
  240. package/dist/types/drawers/WorkspaceSidePaneRoot.d.ts +0 -1
  241. package/dist/types/drawers/drawerAppearance.d.ts +0 -8
  242. package/dist/types/drawers/index.d.ts +0 -7
  243. package/dist/types/drawers/useVisualViewportBottomInset.d.ts +0 -6
  244. package/dist/types/drawers/workspaceSidePaneGeometry.d.ts +0 -11
  245. package/dist/types/feedback/StatusNotice.d.ts +0 -13
  246. package/dist/types/feedback/index.d.ts +0 -1
  247. package/dist/types/index.d.ts +0 -9
  248. package/dist/types/internal/DialogChoiceTile.d.ts +0 -20
  249. package/dist/types/links/LinkAddressPreview.d.ts +0 -19
  250. package/dist/types/links/index.d.ts +0 -3
  251. package/dist/types/links/useLinkAddressPreview.d.ts +0 -26
  252. package/dist/types/location/GeographicLocationField.d.ts +0 -26
  253. package/dist/types/location/GoogleMapsAttribution.d.ts +0 -1
  254. package/dist/types/location/MetadataFieldGroup.d.ts +0 -5
  255. package/dist/types/location/MetadataValueField.d.ts +0 -23
  256. package/dist/types/location/SearchInputAction.d.ts +0 -9
  257. package/dist/types/location/TemplateBadge.d.ts +0 -5
  258. package/dist/types/location/VenueSearchDialog.d.ts +0 -33
  259. package/dist/types/location/index.d.ts +0 -6
  260. package/dist/types/pending/PendingChangesDialogShell.d.ts +0 -2
  261. package/dist/types/pending/PendingChangesDialogView.d.ts +0 -2
  262. package/dist/types/pending/PendingChangesIndicatorView.d.ts +0 -10
  263. package/dist/types/pending/index.d.ts +0 -3
  264. package/dist/types/pending/types.d.ts +0 -55
  265. package/dist/types/pricing/PlanUpgradeDialog.d.ts +0 -17
  266. package/dist/types/pricing/PricingTable.d.ts +0 -28
  267. package/dist/types/pricing/index.d.ts +0 -3
  268. package/dist/types/providers/BayonThemeProvider.d.ts +0 -20
  269. package/dist/types/sections/ExpandableSectionToggle.d.ts +0 -12
  270. package/dist/types/sections/index.d.ts +0 -2
  271. package/dist/types/styles/pageStyles.d.ts +0 -15
  272. package/dist/types/swipe/SwipeActionRow.d.ts +0 -8
  273. package/dist/types/swipe/index.d.ts +0 -1
  274. package/dist/types/theme/components.d.ts +0 -2
  275. package/dist/types/theme/createBayonTheme.d.ts +0 -4
  276. package/dist/types/theme/palette.d.ts +0 -146
  277. package/dist/types/theme/shadows.d.ts +0 -2
  278. package/dist/types/theme/types.d.ts +0 -47
  279. package/dist/types/theme/typography.d.ts +0 -2
  280. package/dist/types/toasts/ActionToast.d.ts +0 -11
  281. package/dist/types/toasts/Toast.d.ts +0 -16
  282. package/dist/types/toasts/index.d.ts +0 -5
  283. package/dist/types/toasts/useUpwardToastDismiss.d.ts +0 -15
  284. package/dist/types/uploads/CameraCaptureDialog.d.ts +0 -22
  285. package/dist/types/uploads/FileRow.d.ts +0 -10
  286. package/dist/types/uploads/FileSwipeActionRow.d.ts +0 -1
  287. package/dist/types/uploads/FileThumbnail.d.ts +0 -5
  288. package/dist/types/uploads/FileUpload.d.ts +0 -26
  289. package/dist/types/uploads/FileViewer.d.ts +0 -9
  290. package/dist/types/uploads/ImageCropDialog.d.ts +0 -26
  291. package/dist/types/uploads/ImageInfoPanel.d.ts +0 -24
  292. package/dist/types/uploads/ImageUploadQualityDialog.d.ts +0 -13
  293. package/dist/types/uploads/UploadProgressRing.d.ts +0 -24
  294. package/dist/types/uploads/cameraCropPresentation.d.ts +0 -2
  295. package/dist/types/uploads/index.d.ts +0 -12
  296. package/dist/types/utils/createBayonEmotionCache.d.ts +0 -1
@@ -1,81 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { keyframes } from '@emotion/react';
3
- import Box from '@mui/material/Box';
4
- import Stack from '@mui/material/Stack';
5
- import Typography from '@mui/material/Typography';
6
- const drift = keyframes `
7
- 0% { transform: translate3d(0, 0, 0); }
8
- 50% { transform: translate3d(0, -10px, 0); }
9
- 100% { transform: translate3d(0, 0, 0); }
10
- `;
11
- const flow = keyframes `
12
- 0% { transform: translateX(-36%); opacity: 0.28; }
13
- 50% { opacity: 0.8; }
14
- 100% { transform: translateX(36%); opacity: 0.28; }
15
- `;
16
- const tilePulse = keyframes `
17
- 0%, 100% { transform: scale(1); filter: brightness(1); }
18
- 50% { transform: scale(1.04); filter: brightness(1.18); }
19
- `;
20
- function mergeSx(...items) {
21
- return items.filter(Boolean);
22
- }
23
- const defaultItems = [
24
- { label: 'Prompt', value: 'Design brief', color: '#2DD4BF' },
25
- { label: 'Model', value: 'Context map', color: '#60A5FA' },
26
- { label: 'Build', value: 'App surface', color: '#FDE047' },
27
- { label: 'Ship', value: 'Live product', color: '#FF6B6B' },
28
- ];
29
- export function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system design -> production app', sx, ...props }) {
30
- return (_jsxs(Box, { "aria-hidden": "true", sx: mergeSx({
31
- minHeight: { xs: 320, md: 520 },
32
- border: '1px solid var(--bayon-border-strong)',
33
- borderRadius: 2,
34
- bgcolor: 'var(--bayon-panel-solid)',
35
- boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 var(--bayon-border)',
36
- p: { xs: 3, md: 4 },
37
- display: 'grid',
38
- gridTemplateRows: 'auto 1fr auto',
39
- gap: 3,
40
- animation: `${drift} 8s ease-in-out infinite`,
41
- position: 'relative',
42
- overflow: 'hidden',
43
- '@media (prefers-reduced-motion: reduce)': {
44
- animation: 'none',
45
- },
46
- }, sx), ...props, children: [_jsx(Stack, { direction: "row", spacing: 1.2, children: ['#2DD4BF', '#FF6B6B', '#FDE047'].map((color) => (_jsx(Box, { sx: { width: 10, height: 10, borderRadius: '50%', bgcolor: color } }, color))) }), _jsx(Box, { sx: {
47
- display: 'grid',
48
- gridTemplateColumns: '1fr 1.1fr',
49
- gridTemplateRows: '1fr 1fr',
50
- gap: 2,
51
- position: 'relative',
52
- '&::before': {
53
- content: '""',
54
- position: 'absolute',
55
- left: '10%',
56
- right: '10%',
57
- top: '50%',
58
- height: 2,
59
- background: 'linear-gradient(90deg, transparent, #2DD4BF, #FDE047, #FF6B6B, transparent)',
60
- animation: `${flow} 5s ease-in-out infinite`,
61
- },
62
- '@media (prefers-reduced-motion: reduce)': {
63
- '&::before': {
64
- animation: 'none',
65
- },
66
- },
67
- }, children: items.map((item, index) => (_jsxs(Box, { sx: {
68
- borderRadius: 2,
69
- border: '1px solid var(--bayon-border)',
70
- bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'var(--bayon-grid-line)',
71
- p: 2.5,
72
- display: 'flex',
73
- flexDirection: 'column',
74
- justifyContent: 'space-between',
75
- minHeight: 128,
76
- animation: `${tilePulse} ${5 + index}s ease-in-out infinite`,
77
- '@media (prefers-reduced-motion: reduce)': {
78
- animation: 'none',
79
- },
80
- }, children: [_jsx(Typography, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), _jsx(Typography, { sx: { color: 'var(--bayon-fg)', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), _jsx(Typography, { sx: { color: 'var(--bayon-muted)', fontSize: '0.95rem' }, children: caption })] }));
81
- }
@@ -1,28 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import DarkModeIcon from '@mui/icons-material/DarkMode';
4
- import LightModeIcon from '@mui/icons-material/LightMode';
5
- import { useBayonThemeMode } from '../providers/BayonThemeProvider.js';
6
- import { IconTooltipButton } from './IconTooltipButton.js';
7
- function mergeSx(...items) {
8
- return items.flat().filter(Boolean);
9
- }
10
- export function BayonThemeModeToggle({ sx }) {
11
- const { mode, toggleMode } = useBayonThemeMode();
12
- const nextMode = mode === 'dark' ? 'light' : 'dark';
13
- return (_jsx(IconTooltipButton, { label: `Switch to ${nextMode} mode`, onClick: toggleMode, sx: mergeSx({
14
- color: 'var(--bayon-fg)',
15
- border: '1px solid var(--bayon-border)',
16
- bgcolor: 'var(--bayon-panel)',
17
- transition: 'border-color 180ms ease, background-color 180ms ease, color 180ms ease',
18
- '&:hover': {
19
- bgcolor: 'rgba(45, 212, 191, 0.12)',
20
- borderColor: 'var(--bayon-link-hover)',
21
- color: 'var(--bayon-link-hover)',
22
- },
23
- '&:focus-visible': {
24
- outline: '2px solid rgba(45, 212, 191, 0.52)',
25
- outlineOffset: 3,
26
- },
27
- }, sx), children: mode === 'dark' ? _jsx(LightModeIcon, { fontSize: "small" }) : _jsx(DarkModeIcon, { fontSize: "small" }) }));
28
- }
@@ -1,11 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import IconButton from '@mui/material/IconButton';
5
- const LazyTooltip = React.lazy(async () => ({
6
- default: (await import('@mui/material/Tooltip')).default,
7
- }));
8
- export const IconTooltipButton = React.forwardRef(function IconTooltipButton({ label, tooltipProps, children, ...props }, ref) {
9
- const button = (_jsx(IconButton, { ref: ref, "aria-label": label, ...props, children: children }));
10
- return (_jsx(React.Suspense, { fallback: button, children: _jsx(LazyTooltip, { title: label, ...tooltipProps, children: button }) }));
11
- });
@@ -1,76 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Box from '@mui/material/Box';
3
- import Stack from '@mui/material/Stack';
4
- import Typography from '@mui/material/Typography';
5
- import { accentPanelSx, darkCtaSx, darkPanelHoverSx, darkPanelSx, gradientHeroSx, pageShellSx, } from '../styles/pageStyles.js';
6
- function mergeSx(...items) {
7
- return items.flat().filter(Boolean);
8
- }
9
- export function BayonPageShell({ sx, ...props }) {
10
- return _jsx(Box, { sx: mergeSx(pageShellSx, sx), ...props });
11
- }
12
- export function BayonGradientHero({ sx, ...props }) {
13
- return _jsx(Box, { component: "section", sx: mergeSx(gradientHeroSx, sx), ...props });
14
- }
15
- export function BayonDarkPanel({ hover = false, sx, ...props }) {
16
- return _jsx(Box, { sx: mergeSx(darkPanelSx, hover ? darkPanelHoverSx : undefined, sx), ...props });
17
- }
18
- export function BayonAccentPanel({ hover = false, sx, ...props }) {
19
- return _jsx(Box, { sx: mergeSx(accentPanelSx, hover ? darkPanelHoverSx : undefined, sx), ...props });
20
- }
21
- export function BayonCtaPanel({ sx, ...props }) {
22
- return _jsx(Box, { sx: mergeSx(darkCtaSx, sx), ...props });
23
- }
24
- export function BayonContentBox({ sx, ...props }) {
25
- return (_jsx(Box, { sx: mergeSx({
26
- p: { xs: 3, md: 4 },
27
- border: '1px solid var(--bayon-border)',
28
- borderRadius: 2,
29
- bgcolor: 'var(--bayon-panel)',
30
- }, sx), ...props }));
31
- }
32
- export function BayonMethodBox({ accentColor = '#2DD4BF', sx, ...props }) {
33
- return (_jsx(BayonCtaPanel, { sx: mergeSx({
34
- p: 3,
35
- borderLeft: `3px solid ${accentColor}`,
36
- }, sx), ...props }));
37
- }
38
- export function BayonProjectCard({ category, status, title, body, actions, children, hover = true, sx, ...props }) {
39
- return (_jsxs(BayonAccentPanel, { hover: hover, sx: mergeSx({
40
- p: 4,
41
- minHeight: 290,
42
- display: 'flex',
43
- flexDirection: 'column',
44
- }, sx), ...props, children: [category && (_jsx(Typography, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && (_jsx(Typography, { variant: "h5", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && _jsx(Typography, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
45
- }
46
- export function BayonPillarCard({ accentColor = '#2DD4BF', eyebrow, title, body, actions, children, sx, ...props }) {
47
- return (_jsxs(Box, { sx: mergeSx({
48
- p: { xs: 3, md: 5 },
49
- border: '1px solid var(--bayon-border)',
50
- borderRadius: 2,
51
- bgcolor: 'var(--bayon-panel)',
52
- boxShadow: 'var(--bayon-panel-shadow)',
53
- transition: 'transform 180ms ease, border-color 180ms ease',
54
- '&:hover': {
55
- transform: 'translateY(-5px)',
56
- borderColor: accentColor,
57
- },
58
- }, sx), ...props, children: [eyebrow && (_jsx(Typography, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && (_jsx(Typography, { variant: "h3", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75 }, children: body }), children, actions] }));
59
- }
60
- export function BayonTechChip({ label, children, sx, ...props }) {
61
- return (_jsx(Box, { sx: mergeSx({
62
- px: 1.5,
63
- py: 0.75,
64
- borderRadius: 1,
65
- bgcolor: 'rgba(45, 212, 191, 0.12)',
66
- color: '#A7F3D0',
67
- border: '1px solid rgba(45, 212, 191, 0.24)',
68
- fontSize: '0.9rem',
69
- fontWeight: 600,
70
- maxWidth: '100%',
71
- overflowWrap: 'anywhere',
72
- }, sx), ...props, children: label !== null && label !== void 0 ? label : children }));
73
- }
74
- export function BayonPanelStack({ sx, ...props }) {
75
- return _jsx(Stack, { spacing: 3, sx: sx, ...props });
76
- }
@@ -1,37 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
4
- import { Box, Drawer, IconButton, Tooltip, Typography, } from "@mui/material";
5
- import { defaultDrawerAppearance, } from "./drawerAppearance.js";
6
- export function BottomDrawer({ children, appearance = defaultDrawerAppearance, closeTooltip, closeLabel, contentSx, dataComponent, disablePortal = false, headerActions, onClose, open, title, }) {
7
- const paperSlotProps = {
8
- "data-component": dataComponent,
9
- sx: {
10
- bgcolor: appearance.background,
11
- borderRadius: "16px 16px 0 0",
12
- boxShadow: appearance.shadow,
13
- maxHeight: "calc(100dvh - 24px)",
14
- width: "100%",
15
- },
16
- };
17
- return (_jsxs(Drawer, { anchor: "bottom",
18
- // Portal ownership belongs to the host because route slots and stacking
19
- // containers are application concerns rather than drawer presentation.
20
- ModalProps: { disablePortal }, onClose: onClose, open: open, slotProps: { paper: paperSlotProps }, children: [_jsxs(Box, { sx: {
21
- alignItems: "center",
22
- borderBottom: 1,
23
- borderColor: "divider",
24
- display: "flex",
25
- flex: "0 0 auto",
26
- gap: 1,
27
- minHeight: 64,
28
- px: 2.5,
29
- }, children: [_jsx(Typography, { component: "h1", sx: { flex: 1, fontWeight: 760 }, children: title }), headerActions ? (_jsx(Box, { sx: { alignItems: "center", display: "flex" }, children: headerActions })) : null, _jsx(Tooltip, { title: closeTooltip !== null && closeTooltip !== void 0 ? closeTooltip : "", children: _jsx(IconButton, { "aria-label": closeLabel, onClick: onClose, sx: {
30
- minHeight: 40,
31
- minWidth: 40,
32
- "& > .MuiSvgIcon-root": { fontSize: 28 },
33
- }, children: _jsx(CloseRoundedIcon, {}) }) })] }), _jsx(Box, { sx: [
34
- { flex: 1, minHeight: 0, overflowY: "auto" },
35
- ...(Array.isArray(contentSx) ? contentSx : [contentSx]),
36
- ], children: children })] }));
37
- }
@@ -1,95 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Box } from "@mui/material";
4
- import SwipeableDrawer from "@mui/material/SwipeableDrawer";
5
- import { useCallback, useEffect, useRef, useState, } from "react";
6
- import { defaultDrawerAppearance, } from "./drawerAppearance.js";
7
- import { MobileBottomDrawerHeader } from "./MobileBottomDrawerHeader.js";
8
- export const mobileBottomDrawerDismissDuration = 220;
9
- export function MobileBottomDrawer({ ariaLabel, appearance = defaultDrawerAppearance, closeTooltip, children, contentScrollMode = "container", dataComponent, dismiss = false, handleBackground = "default", handlePlacement = "above-content", headerLeft, headerRight, maxHeight = "calc(100dvh - 24px)", onClose, }) {
10
- const dismissTimer = useRef(null);
11
- const [open, setOpen] = useState(true);
12
- useEffect(() => () => {
13
- if (dismissTimer.current) {
14
- clearTimeout(dismissTimer.current);
15
- }
16
- }, []);
17
- const requestClose = useCallback(() => {
18
- if (!open || dismissTimer.current) {
19
- return;
20
- }
21
- setOpen(false);
22
- const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
23
- dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : mobileBottomDrawerDismissDuration);
24
- }, [onClose, open]);
25
- // Product decision: nested dialogs may layer over a retained drawer; the host
26
- // decides whether closing that dialog also closes its underlying context.
27
- useEffect(() => {
28
- if (!dismiss || !open) {
29
- return;
30
- }
31
- const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
32
- dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : mobileBottomDrawerDismissDuration);
33
- return () => {
34
- if (dismissTimer.current) {
35
- clearTimeout(dismissTimer.current);
36
- dismissTimer.current = null;
37
- }
38
- };
39
- }, [dismiss, onClose, open]);
40
- const paperSlotProps = {
41
- "aria-label": ariaLabel,
42
- "data-component": dataComponent !== null && dataComponent !== void 0 ? dataComponent : "mobile-bottom-drawer",
43
- sx: {
44
- backgroundColor: appearance.background,
45
- borderRadius: "16px 16px 0 0",
46
- bottom: 0,
47
- boxShadow: appearance.shadow,
48
- display: "flex",
49
- flexDirection: "column",
50
- height: maxHeight,
51
- maxHeight,
52
- overflow: "hidden",
53
- overscrollBehaviorY: "contain",
54
- width: "100%",
55
- },
56
- };
57
- const drawerHandle = (_jsx(Box, { "aria-hidden": true, "data-component": "mobile-bottom-drawer-handle", "data-placement": handlePlacement, "data-swipe-surface": "drawer", sx: {
58
- alignItems: "center",
59
- bgcolor: handleBackground === "detailChrome"
60
- ? appearance.chrome
61
- : "transparent",
62
- display: "flex",
63
- flex: "0 0 auto",
64
- justifyContent: "center",
65
- minHeight: 44,
66
- // Product decision: header actions sit above this visual handle while
67
- // MUI SwipeableDrawer owns a natural pull-down gesture across the
68
- // entire sheet, including its scroll-aware cancellation behavior.
69
- pointerEvents: handlePlacement === "overlay" ? "none" : "auto",
70
- position: handlePlacement === "overlay" ? "absolute" : "relative",
71
- top: handlePlacement === "overlay" ? 0 : "auto",
72
- width: "100%",
73
- zIndex: 0,
74
- }, children: _jsx(Box, { sx: {
75
- bgcolor: appearance.handle,
76
- borderRadius: 999,
77
- height: 4,
78
- width: 36,
79
- } }) }));
80
- return (_jsxs(SwipeableDrawer, { anchor: "bottom", disableBackdropTransition: true, disableDiscovery: true, disableSwipeToOpen: true, hysteresis: 0.16, onClose: requestClose, onOpen: () => undefined, open: dismiss ? false : open, slotProps: {
81
- backdrop: {
82
- sx: { backgroundColor: "transparent" },
83
- },
84
- paper: paperSlotProps,
85
- }, transitionDuration: mobileBottomDrawerDismissDuration, children: [headerLeft ? (_jsx(MobileBottomDrawerHeader, { closeLabel: `Close ${ariaLabel}`, closeTooltip: closeTooltip, dragHandle: drawerHandle, left: headerLeft, onClose: requestClose, right: headerRight })) : handlePlacement === "above-content" ? (drawerHandle) : null, _jsxs(Box, { "data-component": "mobile-bottom-drawer-scroll", sx: {
86
- display: contentScrollMode === "child" ? "flex" : "block",
87
- flex: 1,
88
- minHeight: 0,
89
- overflowY: contentScrollMode === "child" ? "hidden" : "auto",
90
- overscrollBehaviorY: "contain",
91
- pb: appearance.safeAreaBottom,
92
- position: "relative",
93
- zIndex: handlePlacement === "overlay" ? 1 : "auto",
94
- }, children: [handlePlacement === "overlay" ? drawerHandle : null, children] })] }));
95
- }
@@ -1,30 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
4
- import { Box, IconButton, Tooltip } from "@mui/material";
5
- export function MobileBottomDrawerHeader({ closeLabel, closeTooltip, dragHandle, left, onClose, right, }) {
6
- return (_jsxs(Box, { component: "header", "data-component": "mobile-bottom-drawer-header", sx: {
7
- flex: "0 0 auto",
8
- minHeight: 56,
9
- position: "relative",
10
- }, children: [_jsx(Box, { sx: {
11
- inset: 0,
12
- position: "absolute",
13
- zIndex: 0,
14
- }, children: dragHandle }), _jsxs(Box, { sx: {
15
- alignItems: "center",
16
- display: "flex",
17
- gap: 1,
18
- minHeight: 56,
19
- px: 2,
20
- // Product decision: title and actions occupy the same compact row as
21
- // the drag affordance, avoiding a second band that pushes context
22
- // away from the top edge of the drawer.
23
- position: "relative",
24
- zIndex: 1,
25
- }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: left }), _jsxs(Box, { sx: { alignItems: "center", display: "flex", gap: 0.5 }, children: [right, _jsx(Tooltip, { title: closeTooltip !== null && closeTooltip !== void 0 ? closeTooltip : "", children: _jsx(IconButton, { "aria-label": closeLabel, onClick: onClose, sx: {
26
- minHeight: 48,
27
- minWidth: 48,
28
- "& > .MuiSvgIcon-root": { fontSize: 32 },
29
- }, children: _jsx(CloseRoundedIcon, {}) }) })] })] })] }));
30
- }
@@ -1,19 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Typography, useMediaQuery } from "@mui/material";
4
- import { MobileBottomDrawer } from "./MobileBottomDrawer.js";
5
- import { BottomDrawer } from "./BottomDrawer.js";
6
- // Product decision: consumers share responsive drawer chrome but keep
7
- // navigation and dismissal policies in their owning feature.
8
- export function ResponsiveDrawer({ ariaLabel, appearance, closeTooltip, children, desktopContentSx, desktopCloseLabel, desktopDataComponent, desktopDisablePortal = false, desktopOpen = true, headerActions, mobileContentScrollMode, mobileDataComponent, mobileDismiss = false, mobileOpen = true, onDesktopClose, onMobileClose, title, }) {
9
- const isMobileDrawer = useMediaQuery("(max-width:899.95px)", {
10
- noSsr: true,
11
- });
12
- if (isMobileDrawer) {
13
- if (!mobileOpen) {
14
- return null;
15
- }
16
- return (_jsx(MobileBottomDrawer, { appearance: appearance, closeTooltip: closeTooltip, ariaLabel: ariaLabel, contentScrollMode: mobileContentScrollMode, dataComponent: mobileDataComponent, dismiss: mobileDismiss, headerLeft: _jsx(Typography, { component: "h1", sx: { fontWeight: 760 }, children: title }), headerRight: headerActions, onClose: onMobileClose, children: children("mobile") }));
17
- }
18
- return (_jsx(BottomDrawer, { appearance: appearance, closeTooltip: closeTooltip, closeLabel: desktopCloseLabel !== null && desktopCloseLabel !== void 0 ? desktopCloseLabel : `Close ${ariaLabel}`, contentSx: desktopContentSx, dataComponent: desktopDataComponent, disablePortal: desktopDisablePortal, headerActions: headerActions, onClose: onDesktopClose, open: desktopOpen, title: title, children: children("desktop") }));
19
- }
@@ -1,216 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useId, useLayoutEffect, useRef, useState } from "react";
4
- import Collapse from "@mui/material/Collapse";
5
- import Fade from "@mui/material/Fade";
6
- import useMediaQuery from "@mui/material/useMediaQuery";
7
- import { WorkspaceSidePaneRoot } from "./WorkspaceSidePaneRoot.js";
8
- import { workspaceSidePaneGeometry, workspaceSidePaneMetrics } from "./workspaceSidePaneGeometry.js";
9
- const motion = { timeout: { enter: 220, exit: 170 }, easing: "cubic-bezier(0.25, 1, 0.5, 1)" };
10
- /** Keeps the workspace in one slot across docked, modal and closed presentation. */
11
- export function WorkspaceSidePane({ children, enabled = true, className, style, paneId, headingId, headingRef, workspaceRef, actionsLabel, resizeLabel = "Resize side pane", keepPaneMounted = false, preferredWidth, onPreferredWidthChange, getOverlaySiblings, renderActions, renderPane, }) {
12
- const generatedId = useId();
13
- const panelId = paneId !== null && paneId !== void 0 ? paneId : generatedId;
14
- const rootRef = useRef(null);
15
- const internalWorkspaceRef = useRef(null);
16
- const contentRef = workspaceRef !== null && workspaceRef !== void 0 ? workspaceRef : internalWorkspaceRef;
17
- const groupRef = useRef(null);
18
- const openerRef = useRef(null);
19
- const [open, setOpen] = useState(false);
20
- const [present, setPresent] = useState(false);
21
- const [directResize, setDirectResize] = useState(false);
22
- const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)", { noSsr: true });
23
- const duration = reducedMotion ? 0 : motion.timeout;
24
- const [internalWidth, setWidth] = useState(workspaceSidePaneMetrics.initialPane);
25
- const [bounds, setBounds] = useState({ width: workspaceSidePaneMetrics.minCanvas + workspaceSidePaneMetrics.rail + workspaceSidePaneMetrics.initialPane, top: 0, workspaceInset: 0 });
26
- const drag = useRef(null);
27
- const dockedMaximum = Math.max(workspaceSidePaneMetrics.minPane, Math.min(workspaceSidePaneMetrics.maxPane, bounds.width - bounds.workspaceInset - workspaceSidePaneMetrics.rail - workspaceSidePaneMetrics.minCanvas));
28
- const hasPreferredWidth = typeof preferredWidth === "number" && Number.isFinite(preferredWidth);
29
- const requestedWidth = hasPreferredWidth
30
- ? Math.min(workspaceSidePaneMetrics.maxPane, Math.max(workspaceSidePaneMetrics.minPane, preferredWidth))
31
- : internalWidth;
32
- // A host preference can yield to the canvas without changing the preferred
33
- // width or turning a workspace that fits the default into a modal.
34
- const width = hasPreferredWidth && dockedMaximum >= workspaceSidePaneMetrics.initialPane
35
- ? Math.min(requestedWidth, dockedMaximum)
36
- : requestedWidth;
37
- const geometry = workspaceSidePaneGeometry(bounds.width, width, bounds.workspaceInset);
38
- const presentedWidth = geometry.overlay && hasPreferredWidth
39
- ? workspaceSidePaneGeometry(bounds.width, workspaceSidePaneMetrics.initialPane, bounds.workspaceInset).paneWidth
40
- : geometry.paneWidth;
41
- const visible = enabled && open;
42
- const overlay = visible && geometry.overlay;
43
- const visibleRef = useRef(visible);
44
- visibleRef.current = visible;
45
- // Release modal focus and report closed to the host before visual exit.
46
- const overlayPresentation = geometry.overlay && (visible || (present && !reducedMotion));
47
- useLayoutEffect(() => {
48
- if (!enabled) {
49
- setPresent(false);
50
- setDirectResize(false);
51
- drag.current = null;
52
- }
53
- else if (visible) {
54
- setPresent(true);
55
- }
56
- }, [enabled, visible]);
57
- useLayoutEffect(() => {
58
- const element = rootRef.current;
59
- if (!element)
60
- return;
61
- const measure = () => {
62
- const rect = element.getBoundingClientRect();
63
- const workspaceStyle = contentRef.current ? getComputedStyle(contentRef.current) : null;
64
- // Useful canvas excludes its retained page padding; chrome still uses
65
- // the full root width, including in narrow overlays.
66
- const workspaceInset = workspaceStyle
67
- ? (parseFloat(workspaceStyle.paddingLeft) || 0) + (parseFloat(workspaceStyle.paddingRight) || 0)
68
- : 0;
69
- const next = { width: rect.width || window.innerWidth, top: Math.max(0, rect.top), workspaceInset };
70
- // Content ResizeObserver notifications also arrive during pane motion;
71
- // unchanged shell geometry must not rerender pane content per frame.
72
- setBounds((previous) => previous.width === next.width && previous.top === next.top && previous.workspaceInset === next.workspaceInset ? previous : next);
73
- };
74
- measure();
75
- const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
76
- observer === null || observer === void 0 ? void 0 : observer.observe(element);
77
- if (contentRef.current)
78
- observer === null || observer === void 0 ? void 0 : observer.observe(contentRef.current);
79
- window.addEventListener("resize", measure);
80
- return () => {
81
- observer === null || observer === void 0 ? void 0 : observer.disconnect();
82
- window.removeEventListener("resize", measure);
83
- };
84
- }, [enabled, contentRef]);
85
- useLayoutEffect(() => {
86
- var _a, _b, _c;
87
- if (!overlay)
88
- return;
89
- const content = contentRef.current;
90
- const root = rootRef.current;
91
- const siblings = root ? (_a = getOverlaySiblings === null || getOverlaySiblings === void 0 ? void 0 : getOverlaySiblings(root)) !== null && _a !== void 0 ? _a : [] : [];
92
- const covered = [...new Set([...(content ? [content] : []), ...siblings])];
93
- const priorInert = covered.map((element) => ({ element, value: element.getAttribute("inert") }));
94
- // Restore the pre-existing inert state when this overlay releases focus.
95
- covered.forEach((element) => element.setAttribute("inert", ""));
96
- const ownerDocument = (_c = (_b = rootRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument) !== null && _c !== void 0 ? _c : document;
97
- const focusInside = () => { var _a; return (_a = headingRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
98
- const containsTarget = (target) => { var _a; return Boolean(target && ((_a = groupRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))); };
99
- const containFocus = (event) => {
100
- if (!containsTarget(event.target))
101
- focusInside();
102
- };
103
- const containOutsideTab = (event) => {
104
- if (event.key !== "Tab" || containsTarget(event.target))
105
- return;
106
- event.preventDefault();
107
- event.stopPropagation();
108
- focusInside();
109
- };
110
- // inert blocks normal background interaction; focusin additionally contains
111
- // programmatic focus and browsers/environments with incomplete inert support.
112
- ownerDocument.addEventListener("focusin", containFocus, true);
113
- ownerDocument.addEventListener("keydown", containOutsideTab, true);
114
- focusInside();
115
- return () => {
116
- ownerDocument.removeEventListener("focusin", containFocus, true);
117
- ownerDocument.removeEventListener("keydown", containOutsideTab, true);
118
- priorInert.forEach(({ element, value }) => {
119
- if (value === null)
120
- element.removeAttribute("inert");
121
- else
122
- element.setAttribute("inert", value);
123
- });
124
- };
125
- }, [overlay, headingId, headingRef, contentRef, getOverlaySiblings]);
126
- useLayoutEffect(() => {
127
- var _a;
128
- if (!visible && present)
129
- (_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
130
- }, [visible, present]);
131
- const close = (opener) => {
132
- if (opener)
133
- openerRef.current = opener;
134
- setOpen(false);
135
- setDirectResize(false);
136
- drag.current = null;
137
- };
138
- // Deliberate docked resizing preserves the useful canvas and its focusable
139
- // control. Only an external viewport/container change may require an overlay.
140
- const clampWidth = (next, reset = false) => {
141
- const nextWidth = Math.max(workspaceSidePaneMetrics.minPane, Math.min(dockedMaximum, Math.round(next)));
142
- if (nextWidth === width && (!reset || nextWidth === requestedWidth))
143
- return;
144
- setDirectResize(true);
145
- setWidth(nextWidth);
146
- onPreferredWidthChange === null || onPreferredWidthChange === void 0 ? void 0 : onPreferredWidthChange(nextWidth);
147
- };
148
- const keyboard = (event) => {
149
- var _a, _b, _c, _d, _e;
150
- // Nested native dialogs own their own Escape handling.
151
- if ((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, "dialog[open]"))
152
- return;
153
- if (event.key === "Escape" && !event.defaultPrevented) {
154
- event.preventDefault();
155
- event.stopPropagation();
156
- close();
157
- return;
158
- }
159
- if (!overlay || event.key !== "Tab")
160
- return;
161
- const controls = [...((_d = (_c = groupRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('button, a[href], input, textarea, select, summary, [tabindex]')) !== null && _d !== void 0 ? _d : [])]
162
- .filter((element) => element.tabIndex >= 0 && !element.matches(":disabled")
163
- && !element.closest('[hidden], [inert], dialog:not([open])')
164
- && element.getClientRects().length > 0 && getComputedStyle(element).visibility !== "hidden");
165
- const first = controls[0], last = controls[controls.length - 1];
166
- const focused = (_e = groupRef.current) === null || _e === void 0 ? void 0 : _e.ownerDocument.activeElement;
167
- if (event.shiftKey && (focused === first || focused === headingRef.current)) {
168
- event.preventDefault();
169
- last === null || last === void 0 ? void 0 : last.focus();
170
- }
171
- else if (!event.shiftKey && focused === last) {
172
- event.preventDefault();
173
- first === null || first === void 0 ? void 0 : first.focus();
174
- }
175
- };
176
- const openFrom = (event, focusTarget = headingRef) => {
177
- openerRef.current = event.currentTarget;
178
- setPresent(true);
179
- setOpen(true);
180
- if (event.detail === 0)
181
- requestAnimationFrame(() => {
182
- var _a;
183
- if (visibleRef.current)
184
- (_a = focusTarget.current) === null || _a === void 0 ? void 0 : _a.focus();
185
- });
186
- };
187
- return (_jsxs(WorkspaceSidePaneRoot, { ref: rootRef, className: `workspace-side-pane${className ? ` ${className}` : ""}${enabled ? " workspace-side-pane-enabled" : ""}${visible ? " workspace-side-pane-open" : ""}${overlayPresentation ? " workspace-side-pane-overlay" : ""}${directResize && visible ? " workspace-side-pane-direct-resize" : ""}${reducedMotion ? " workspace-side-pane-reduced-motion" : ""}`, style: { ...style, "--workspace-side-pane-width": `${presentedWidth}px`, "--workspace-side-pane-top": `${bounds.top}px` }, children: [_jsx("div", { ref: contentRef, className: "workspace-side-pane-workspace", children: children }), enabled && (_jsxs(_Fragment, { children: [_jsx(Fade, { in: overlay, timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: true, children: _jsx("div", { className: "workspace-side-pane-backdrop", "data-active": overlay, style: { pointerEvents: overlay ? "auto" : "none" }, onClick: () => close(), "aria-hidden": "true" }) }), _jsxs("div", { className: "workspace-side-pane-group", ref: groupRef, role: overlay ? "dialog" : undefined, "aria-modal": overlay ? true : undefined, "aria-labelledby": overlay ? headingId : undefined, onKeyDown: keyboard, children: [_jsxs("nav", { className: "workspace-side-pane-rail", "aria-label": actionsLabel, children: [renderActions({ visible, paneId: panelId, openFrom, close }), visible && !overlay && (_jsx("div", { role: "separator", tabIndex: 0, className: "workspace-side-pane-resize", "aria-label": resizeLabel, "aria-orientation": "vertical", "aria-valuemin": workspaceSidePaneMetrics.minPane, "aria-valuemax": dockedMaximum, "aria-valuenow": width, "aria-valuetext": `${Math.round(geometry.paneWidth)} pixels`, title: "Drag to resize; Left/Right adjusts width; Enter resets", onKeyDown: (event) => {
188
- const next = event.key === "ArrowLeft"
189
- ? width + 16
190
- : event.key === "ArrowRight"
191
- ? width - 16
192
- : event.key === "Home"
193
- ? workspaceSidePaneMetrics.minPane
194
- : event.key === "End"
195
- ? workspaceSidePaneMetrics.maxPane
196
- : event.key === "Enter"
197
- ? workspaceSidePaneMetrics.initialPane
198
- : null;
199
- if (next !== null) {
200
- event.preventDefault();
201
- event.stopPropagation();
202
- clampWidth(next, event.key === "Enter");
203
- }
204
- }, onPointerDown: (event) => {
205
- var _a, _b;
206
- drag.current = { x: event.clientX, width };
207
- (_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
208
- }, onPointerMove: (event) => {
209
- if (drag.current)
210
- clampWidth(drag.current.width + drag.current.x - event.clientX);
211
- }, onPointerUp: () => {
212
- drag.current = null;
213
- }, onPointerCancel: () => {
214
- drag.current = null;
215
- } }))] }), _jsx(Collapse, { in: visible, orientation: "horizontal", className: "workspace-side-pane-presence", timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: !keepPaneMounted, onExited: () => setPresent(false), children: _jsx("aside", { id: panelId, className: "workspace-side-pane-panel", "aria-labelledby": headingId, "aria-hidden": !visible || undefined, inert: !visible, children: renderPane(visible) }) })] })] }))] }));
216
- }