@bayonai/mui-design 1.10.0 → 1.10.1

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 (295) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/cjs/actions/ActionMenu.d.ts +24 -0
  3. package/dist/cjs/actions/ActionMenu.js +36 -0
  4. package/dist/cjs/actions/DialogActionButtons.d.ts +23 -0
  5. package/dist/cjs/actions/DialogActionButtons.js +33 -0
  6. package/dist/cjs/actions/LoadingIconButton.d.ts +11 -0
  7. package/dist/cjs/actions/LoadingIconButton.js +10 -0
  8. package/dist/cjs/actions/StickyActionFooter.d.ts +14 -0
  9. package/dist/cjs/actions/StickyActionFooter.js +27 -0
  10. package/dist/cjs/actions/StickySubmitButton.d.ts +10 -0
  11. package/dist/cjs/actions/StickySubmitButton.js +10 -0
  12. package/dist/cjs/actions/index.d.ts +5 -0
  13. package/dist/cjs/actions/index.js +18 -0
  14. package/dist/cjs/client.d.ts +4 -0
  15. package/dist/cjs/client.js +21 -0
  16. package/dist/cjs/components/BayonFlowVisual.d.ts +12 -0
  17. package/dist/cjs/components/BayonFlowVisual.js +87 -0
  18. package/dist/cjs/components/BayonThemeModeToggle.d.ts +6 -0
  19. package/dist/cjs/components/BayonThemeModeToggle.js +34 -0
  20. package/dist/cjs/components/IconTooltipButton.d.ts +10 -0
  21. package/dist/cjs/components/IconTooltipButton.js +50 -0
  22. package/dist/cjs/components/panels.d.ts +37 -0
  23. package/dist/cjs/components/panels.js +92 -0
  24. package/dist/cjs/drawers/BottomDrawer.d.ts +16 -0
  25. package/dist/cjs/drawers/BottomDrawer.js +43 -0
  26. package/dist/cjs/drawers/MobileBottomDrawer.d.ts +20 -0
  27. package/dist/cjs/drawers/MobileBottomDrawer.js +102 -0
  28. package/dist/cjs/drawers/MobileBottomDrawerHeader.d.ts +11 -0
  29. package/dist/cjs/drawers/MobileBottomDrawerHeader.js +36 -0
  30. package/dist/cjs/drawers/ResponsiveDrawer.d.ts +25 -0
  31. package/dist/cjs/drawers/ResponsiveDrawer.js +22 -0
  32. package/dist/cjs/drawers/WorkspaceSidePane.d.ts +31 -0
  33. package/dist/cjs/drawers/WorkspaceSidePane.js +228 -0
  34. package/dist/cjs/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
  35. package/dist/cjs/drawers/WorkspaceSidePaneRoot.js +93 -0
  36. package/dist/cjs/drawers/drawerAppearance.d.ts +8 -0
  37. package/dist/cjs/drawers/drawerAppearance.js +10 -0
  38. package/dist/cjs/drawers/index.d.ts +7 -0
  39. package/dist/cjs/drawers/index.js +19 -0
  40. package/dist/cjs/drawers/useVisualViewportBottomInset.d.ts +6 -0
  41. package/dist/cjs/drawers/useVisualViewportBottomInset.js +33 -0
  42. package/dist/cjs/drawers/workspaceSidePaneGeometry.d.ts +11 -0
  43. package/dist/cjs/drawers/workspaceSidePaneGeometry.js +15 -0
  44. package/dist/cjs/feedback/StatusNotice.d.ts +13 -0
  45. package/dist/cjs/feedback/StatusNotice.js +62 -0
  46. package/dist/cjs/feedback/index.d.ts +1 -0
  47. package/dist/cjs/feedback/index.js +7 -0
  48. package/dist/cjs/index.d.ts +9 -0
  49. package/dist/cjs/index.js +25 -0
  50. package/dist/cjs/internal/DialogChoiceTile.d.ts +20 -0
  51. package/dist/cjs/internal/DialogChoiceTile.js +60 -0
  52. package/dist/cjs/links/LinkAddressPreview.d.ts +21 -0
  53. package/dist/cjs/links/LinkAddressPreview.js +130 -0
  54. package/dist/cjs/links/index.d.ts +3 -0
  55. package/dist/cjs/links/index.js +9 -0
  56. package/dist/cjs/links/useLinkAddressPreview.d.ts +26 -0
  57. package/dist/cjs/links/useLinkAddressPreview.js +171 -0
  58. package/dist/cjs/location/GeographicLocationField.d.ts +26 -0
  59. package/dist/cjs/location/GeographicLocationField.js +49 -0
  60. package/dist/cjs/location/GoogleMapsAttribution.d.ts +1 -0
  61. package/dist/cjs/location/GoogleMapsAttribution.js +12 -0
  62. package/dist/cjs/location/MetadataFieldGroup.d.ts +5 -0
  63. package/dist/cjs/location/MetadataFieldGroup.js +13 -0
  64. package/dist/cjs/location/MetadataValueField.d.ts +23 -0
  65. package/dist/cjs/location/MetadataValueField.js +27 -0
  66. package/dist/cjs/location/SearchInputAction.d.ts +9 -0
  67. package/dist/cjs/location/SearchInputAction.js +14 -0
  68. package/dist/cjs/location/TemplateBadge.d.ts +5 -0
  69. package/dist/cjs/location/TemplateBadge.js +9 -0
  70. package/dist/cjs/location/VenueSearchDialog.d.ts +33 -0
  71. package/dist/cjs/location/VenueSearchDialog.js +112 -0
  72. package/dist/cjs/location/index.d.ts +6 -0
  73. package/dist/cjs/location/index.js +20 -0
  74. package/dist/cjs/package.json +3 -0
  75. package/dist/cjs/pending/PendingChangesDialogShell.d.ts +2 -0
  76. package/dist/cjs/pending/PendingChangesDialogShell.js +16 -0
  77. package/dist/cjs/pending/PendingChangesDialogView.d.ts +2 -0
  78. package/dist/cjs/pending/PendingChangesDialogView.js +140 -0
  79. package/dist/cjs/pending/PendingChangesIndicatorView.d.ts +10 -0
  80. package/dist/cjs/pending/PendingChangesIndicatorView.js +27 -0
  81. package/dist/cjs/pending/index.d.ts +3 -0
  82. package/dist/cjs/pending/index.js +9 -0
  83. package/dist/cjs/pending/types.d.ts +55 -0
  84. package/dist/cjs/pending/types.js +2 -0
  85. package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +17 -0
  86. package/dist/cjs/pricing/PlanUpgradeDialog.js +22 -0
  87. package/dist/cjs/pricing/PricingTable.d.ts +28 -0
  88. package/dist/cjs/pricing/PricingTable.js +60 -0
  89. package/dist/cjs/pricing/index.d.ts +3 -0
  90. package/dist/cjs/pricing/index.js +8 -0
  91. package/dist/cjs/providers/BayonThemeProvider.d.ts +20 -0
  92. package/dist/cjs/providers/BayonThemeProvider.js +163 -0
  93. package/dist/cjs/sections/ExpandableSectionToggle.d.ts +12 -0
  94. package/dist/cjs/sections/ExpandableSectionToggle.js +32 -0
  95. package/dist/cjs/sections/index.d.ts +2 -0
  96. package/dist/cjs/sections/index.js +7 -0
  97. package/dist/cjs/styles/pageStyles.d.ts +15 -0
  98. package/dist/cjs/styles/pageStyles.js +103 -0
  99. package/dist/cjs/swipe/SwipeActionRow.d.ts +8 -0
  100. package/dist/cjs/swipe/SwipeActionRow.js +123 -0
  101. package/dist/cjs/swipe/index.d.ts +1 -0
  102. package/dist/cjs/swipe/index.js +8 -0
  103. package/dist/cjs/theme/components.d.ts +2 -0
  104. package/dist/cjs/theme/components.js +123 -0
  105. package/dist/cjs/theme/createBayonTheme.d.ts +4 -0
  106. package/dist/cjs/theme/createBayonTheme.js +45 -0
  107. package/dist/cjs/theme/palette.d.ts +146 -0
  108. package/dist/cjs/theme/palette.js +109 -0
  109. package/dist/cjs/theme/shadows.d.ts +2 -0
  110. package/dist/cjs/theme/shadows.js +21 -0
  111. package/dist/cjs/theme/types.d.ts +47 -0
  112. package/dist/cjs/theme/types.js +2 -0
  113. package/dist/cjs/theme/typography.d.ts +2 -0
  114. package/dist/cjs/theme/typography.js +58 -0
  115. package/dist/cjs/toasts/ActionToast.d.ts +11 -0
  116. package/dist/cjs/toasts/ActionToast.js +12 -0
  117. package/dist/cjs/toasts/Toast.d.ts +16 -0
  118. package/dist/cjs/toasts/Toast.js +55 -0
  119. package/dist/cjs/toasts/index.d.ts +5 -0
  120. package/dist/cjs/toasts/index.js +12 -0
  121. package/dist/cjs/toasts/useUpwardToastDismiss.d.ts +15 -0
  122. package/dist/cjs/toasts/useUpwardToastDismiss.js +73 -0
  123. package/dist/cjs/uploads/CameraCaptureDialog.d.ts +22 -0
  124. package/dist/cjs/uploads/CameraCaptureDialog.js +187 -0
  125. package/dist/cjs/uploads/FileRow.d.ts +10 -0
  126. package/dist/cjs/uploads/FileRow.js +23 -0
  127. package/dist/cjs/uploads/FileSwipeActionRow.d.ts +1 -0
  128. package/dist/cjs/uploads/FileSwipeActionRow.js +11 -0
  129. package/dist/cjs/uploads/FileThumbnail.d.ts +5 -0
  130. package/dist/cjs/uploads/FileThumbnail.js +104 -0
  131. package/dist/cjs/uploads/FileUpload.d.ts +26 -0
  132. package/dist/cjs/uploads/FileUpload.js +98 -0
  133. package/dist/cjs/uploads/FileViewer.d.ts +9 -0
  134. package/dist/cjs/uploads/FileViewer.js +155 -0
  135. package/dist/cjs/uploads/ImageCropDialog.d.ts +26 -0
  136. package/dist/cjs/uploads/ImageCropDialog.js +215 -0
  137. package/dist/cjs/uploads/ImageInfoPanel.d.ts +24 -0
  138. package/dist/cjs/uploads/ImageInfoPanel.js +41 -0
  139. package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +13 -0
  140. package/dist/cjs/uploads/ImageUploadQualityDialog.js +57 -0
  141. package/dist/cjs/uploads/UploadProgressRing.d.ts +24 -0
  142. package/dist/cjs/uploads/UploadProgressRing.js +32 -0
  143. package/dist/cjs/uploads/cameraCropPresentation.d.ts +2 -0
  144. package/dist/cjs/uploads/cameraCropPresentation.js +12 -0
  145. package/dist/cjs/uploads/index.d.ts +12 -0
  146. package/dist/cjs/uploads/index.js +24 -0
  147. package/dist/cjs/utils/createBayonEmotionCache.d.ts +1 -0
  148. package/dist/cjs/utils/createBayonEmotionCache.js +21 -0
  149. package/dist/esm/actions/ActionMenu.js +30 -0
  150. package/dist/esm/actions/DialogActionButtons.js +24 -0
  151. package/dist/esm/actions/LoadingIconButton.js +7 -0
  152. package/dist/esm/actions/StickyActionFooter.js +24 -0
  153. package/dist/esm/actions/StickySubmitButton.js +7 -0
  154. package/dist/esm/actions/index.js +7 -0
  155. package/dist/esm/client.js +5 -0
  156. package/dist/esm/components/BayonFlowVisual.js +81 -0
  157. package/dist/esm/components/BayonThemeModeToggle.js +28 -0
  158. package/dist/esm/components/IconTooltipButton.js +11 -0
  159. package/dist/esm/components/panels.js +76 -0
  160. package/dist/esm/drawers/BottomDrawer.js +37 -0
  161. package/dist/esm/drawers/MobileBottomDrawer.js +95 -0
  162. package/dist/esm/drawers/MobileBottomDrawerHeader.js +30 -0
  163. package/dist/esm/drawers/ResponsiveDrawer.js +19 -0
  164. package/dist/esm/drawers/WorkspaceSidePane.js +222 -0
  165. package/dist/esm/drawers/WorkspaceSidePaneRoot.js +90 -0
  166. package/dist/esm/drawers/drawerAppearance.js +7 -0
  167. package/dist/esm/drawers/index.js +8 -0
  168. package/dist/esm/drawers/useVisualViewportBottomInset.js +29 -0
  169. package/dist/esm/drawers/workspaceSidePaneGeometry.js +11 -0
  170. package/dist/esm/feedback/StatusNotice.js +56 -0
  171. package/dist/esm/feedback/index.js +3 -0
  172. package/dist/esm/index.js +9 -0
  173. package/dist/esm/internal/DialogChoiceTile.js +54 -0
  174. package/dist/esm/links/LinkAddressPreview.js +91 -0
  175. package/dist/esm/links/index.js +4 -0
  176. package/dist/esm/links/useLinkAddressPreview.js +168 -0
  177. package/dist/esm/location/GeographicLocationField.js +43 -0
  178. package/dist/esm/location/GoogleMapsAttribution.js +9 -0
  179. package/dist/esm/location/MetadataFieldGroup.js +9 -0
  180. package/dist/esm/location/MetadataValueField.js +23 -0
  181. package/dist/esm/location/SearchInputAction.js +8 -0
  182. package/dist/esm/location/TemplateBadge.js +6 -0
  183. package/dist/esm/location/VenueSearchDialog.js +109 -0
  184. package/dist/esm/location/index.js +7 -0
  185. package/dist/esm/pending/PendingChangesDialogShell.js +10 -0
  186. package/dist/esm/pending/PendingChangesDialogView.js +134 -0
  187. package/dist/esm/pending/PendingChangesIndicatorView.js +21 -0
  188. package/dist/esm/pending/index.js +4 -0
  189. package/dist/esm/pending/types.js +1 -0
  190. package/dist/esm/pricing/PlanUpgradeDialog.js +19 -0
  191. package/dist/esm/pricing/PricingTable.js +54 -0
  192. package/dist/esm/pricing/index.js +3 -0
  193. package/dist/esm/providers/BayonThemeProvider.js +123 -0
  194. package/dist/esm/sections/ExpandableSectionToggle.js +26 -0
  195. package/dist/esm/sections/index.js +3 -0
  196. package/dist/esm/styles/pageStyles.js +100 -0
  197. package/dist/esm/swipe/SwipeActionRow.js +116 -0
  198. package/dist/esm/swipe/index.js +3 -0
  199. package/dist/esm/theme/components.js +120 -0
  200. package/dist/esm/theme/createBayonTheme.js +41 -0
  201. package/dist/esm/theme/palette.js +106 -0
  202. package/dist/esm/theme/shadows.js +18 -0
  203. package/dist/esm/theme/types.js +1 -0
  204. package/dist/esm/theme/typography.js +55 -0
  205. package/dist/esm/toasts/ActionToast.js +9 -0
  206. package/dist/esm/toasts/Toast.js +52 -0
  207. package/dist/esm/toasts/index.js +5 -0
  208. package/dist/esm/toasts/useUpwardToastDismiss.js +69 -0
  209. package/dist/esm/uploads/CameraCaptureDialog.js +181 -0
  210. package/dist/esm/uploads/FileRow.js +17 -0
  211. package/dist/esm/uploads/FileSwipeActionRow.js +7 -0
  212. package/dist/esm/uploads/FileThumbnail.js +98 -0
  213. package/dist/esm/uploads/FileUpload.js +92 -0
  214. package/dist/esm/uploads/FileViewer.js +149 -0
  215. package/dist/esm/uploads/ImageCropDialog.js +212 -0
  216. package/dist/esm/uploads/ImageInfoPanel.js +35 -0
  217. package/dist/esm/uploads/ImageUploadQualityDialog.js +51 -0
  218. package/dist/esm/uploads/UploadProgressRing.js +29 -0
  219. package/dist/esm/uploads/cameraCropPresentation.js +5 -0
  220. package/dist/esm/uploads/index.js +11 -0
  221. package/dist/esm/utils/createBayonEmotionCache.js +15 -0
  222. package/dist/types/actions/ActionMenu.d.ts +24 -0
  223. package/dist/types/actions/DialogActionButtons.d.ts +23 -0
  224. package/dist/types/actions/LoadingIconButton.d.ts +11 -0
  225. package/dist/types/actions/StickyActionFooter.d.ts +14 -0
  226. package/dist/types/actions/StickySubmitButton.d.ts +10 -0
  227. package/dist/types/actions/index.d.ts +5 -0
  228. package/dist/types/client.d.ts +4 -0
  229. package/dist/types/components/BayonFlowVisual.d.ts +12 -0
  230. package/dist/types/components/BayonThemeModeToggle.d.ts +6 -0
  231. package/dist/types/components/IconTooltipButton.d.ts +10 -0
  232. package/dist/types/components/panels.d.ts +37 -0
  233. package/dist/types/drawers/BottomDrawer.d.ts +16 -0
  234. package/dist/types/drawers/MobileBottomDrawer.d.ts +20 -0
  235. package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +11 -0
  236. package/dist/types/drawers/ResponsiveDrawer.d.ts +25 -0
  237. package/dist/types/drawers/WorkspaceSidePane.d.ts +31 -0
  238. package/dist/types/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
  239. package/dist/types/drawers/drawerAppearance.d.ts +8 -0
  240. package/dist/types/drawers/index.d.ts +7 -0
  241. package/dist/types/drawers/useVisualViewportBottomInset.d.ts +6 -0
  242. package/dist/types/drawers/workspaceSidePaneGeometry.d.ts +11 -0
  243. package/dist/types/feedback/StatusNotice.d.ts +13 -0
  244. package/dist/types/feedback/index.d.ts +1 -0
  245. package/dist/types/index.d.ts +9 -0
  246. package/dist/types/internal/DialogChoiceTile.d.ts +20 -0
  247. package/dist/types/links/LinkAddressPreview.d.ts +21 -0
  248. package/dist/types/links/index.d.ts +3 -0
  249. package/dist/types/links/useLinkAddressPreview.d.ts +26 -0
  250. package/dist/types/location/GeographicLocationField.d.ts +26 -0
  251. package/dist/types/location/GoogleMapsAttribution.d.ts +1 -0
  252. package/dist/types/location/MetadataFieldGroup.d.ts +5 -0
  253. package/dist/types/location/MetadataValueField.d.ts +23 -0
  254. package/dist/types/location/SearchInputAction.d.ts +9 -0
  255. package/dist/types/location/TemplateBadge.d.ts +5 -0
  256. package/dist/types/location/VenueSearchDialog.d.ts +33 -0
  257. package/dist/types/location/index.d.ts +6 -0
  258. package/dist/types/pending/PendingChangesDialogShell.d.ts +2 -0
  259. package/dist/types/pending/PendingChangesDialogView.d.ts +2 -0
  260. package/dist/types/pending/PendingChangesIndicatorView.d.ts +10 -0
  261. package/dist/types/pending/index.d.ts +3 -0
  262. package/dist/types/pending/types.d.ts +55 -0
  263. package/dist/types/pricing/PlanUpgradeDialog.d.ts +17 -0
  264. package/dist/types/pricing/PricingTable.d.ts +28 -0
  265. package/dist/types/pricing/index.d.ts +3 -0
  266. package/dist/types/providers/BayonThemeProvider.d.ts +20 -0
  267. package/dist/types/sections/ExpandableSectionToggle.d.ts +12 -0
  268. package/dist/types/sections/index.d.ts +2 -0
  269. package/dist/types/styles/pageStyles.d.ts +15 -0
  270. package/dist/types/swipe/SwipeActionRow.d.ts +8 -0
  271. package/dist/types/swipe/index.d.ts +1 -0
  272. package/dist/types/theme/components.d.ts +2 -0
  273. package/dist/types/theme/createBayonTheme.d.ts +4 -0
  274. package/dist/types/theme/palette.d.ts +146 -0
  275. package/dist/types/theme/shadows.d.ts +2 -0
  276. package/dist/types/theme/types.d.ts +47 -0
  277. package/dist/types/theme/typography.d.ts +2 -0
  278. package/dist/types/toasts/ActionToast.d.ts +11 -0
  279. package/dist/types/toasts/Toast.d.ts +16 -0
  280. package/dist/types/toasts/index.d.ts +5 -0
  281. package/dist/types/toasts/useUpwardToastDismiss.d.ts +15 -0
  282. package/dist/types/uploads/CameraCaptureDialog.d.ts +22 -0
  283. package/dist/types/uploads/FileRow.d.ts +10 -0
  284. package/dist/types/uploads/FileSwipeActionRow.d.ts +1 -0
  285. package/dist/types/uploads/FileThumbnail.d.ts +5 -0
  286. package/dist/types/uploads/FileUpload.d.ts +26 -0
  287. package/dist/types/uploads/FileViewer.d.ts +9 -0
  288. package/dist/types/uploads/ImageCropDialog.d.ts +26 -0
  289. package/dist/types/uploads/ImageInfoPanel.d.ts +24 -0
  290. package/dist/types/uploads/ImageUploadQualityDialog.d.ts +13 -0
  291. package/dist/types/uploads/UploadProgressRing.d.ts +24 -0
  292. package/dist/types/uploads/cameraCropPresentation.d.ts +2 -0
  293. package/dist/types/uploads/index.d.ts +12 -0
  294. package/dist/types/utils/createBayonEmotionCache.d.ts +1 -0
  295. package/package.json +2 -1
@@ -0,0 +1,81 @@
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
+ }
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ });
@@ -0,0 +1,76 @@
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
+ }
@@ -0,0 +1,37 @@
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
+ }
@@ -0,0 +1,95 @@
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
+ }
@@ -0,0 +1,30 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,222 @@
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 GlobalStyles from "@mui/material/GlobalStyles";
7
+ import useMediaQuery from "@mui/material/useMediaQuery";
8
+ import { WorkspaceSidePaneRoot } from "./WorkspaceSidePaneRoot.js";
9
+ import { workspaceSidePaneGeometry, workspaceSidePaneMetrics } from "./workspaceSidePaneGeometry.js";
10
+ const motion = { timeout: { enter: 220, exit: 170 }, easing: "cubic-bezier(0.25, 1, 0.5, 1)" };
11
+ // Clip horizontal overflow so body does not intercept the docked pane's
12
+ // sticky positioning when the document is the scroll container.
13
+ const viewportPinningStyles = {
14
+ 'body:has(.workspace-side-pane[data-pin-to-viewport="true"])': { overflowX: "clip" },
15
+ };
16
+ /** Keeps the workspace in one slot across docked, modal and closed presentation. */
17
+ export function WorkspaceSidePane({ children, enabled = true, pinToViewport = true, className, style, paneId, headingId, headingRef, workspaceRef, actionsLabel, resizeLabel = "Resize side pane", keepPaneMounted = false, preferredWidth, onPreferredWidthChange, getOverlaySiblings, renderActions, renderPane, }) {
18
+ const generatedId = useId();
19
+ const panelId = paneId !== null && paneId !== void 0 ? paneId : generatedId;
20
+ const rootRef = useRef(null);
21
+ const internalWorkspaceRef = useRef(null);
22
+ const contentRef = workspaceRef !== null && workspaceRef !== void 0 ? workspaceRef : internalWorkspaceRef;
23
+ const groupRef = useRef(null);
24
+ const openerRef = useRef(null);
25
+ const [open, setOpen] = useState(false);
26
+ const [present, setPresent] = useState(false);
27
+ const [directResize, setDirectResize] = useState(false);
28
+ const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)", { noSsr: true });
29
+ const duration = reducedMotion ? 0 : motion.timeout;
30
+ const [internalWidth, setWidth] = useState(workspaceSidePaneMetrics.initialPane);
31
+ const [bounds, setBounds] = useState({ width: workspaceSidePaneMetrics.minCanvas + workspaceSidePaneMetrics.rail + workspaceSidePaneMetrics.initialPane, top: 0, workspaceInset: 0 });
32
+ const drag = useRef(null);
33
+ const dockedMaximum = Math.max(workspaceSidePaneMetrics.minPane, Math.min(workspaceSidePaneMetrics.maxPane, bounds.width - bounds.workspaceInset - workspaceSidePaneMetrics.rail - workspaceSidePaneMetrics.minCanvas));
34
+ const hasPreferredWidth = typeof preferredWidth === "number" && Number.isFinite(preferredWidth);
35
+ const requestedWidth = hasPreferredWidth
36
+ ? Math.min(workspaceSidePaneMetrics.maxPane, Math.max(workspaceSidePaneMetrics.minPane, preferredWidth))
37
+ : internalWidth;
38
+ // A host preference can yield to the canvas without changing the preferred
39
+ // width or turning a workspace that fits the default into a modal.
40
+ const width = hasPreferredWidth && dockedMaximum >= workspaceSidePaneMetrics.initialPane
41
+ ? Math.min(requestedWidth, dockedMaximum)
42
+ : requestedWidth;
43
+ const geometry = workspaceSidePaneGeometry(bounds.width, width, bounds.workspaceInset);
44
+ const presentedWidth = geometry.overlay && hasPreferredWidth
45
+ ? workspaceSidePaneGeometry(bounds.width, workspaceSidePaneMetrics.initialPane, bounds.workspaceInset).paneWidth
46
+ : geometry.paneWidth;
47
+ const visible = enabled && open;
48
+ const overlay = visible && geometry.overlay;
49
+ const visibleRef = useRef(visible);
50
+ visibleRef.current = visible;
51
+ // Release modal focus and report closed to the host before visual exit.
52
+ const overlayPresentation = geometry.overlay && (visible || (present && !reducedMotion));
53
+ useLayoutEffect(() => {
54
+ if (!enabled) {
55
+ setPresent(false);
56
+ setDirectResize(false);
57
+ drag.current = null;
58
+ }
59
+ else if (visible) {
60
+ setPresent(true);
61
+ }
62
+ }, [enabled, visible]);
63
+ useLayoutEffect(() => {
64
+ const element = rootRef.current;
65
+ if (!element)
66
+ return;
67
+ const measure = () => {
68
+ const rect = element.getBoundingClientRect();
69
+ const workspaceStyle = contentRef.current ? getComputedStyle(contentRef.current) : null;
70
+ // Useful canvas excludes its retained page padding; chrome still uses
71
+ // the full root width, including in narrow overlays.
72
+ const workspaceInset = workspaceStyle
73
+ ? (parseFloat(workspaceStyle.paddingLeft) || 0) + (parseFloat(workspaceStyle.paddingRight) || 0)
74
+ : 0;
75
+ const next = { width: rect.width || window.innerWidth, top: Math.max(0, rect.top), workspaceInset };
76
+ // Content ResizeObserver notifications also arrive during pane motion;
77
+ // unchanged shell geometry must not rerender pane content per frame.
78
+ setBounds((previous) => previous.width === next.width && previous.top === next.top && previous.workspaceInset === next.workspaceInset ? previous : next);
79
+ };
80
+ measure();
81
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
82
+ observer === null || observer === void 0 ? void 0 : observer.observe(element);
83
+ if (contentRef.current)
84
+ observer === null || observer === void 0 ? void 0 : observer.observe(contentRef.current);
85
+ window.addEventListener("resize", measure);
86
+ return () => {
87
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
88
+ window.removeEventListener("resize", measure);
89
+ };
90
+ }, [enabled, contentRef]);
91
+ useLayoutEffect(() => {
92
+ var _a, _b, _c;
93
+ if (!overlay)
94
+ return;
95
+ const content = contentRef.current;
96
+ const root = rootRef.current;
97
+ const siblings = root ? (_a = getOverlaySiblings === null || getOverlaySiblings === void 0 ? void 0 : getOverlaySiblings(root)) !== null && _a !== void 0 ? _a : [] : [];
98
+ const covered = [...new Set([...(content ? [content] : []), ...siblings])];
99
+ const priorInert = covered.map((element) => ({ element, value: element.getAttribute("inert") }));
100
+ // Restore the pre-existing inert state when this overlay releases focus.
101
+ covered.forEach((element) => element.setAttribute("inert", ""));
102
+ const ownerDocument = (_c = (_b = rootRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument) !== null && _c !== void 0 ? _c : document;
103
+ const focusInside = () => { var _a; return (_a = headingRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
104
+ const containsTarget = (target) => { var _a; return Boolean(target && ((_a = groupRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))); };
105
+ const containFocus = (event) => {
106
+ if (!containsTarget(event.target))
107
+ focusInside();
108
+ };
109
+ const containOutsideTab = (event) => {
110
+ if (event.key !== "Tab" || containsTarget(event.target))
111
+ return;
112
+ event.preventDefault();
113
+ event.stopPropagation();
114
+ focusInside();
115
+ };
116
+ // inert blocks normal background interaction; focusin additionally contains
117
+ // programmatic focus and browsers/environments with incomplete inert support.
118
+ ownerDocument.addEventListener("focusin", containFocus, true);
119
+ ownerDocument.addEventListener("keydown", containOutsideTab, true);
120
+ focusInside();
121
+ return () => {
122
+ ownerDocument.removeEventListener("focusin", containFocus, true);
123
+ ownerDocument.removeEventListener("keydown", containOutsideTab, true);
124
+ priorInert.forEach(({ element, value }) => {
125
+ if (value === null)
126
+ element.removeAttribute("inert");
127
+ else
128
+ element.setAttribute("inert", value);
129
+ });
130
+ };
131
+ }, [overlay, headingId, headingRef, contentRef, getOverlaySiblings]);
132
+ useLayoutEffect(() => {
133
+ var _a;
134
+ if (!visible && present)
135
+ (_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
136
+ }, [visible, present]);
137
+ const close = (opener) => {
138
+ if (opener)
139
+ openerRef.current = opener;
140
+ setOpen(false);
141
+ setDirectResize(false);
142
+ drag.current = null;
143
+ };
144
+ // Deliberate docked resizing preserves the useful canvas and its focusable
145
+ // control. Only an external viewport/container change may require an overlay.
146
+ const clampWidth = (next, reset = false) => {
147
+ const nextWidth = Math.max(workspaceSidePaneMetrics.minPane, Math.min(dockedMaximum, Math.round(next)));
148
+ if (nextWidth === width && (!reset || nextWidth === requestedWidth))
149
+ return;
150
+ setDirectResize(true);
151
+ setWidth(nextWidth);
152
+ onPreferredWidthChange === null || onPreferredWidthChange === void 0 ? void 0 : onPreferredWidthChange(nextWidth);
153
+ };
154
+ const keyboard = (event) => {
155
+ var _a, _b, _c, _d, _e;
156
+ // Nested native dialogs own their own Escape handling.
157
+ if ((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, "dialog[open]"))
158
+ return;
159
+ if (event.key === "Escape" && !event.defaultPrevented) {
160
+ event.preventDefault();
161
+ event.stopPropagation();
162
+ close();
163
+ return;
164
+ }
165
+ if (!overlay || event.key !== "Tab")
166
+ return;
167
+ 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 : [])]
168
+ .filter((element) => element.tabIndex >= 0 && !element.matches(":disabled")
169
+ && !element.closest('[hidden], [inert], dialog:not([open])')
170
+ && element.getClientRects().length > 0 && getComputedStyle(element).visibility !== "hidden");
171
+ const first = controls[0], last = controls[controls.length - 1];
172
+ const focused = (_e = groupRef.current) === null || _e === void 0 ? void 0 : _e.ownerDocument.activeElement;
173
+ if (event.shiftKey && (focused === first || focused === headingRef.current)) {
174
+ event.preventDefault();
175
+ last === null || last === void 0 ? void 0 : last.focus();
176
+ }
177
+ else if (!event.shiftKey && focused === last) {
178
+ event.preventDefault();
179
+ first === null || first === void 0 ? void 0 : first.focus();
180
+ }
181
+ };
182
+ const openFrom = (event, focusTarget = headingRef) => {
183
+ openerRef.current = event.currentTarget;
184
+ setPresent(true);
185
+ setOpen(true);
186
+ if (event.detail === 0)
187
+ requestAnimationFrame(() => {
188
+ var _a;
189
+ if (visibleRef.current)
190
+ (_a = focusTarget.current) === null || _a === void 0 ? void 0 : _a.focus();
191
+ });
192
+ };
193
+ return (_jsxs(WorkspaceSidePaneRoot, { ref: rootRef, "data-pin-to-viewport": enabled && pinToViewport ? true : undefined, 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: [enabled && pinToViewport && _jsx(GlobalStyles, { styles: viewportPinningStyles }), _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) => {
194
+ const next = event.key === "ArrowLeft"
195
+ ? width + 16
196
+ : event.key === "ArrowRight"
197
+ ? width - 16
198
+ : event.key === "Home"
199
+ ? workspaceSidePaneMetrics.minPane
200
+ : event.key === "End"
201
+ ? workspaceSidePaneMetrics.maxPane
202
+ : event.key === "Enter"
203
+ ? workspaceSidePaneMetrics.initialPane
204
+ : null;
205
+ if (next !== null) {
206
+ event.preventDefault();
207
+ event.stopPropagation();
208
+ clampWidth(next, event.key === "Enter");
209
+ }
210
+ }, onPointerDown: (event) => {
211
+ var _a, _b;
212
+ drag.current = { x: event.clientX, width };
213
+ (_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
214
+ }, onPointerMove: (event) => {
215
+ if (drag.current)
216
+ clampWidth(drag.current.width + drag.current.x - event.clientX);
217
+ }, onPointerUp: () => {
218
+ drag.current = null;
219
+ }, onPointerCancel: () => {
220
+ drag.current = null;
221
+ } }))] }), _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) }) })] })] }))] }));
222
+ }