@abyss-project/commons-front-core 20.5.1 → 21.0.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 (337) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +18 -0
  3. package/catalog/pages/CookieConsent.tsx +1 -1
  4. package/catalog/pages/MobileShell.tsx +75 -39
  5. package/catalog/pages/Tabs.tsx +24 -0
  6. package/catalog/specs/cookie-consent-modal.spec.ts +1 -1
  7. package/catalog/specs/mobile-shell.spec.ts +28 -0
  8. package/dist/{CookieConsentSettings-BGIHx7eH.js → CookieConsentSettings-BzeQZ5tD.js} +223 -224
  9. package/dist/{Surface-B74cXq1M.js → Surface-t4XKtudZ.js} +319 -714
  10. package/dist/Tabs-DXgqVX6V.js +5276 -0
  11. package/dist/components/ScanStatus/InfectedDownloadWarningModal.d.ts +14 -45
  12. package/dist/components/business/AbyssProjectLinkField/AbyssProjectLinkField.d.ts +48 -0
  13. package/dist/components/business/CookieConsent/containing-block.d.ts +1 -1
  14. package/dist/components/business/Deliveries/ScheduledTaskPanel.d.ts +7 -2
  15. package/dist/components/business/Deliveries/deliveries.logic.d.ts +31 -0
  16. package/dist/components/business/Deliveries/deliveries.types.d.ts +24 -0
  17. package/dist/components/business/Deliveries/use-missed-run-count.hook.d.ts +8 -0
  18. package/dist/components/business/Deliveries/use-missed-runs.hook.d.ts +13 -0
  19. package/dist/components/business/Deliveries/use-previous-page-edge.hook.d.ts +22 -0
  20. package/dist/components/business/PendingInvitations/PendingInvitations.d.ts +28 -0
  21. package/dist/components/business/index.d.ts +2 -0
  22. package/dist/components/editors/PdfEditor/PdfEditor.d.ts +2 -2
  23. package/dist/components/editors/PdfEditor/pdf-colors.d.ts +2 -2
  24. package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.d.ts +3 -3
  25. package/dist/components/inputs/date-localization.d.ts +3 -3
  26. package/dist/components/layers/Modal/Modal.d.ts +1 -1
  27. package/dist/components/meaning/Avatar/Avatar.d.ts +2 -0
  28. package/dist/components/mobile/ActionBar/ActionBar.d.ts +2 -1
  29. package/dist/components/mobile/BottomSheet/BottomSheet.d.ts +8 -2
  30. package/dist/components/mobile/MobileShell/MobileShell.d.ts +2 -1
  31. package/dist/components/mobile/MobileShell/MobileShellActionBar.d.ts +7 -0
  32. package/dist/components/mobile/MobileShell/MobileShellPageFrame.d.ts +13 -0
  33. package/dist/components/mobile/index.d.ts +1 -0
  34. package/dist/components/mobile/mobile-layout.d.ts +8 -0
  35. package/dist/components/mobile/test-support/mobile-test-harness.d.ts +5 -0
  36. package/dist/components/structure/AppShell/AppShell.d.ts +2 -2
  37. package/dist/components/structure/test-support/structure-test-harness.d.ts +1 -3
  38. package/dist/cookie-consent.js +2 -2
  39. package/dist/demo/DemoBanner/DemoBanner.d.ts +1 -1
  40. package/dist/{editors-s-GER37R.js → editors-Dt29L0Ux.js} +4074 -4063
  41. package/dist/editors.js +1 -1
  42. package/dist/hooks/use-rich-intl.hook.d.ts +52 -454
  43. package/dist/hooks/use-scroll-overflow-cue.hook.d.ts +8 -2
  44. package/dist/{index-DoWxAfPn.js → index-3hRPEDk5.js} +4 -4
  45. package/dist/{index-DctO0l5q.js → index-BHKOZzg1.js} +1 -1
  46. package/dist/{index-NX_Kd4oz.js → index-BYWSBoej.js} +3 -3
  47. package/dist/{index-genxamHw.js → index-BYWcX6y7.js} +2 -2
  48. package/dist/{index-Dka20zad.js → index-BaS25rA-.js} +2 -2
  49. package/dist/{index-BZgkwoZ5.js → index-BczDLUpv.js} +2 -2
  50. package/dist/{index-BxlF9T05.js → index-Bh0e5MGQ.js} +2 -2
  51. package/dist/{index-CO6rjqWZ.js → index-C3iToWR_.js} +4 -4
  52. package/dist/{index-B635dFQ2.js → index-CNem7pV2.js} +2 -2
  53. package/dist/{index-B_fqzhtm.js → index-Cs5brR68.js} +3 -3
  54. package/dist/{index-D9IW7UEw.js → index-D0E9e2bc.js} +2 -2
  55. package/dist/{index-CXEf_Hel.js → index-D2yo-g20.js} +4 -4
  56. package/dist/{index-1n03jgsr.js → index-DGizXlGr.js} +3 -3
  57. package/dist/{index-CE-4v9ue.js → index-DLZ2_Fhk.js} +3 -3
  58. package/dist/{index-CVN6HOlq.js → index-DbBqHu3d.js} +2 -2
  59. package/dist/{index-B-oGxRVH.js → index-Deq0UIQ5.js} +2 -2
  60. package/dist/{index-8L4OftHM.js → index-Dg0a5ekJ.js} +2 -2
  61. package/dist/{index-yqn8Hbay.js → index-DvcQvaXv.js} +2 -2
  62. package/dist/{index-YkgGwyfx.js → index-ETHoxvZf.js} +2 -2
  63. package/dist/{index-D4kZ3Yip.js → index-na4ea52T.js} +2 -2
  64. package/dist/{index-Bn9RgQrP.js → index-vX7Ua1iM.js} +2 -2
  65. package/dist/index.js +47045 -19954
  66. package/dist/theme/design-media.d.ts +4 -4
  67. package/dist/theme/design-theme.d.ts +1 -5
  68. package/dist/theme/index.d.ts +0 -1
  69. package/dist/translations/en.d.ts +18 -219
  70. package/dist/translations/fr.d.ts +18 -219
  71. package/dist/utils/file.utils.d.ts +2 -2
  72. package/dist/utils/index.d.ts +1 -1
  73. package/dist/utils/notification-target.utils.d.ts +49 -0
  74. package/package.json +8 -22
  75. package/test-results/catalog/.last-run.json +4 -0
  76. package/vite.config.ts +6 -8
  77. package/dist/Tabs-nH2IBqqa.js +0 -1991
  78. package/dist/clsx-OuTLNxxd.js +0 -16
  79. package/dist/design-theme-DtU1zQos.js +0 -27703
  80. package/dist/index-C27b790L.js +0 -3304
  81. package/dist/legacy/components/Avatars/OrganizationAvatar/OrganizationAvatar.component.d.ts +0 -24
  82. package/dist/legacy/components/Avatars/OrganizationAvatar/index.d.ts +0 -2
  83. package/dist/legacy/components/Avatars/ProjectAvatar/ProjectAvatar.component.d.ts +0 -29
  84. package/dist/legacy/components/Avatars/ProjectAvatar/index.d.ts +0 -2
  85. package/dist/legacy/components/Avatars/UserAvatar/UserAvatar.component.d.ts +0 -25
  86. package/dist/legacy/components/Avatars/UserAvatar/constant.d.ts +0 -8
  87. package/dist/legacy/components/Avatars/UserAvatar/index.d.ts +0 -3
  88. package/dist/legacy/components/Avatars/UserAvatarList/UserAvatarList.component.d.ts +0 -18
  89. package/dist/legacy/components/Avatars/UserAvatarList/index.d.ts +0 -2
  90. package/dist/legacy/components/Avatars/index.d.ts +0 -4
  91. package/dist/legacy/components/Banking/AccountTransactions/AccountTransactionsRow.component.d.ts +0 -30
  92. package/dist/legacy/components/Banking/AccountTransactions/index.d.ts +0 -2
  93. package/dist/legacy/components/Banking/Inputs/SelectAccountTransactionCategory/SelectAccountTransactionCategory.component.d.ts +0 -12
  94. package/dist/legacy/components/Banking/Inputs/SelectAccountTransactionCategory/index.d.ts +0 -1
  95. package/dist/legacy/components/Banking/Inputs/index.d.ts +0 -1
  96. package/dist/legacy/components/Banking/index.d.ts +0 -1
  97. package/dist/legacy/components/Cards/InternalProjectCard/InternalProjectCard.component.d.ts +0 -36
  98. package/dist/legacy/components/Cards/InternalProjectCard/index.d.ts +0 -2
  99. package/dist/legacy/components/Cards/ProjectCard/ProjectCard.component.d.ts +0 -28
  100. package/dist/legacy/components/Cards/ProjectCard/index.d.ts +0 -2
  101. package/dist/legacy/components/Cards/index.d.ts +0 -2
  102. package/dist/legacy/components/Charts/AbyssBarChart/AbyssBarChart.component.d.ts +0 -21
  103. package/dist/legacy/components/Charts/AbyssBarChart/index.d.ts +0 -1
  104. package/dist/legacy/components/Charts/AbyssCashFlowChart/AbyssCashFlowChart.component.d.ts +0 -14
  105. package/dist/legacy/components/Charts/AbyssCashFlowChart/index.d.ts +0 -1
  106. package/dist/legacy/components/Charts/AbyssLineChart/AbyssLineChart.component.d.ts +0 -33
  107. package/dist/legacy/components/Charts/AbyssLineChart/index.d.ts +0 -1
  108. package/dist/legacy/components/Charts/AbyssPieChart/AbyssPieChart.component.d.ts +0 -18
  109. package/dist/legacy/components/Charts/AbyssPieChart/index.d.ts +0 -1
  110. package/dist/legacy/components/Charts/index.d.ts +0 -4
  111. package/dist/legacy/components/Charts/useNivoTheme.d.ts +0 -65
  112. package/dist/legacy/components/Chips/ApplicationSentinelTypeChip/ApplicationSentinelTypeChip.component.d.ts +0 -7
  113. package/dist/legacy/components/Chips/ApplicationSentinelTypeChip/index.d.ts +0 -1
  114. package/dist/legacy/components/Chips/LogTypeChip/LogTypeChip.component.d.ts +0 -7
  115. package/dist/legacy/components/Chips/LogTypeChip/index.d.ts +0 -1
  116. package/dist/legacy/components/Chips/ProjectStatusChip/ProjectStatusChip.component.d.ts +0 -7
  117. package/dist/legacy/components/Chips/ProjectStatusChip/index.d.ts +0 -1
  118. package/dist/legacy/components/Chips/WebhookResponseCodeChip/WebhookResponseCodeChip.component.d.ts +0 -6
  119. package/dist/legacy/components/Chips/WebhookResponseCodeChip/index.d.ts +0 -1
  120. package/dist/legacy/components/Chips/index.d.ts +0 -4
  121. package/dist/legacy/components/CommandPalette/AbyssCommandPalette.d.ts +0 -12
  122. package/dist/legacy/components/CommandPalette/index.d.ts +0 -3
  123. package/dist/legacy/components/CommandPalette/types.d.ts +0 -104
  124. package/dist/legacy/components/CommandPalette/useCommandPaletteHotkey.d.ts +0 -10
  125. package/dist/legacy/components/CompanySearchAutocomplete/CompanySearchAutocomplete.d.ts +0 -13
  126. package/dist/legacy/components/CompanySearchAutocomplete/CompanySearchAutocomplete.error.spec.d.ts +0 -1
  127. package/dist/legacy/components/CompanySearchAutocomplete/index.d.ts +0 -2
  128. package/dist/legacy/components/Data/AbyssTable/AbyssTable.component.d.ts +0 -70
  129. package/dist/legacy/components/Data/AbyssTable/AbyssTable.component.spec.d.ts +0 -1
  130. package/dist/legacy/components/Data/AbyssTable/AbyssTableCards.component.d.ts +0 -25
  131. package/dist/legacy/components/Data/AbyssTable/abyss-table.logic.d.ts +0 -147
  132. package/dist/legacy/components/Data/AbyssTable/abyss-table.logic.spec.d.ts +0 -1
  133. package/dist/legacy/components/Data/AbyssTable/index.d.ts +0 -2
  134. package/dist/legacy/components/Data/index.d.ts +0 -1
  135. package/dist/legacy/components/InfoBox/InfoBox.component.d.ts +0 -6
  136. package/dist/legacy/components/InfoBox/index.d.ts +0 -1
  137. package/dist/legacy/components/Inputs/AbyssDatePicker/AbyssDatePicker.component.d.ts +0 -4
  138. package/dist/legacy/components/Inputs/AbyssDatePicker/index.d.ts +0 -1
  139. package/dist/legacy/components/Inputs/AbyssDateTimePicker/AbyssDateTimePicker.component.d.ts +0 -4
  140. package/dist/legacy/components/Inputs/AbyssDateTimePicker/index.d.ts +0 -1
  141. package/dist/legacy/components/Inputs/AbyssNumberField/AbyssNumberField.component.d.ts +0 -35
  142. package/dist/legacy/components/Inputs/AbyssNumberField/format.d.ts +0 -35
  143. package/dist/legacy/components/Inputs/AbyssNumberField/format.spec.d.ts +0 -1
  144. package/dist/legacy/components/Inputs/AbyssNumberField/index.d.ts +0 -2
  145. package/dist/legacy/components/Inputs/AbyssScopeSwitcher/AbyssScopeSwitcher.component.d.ts +0 -21
  146. package/dist/legacy/components/Inputs/AbyssScopeSwitcher/index.d.ts +0 -2
  147. package/dist/legacy/components/Inputs/AbyssScopeSwitcher/scope-option.spec.d.ts +0 -1
  148. package/dist/legacy/components/Inputs/AbyssSelectOrganization/AbyssSelectOrganization.component.d.ts +0 -18
  149. package/dist/legacy/components/Inputs/AbyssSelectOrganization/index.d.ts +0 -2
  150. package/dist/legacy/components/Inputs/AbyssSelectProject/AbyssSelectProject.component.d.ts +0 -18
  151. package/dist/legacy/components/Inputs/AbyssSelectProject/index.d.ts +0 -2
  152. package/dist/legacy/components/Inputs/CloudImport/CloudImport.component.d.ts +0 -17
  153. package/dist/legacy/components/Inputs/CloudImport/CloudImport.component.spec.d.ts +0 -1
  154. package/dist/legacy/components/Inputs/CloudImport/CloudImportFile.component.d.ts +0 -14
  155. package/dist/legacy/components/Inputs/CloudImport/CloudImportFile.component.spec.d.ts +0 -1
  156. package/dist/legacy/components/Inputs/CloudImport/CloudImportFolder.component.d.ts +0 -18
  157. package/dist/legacy/components/Inputs/CloudImport/index.d.ts +0 -3
  158. package/dist/legacy/components/Inputs/ColorPalette/ColorPalette.component.d.ts +0 -23
  159. package/dist/legacy/components/Inputs/ColorPalette/index.d.ts +0 -1
  160. package/dist/legacy/components/Inputs/ColorPicker/ColorPicker.component.d.ts +0 -19
  161. package/dist/legacy/components/Inputs/ColorPicker/index.d.ts +0 -1
  162. package/dist/legacy/components/Inputs/ContextSelector/ContextSelector.component.d.ts +0 -68
  163. package/dist/legacy/components/Inputs/ContextSelector/index.d.ts +0 -2
  164. package/dist/legacy/components/Inputs/DatePeriodPicker/DatePeriodPicker.component.d.ts +0 -60
  165. package/dist/legacy/components/Inputs/DatePeriodPicker/DatePeriodPicker.granularity.spec.d.ts +0 -1
  166. package/dist/legacy/components/Inputs/DatePeriodPicker/DatePeriodPicker.segmented.spec.d.ts +0 -1
  167. package/dist/legacy/components/Inputs/DatePeriodPicker/date-period-i18n.spec.d.ts +0 -1
  168. package/dist/legacy/components/Inputs/DatePeriodPicker/date-period-picker.logic.d.ts +0 -69
  169. package/dist/legacy/components/Inputs/DatePeriodPicker/date-period-picker.logic.spec.d.ts +0 -1
  170. package/dist/legacy/components/Inputs/DatePeriodPicker/date-period-presets.spec.d.ts +0 -1
  171. package/dist/legacy/components/Inputs/DatePeriodPicker/date-period-presets.util.d.ts +0 -15
  172. package/dist/legacy/components/Inputs/DatePeriodPicker/index.d.ts +0 -2
  173. package/dist/legacy/components/Inputs/DropZone/DropZone.component.d.ts +0 -27
  174. package/dist/legacy/components/Inputs/DropZone/DropZone.component.spec.d.ts +0 -1
  175. package/dist/legacy/components/Inputs/DropZone/index.d.ts +0 -1
  176. package/dist/legacy/components/Inputs/LanguageFlagLabel/LanguageFlagLabel.component.d.ts +0 -22
  177. package/dist/legacy/components/Inputs/LanguageFlagLabel/index.d.ts +0 -2
  178. package/dist/legacy/components/Inputs/LanguageFlagLabel/language-flags.d.ts +0 -12
  179. package/dist/legacy/components/Inputs/PasswordInput/PasswordInput.component.d.ts +0 -41
  180. package/dist/legacy/components/Inputs/PasswordInput/index.d.ts +0 -1
  181. package/dist/legacy/components/Inputs/ProjectCategoryBadge/ProjectCategoryBadge.component.d.ts +0 -8
  182. package/dist/legacy/components/Inputs/ProjectCategoryBadge/index.d.ts +0 -1
  183. package/dist/legacy/components/Inputs/ProjectLinkSelector/ProjectLinkSelector.component.d.ts +0 -39
  184. package/dist/legacy/components/Inputs/ProjectLinkSelector/index.d.ts +0 -2
  185. package/dist/legacy/components/Inputs/ProjectTagChip/ProjectTagChip.component.d.ts +0 -9
  186. package/dist/legacy/components/Inputs/ProjectTagChip/index.d.ts +0 -1
  187. package/dist/legacy/components/Inputs/index.d.ts +0 -17
  188. package/dist/legacy/components/Invitations/AbyssPendingInvitations.component.d.ts +0 -18
  189. package/dist/legacy/components/Invitations/index.d.ts +0 -2
  190. package/dist/legacy/components/Layouts/AbyssBillingPlan/AbyssBillingPlan.component.d.ts +0 -11
  191. package/dist/legacy/components/Layouts/AbyssBillingPlan/AbyssBillingPlan.component.spec.d.ts +0 -1
  192. package/dist/legacy/components/Layouts/AbyssBillingPlan/index.d.ts +0 -1
  193. package/dist/legacy/components/Layouts/AbyssDashboardLayout/AbyssDashboardLayout.component.d.ts +0 -13
  194. package/dist/legacy/components/Layouts/AbyssDashboardLayout/index.d.ts +0 -1
  195. package/dist/legacy/components/Layouts/AbyssFamilyBanner/AbyssFamilyBanner.component.d.ts +0 -32
  196. package/dist/legacy/components/Layouts/AbyssFamilyBanner/AbyssFamilyBanner.logic.spec.d.ts +0 -1
  197. package/dist/legacy/components/Layouts/AbyssFamilyBanner/index.d.ts +0 -2
  198. package/dist/legacy/components/Layouts/AbyssHeader/AbyssHeader.component.d.ts +0 -14
  199. package/dist/legacy/components/Layouts/AbyssHeader/AbyssHeader.component.spec.d.ts +0 -1
  200. package/dist/legacy/components/Layouts/AbyssHeader/index.d.ts +0 -1
  201. package/dist/legacy/components/Layouts/AbyssLayoutProvider/AbyssLayoutProvider.component.d.ts +0 -25
  202. package/dist/legacy/components/Layouts/AbyssLayoutProvider/abyss-layout.store.d.ts +0 -27
  203. package/dist/legacy/components/Layouts/AbyssLayoutProvider/index.d.ts +0 -3
  204. package/dist/legacy/components/Layouts/AbyssLoadingScreen/AbyssLoadingScreen.component.d.ts +0 -3
  205. package/dist/legacy/components/Layouts/AbyssLoadingScreen/index.d.ts +0 -1
  206. package/dist/legacy/components/Layouts/AbyssSearchBar/AbyssSearchBar.component.d.ts +0 -8
  207. package/dist/legacy/components/Layouts/AbyssSearchBar/index.d.ts +0 -1
  208. package/dist/legacy/components/Layouts/AbyssSidebar/AbyssSidebar.component.d.ts +0 -35
  209. package/dist/legacy/components/Layouts/AbyssSidebar/AbyssSidebarItem.component.d.ts +0 -9
  210. package/dist/legacy/components/Layouts/AbyssSidebar/index.d.ts +0 -3
  211. package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.d.ts +0 -8
  212. package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.spec.d.ts +0 -1
  213. package/dist/legacy/components/Layouts/AbyssThemeToggle/index.d.ts +0 -1
  214. package/dist/legacy/components/Layouts/DashboardLayout/DashboardLayout.layout.d.ts +0 -19
  215. package/dist/legacy/components/Layouts/DashboardLayout/DashboardLayoutHeader.layout.d.ts +0 -11
  216. package/dist/legacy/components/Layouts/DashboardLayout/index.d.ts +0 -2
  217. package/dist/legacy/components/Layouts/LoadingLayout/LoadingLayout.layout.d.ts +0 -7
  218. package/dist/legacy/components/Layouts/LoadingLayout/index.d.ts +0 -1
  219. package/dist/legacy/components/Layouts/MainLayout/MainLayout.layout.d.ts +0 -9
  220. package/dist/legacy/components/Layouts/MainLayout/index.d.ts +0 -1
  221. package/dist/legacy/components/Layouts/index.d.ts +0 -12
  222. package/dist/legacy/components/Modals/AbyssModal/AbyssModal.component.d.ts +0 -18
  223. package/dist/legacy/components/Modals/AbyssModal/index.d.ts +0 -1
  224. package/dist/legacy/components/Modals/ConfirmModal/ConfirmModal.d.ts +0 -22
  225. package/dist/legacy/components/Modals/ConfirmModal/index.d.ts +0 -2
  226. package/dist/legacy/components/Modals/ImportFromCloudModal/ImportFromCloudModal.component.d.ts +0 -15
  227. package/dist/legacy/components/Modals/ImportFromCloudModal/index.d.ts +0 -1
  228. package/dist/legacy/components/Modals/QRCodeModal/QRCodeModal.component.d.ts +0 -12
  229. package/dist/legacy/components/Modals/QRCodeModal/index.d.ts +0 -1
  230. package/dist/legacy/components/Modals/UserSettingsModal/UserSettings.compat.d.ts +0 -12
  231. package/dist/legacy/components/Modals/UserSettingsModal/UserSettingsModal.component.d.ts +0 -38
  232. package/dist/legacy/components/Modals/UserSettingsModal/index.d.ts +0 -2
  233. package/dist/legacy/components/Modals/UserSettingsModal/user-settings-modal.family.spec.d.ts +0 -1
  234. package/dist/legacy/components/Modals/UserSettingsModal/user-settings-modal.links.spec.d.ts +0 -1
  235. package/dist/legacy/components/Modals/index.d.ts +0 -6
  236. package/dist/legacy/components/QuotaGauge/AbyssQuotaGauge.component.d.ts +0 -53
  237. package/dist/legacy/components/QuotaGauge/bubble-placement.d.ts +0 -47
  238. package/dist/legacy/components/QuotaGauge/bubble-placement.spec.d.ts +0 -1
  239. package/dist/legacy/components/QuotaGauge/gauge-highlight.spec.d.ts +0 -1
  240. package/dist/legacy/components/QuotaGauge/gauge-i18n-coverage.spec.d.ts +0 -1
  241. package/dist/legacy/components/QuotaGauge/gauge-segments.d.ts +0 -80
  242. package/dist/legacy/components/QuotaGauge/gauge-segments.spec.d.ts +0 -1
  243. package/dist/legacy/components/QuotaGauge/index.d.ts +0 -6
  244. package/dist/legacy/components/QuotaOffer/AbyssQuotaOffer.component.d.ts +0 -83
  245. package/dist/legacy/components/QuotaOffer/AbyssQuotaOffer.component.spec.d.ts +0 -1
  246. package/dist/legacy/components/QuotaOffer/index.d.ts +0 -4
  247. package/dist/legacy/components/QuotaOffer/quota-phrase-coverage.spec.d.ts +0 -1
  248. package/dist/legacy/components/QuotaReached/QuotaReachedDialog.component.d.ts +0 -15
  249. package/dist/legacy/components/QuotaReached/index.d.ts +0 -3
  250. package/dist/legacy/components/QuotaReached/quota-service-meta.d.ts +0 -31
  251. package/dist/legacy/components/Spotlight/InternalProjectCard/InternalProjectCard.component.d.ts +0 -15
  252. package/dist/legacy/components/Spotlight/InternalProjectCard/index.d.ts +0 -1
  253. package/dist/legacy/components/Spotlight/ProjectCard/ProjectCard.component.d.ts +0 -20
  254. package/dist/legacy/components/Spotlight/ProjectCard/index.d.ts +0 -1
  255. package/dist/legacy/components/Spotlight/ProjectCategoryBadge/ProjectCategoryBadge.component.d.ts +0 -7
  256. package/dist/legacy/components/Spotlight/ProjectCategoryBadge/index.d.ts +0 -1
  257. package/dist/legacy/components/Spotlight/ProjectLinkSelector/ProjectLinkSelector.component.d.ts +0 -10
  258. package/dist/legacy/components/Spotlight/ProjectLinkSelector/ProjectLinkSelector.component.spec.d.ts +0 -1
  259. package/dist/legacy/components/Spotlight/ProjectLinkSelector/index.d.ts +0 -2
  260. package/dist/legacy/components/Spotlight/ProjectTagChip/ProjectTagChip.component.d.ts +0 -9
  261. package/dist/legacy/components/Spotlight/ProjectTagChip/index.d.ts +0 -1
  262. package/dist/legacy/components/Spotlight/index.d.ts +0 -5
  263. package/dist/legacy/components/Utils/AbyssBackground/AbyssBackground.component.d.ts +0 -12
  264. package/dist/legacy/components/Utils/AbyssDrawer/AbyssDrawer.component.d.ts +0 -39
  265. package/dist/legacy/components/Utils/AbyssDrawer/index.d.ts +0 -2
  266. package/dist/legacy/components/Utils/AbyssErrorPage/AbyssErrorBoundary.component.d.ts +0 -10
  267. package/dist/legacy/components/Utils/AbyssErrorPage/AbyssErrorBoundary.component.spec.d.ts +0 -1
  268. package/dist/legacy/components/Utils/AbyssErrorPage/AbyssErrorPage.component.d.ts +0 -11
  269. package/dist/legacy/components/Utils/AbyssErrorPage/index.d.ts +0 -3
  270. package/dist/legacy/components/Utils/AbyssFamilyMenuSection/AbyssFamilyMenuSection.d.ts +0 -6
  271. package/dist/legacy/components/Utils/AbyssFamilyMenuSection/AbyssFamilyMenuSection.spec.d.ts +0 -1
  272. package/dist/legacy/components/Utils/AbyssFamilyMenuSection/index.d.ts +0 -1
  273. package/dist/legacy/components/Utils/AbyssHeaderTitle/AbyssHeaderTitle.component.d.ts +0 -11
  274. package/dist/legacy/components/Utils/AbyssHeaderTitle/index.d.ts +0 -1
  275. package/dist/legacy/components/Utils/AbyssLayoutMenu/AbyssLayoutMenu.component.d.ts +0 -43
  276. package/dist/legacy/components/Utils/AbyssLayoutMenu/AbyssLayoutMenu.component.spec.d.ts +0 -1
  277. package/dist/legacy/components/Utils/AbyssLayoutMenu/AbyssMenuItem.component.d.ts +0 -15
  278. package/dist/legacy/components/Utils/AbyssLayoutMenu/index.d.ts +0 -3
  279. package/dist/legacy/components/Utils/AbyssLayoutNotifications/AbyssLayoutNotifications.component.d.ts +0 -36
  280. package/dist/legacy/components/Utils/AbyssLayoutNotifications/AbyssLayoutNotifications.component.spec.d.ts +0 -1
  281. package/dist/legacy/components/Utils/AbyssLayoutNotifications/AbyssNotifications.component.d.ts +0 -30
  282. package/dist/legacy/components/Utils/AbyssLayoutNotifications/AbyssNotifications.component.spec.d.ts +0 -1
  283. package/dist/legacy/components/Utils/AbyssLayoutNotifications/index.d.ts +0 -4
  284. package/dist/legacy/components/Utils/ImportButton/ImportButton.component.d.ts +0 -19
  285. package/dist/legacy/components/Utils/ImportButton/index.d.ts +0 -2
  286. package/dist/legacy/components/Utils/WaterParticles/WaterParticles.component.d.ts +0 -14
  287. package/dist/legacy/components/Utils/WaterParticles/index.d.ts +0 -1
  288. package/dist/legacy/components/Utils/index.d.ts +0 -10
  289. package/dist/legacy/components/aria-labels-i18n.spec.d.ts +0 -1
  290. package/dist/legacy/components/commons-labels-i18n.spec.d.ts +0 -1
  291. package/dist/legacy/components/index.d.ts +0 -18
  292. package/dist/legacy/components/theme-mode-colors.spec.d.ts +0 -1
  293. package/dist/legacy/fonts.css +0 -7
  294. package/dist/legacy/hooks/confirm-modal/confirm-modal.context.d.ts +0 -10
  295. package/dist/legacy/hooks/confirm-modal/index.d.ts +0 -1
  296. package/dist/legacy/hooks/index.d.ts +0 -1
  297. package/dist/legacy/index.d.ts +0 -4
  298. package/dist/legacy/legacy-editors-removed.spec.d.ts +0 -1
  299. package/dist/legacy/legacy-support-removed.spec.d.ts +0 -1
  300. package/dist/legacy/legacy-under-new-theme.spec.d.ts +0 -1
  301. package/dist/legacy/theme/augmentation.d.ts +0 -84
  302. package/dist/legacy/theme/components/buttons.d.ts +0 -35
  303. package/dist/legacy/theme/components/data-display.d.ts +0 -4
  304. package/dist/legacy/theme/components/index.d.ts +0 -2
  305. package/dist/legacy/theme/components/inputs.d.ts +0 -4
  306. package/dist/legacy/theme/components/inputs.spec.d.ts +0 -1
  307. package/dist/legacy/theme/components/navigation.d.ts +0 -4
  308. package/dist/legacy/theme/components/surfaces.d.ts +0 -4
  309. package/dist/legacy/theme/core-breakpoints-under-legacy-theme.spec.d.ts +0 -1
  310. package/dist/legacy/theme/create-theme.d.ts +0 -9
  311. package/dist/legacy/theme/create-theme.spec.d.ts +0 -1
  312. package/dist/legacy/theme/disabled-contrast.spec.d.ts +0 -1
  313. package/dist/legacy/theme/index.d.ts +0 -23
  314. package/dist/legacy/theme/legacy-tokens.d.ts +0 -3
  315. package/dist/legacy/theme/new-components-under-legacy-theme.spec.d.ts +0 -1
  316. package/dist/legacy/theme/palettes/common.d.ts +0 -74
  317. package/dist/legacy/theme/palettes/dark.d.ts +0 -67
  318. package/dist/legacy/theme/palettes/light.d.ts +0 -67
  319. package/dist/legacy/theme/tokens/animations.d.ts +0 -33
  320. package/dist/legacy/theme/tokens/borders.d.ts +0 -14
  321. package/dist/legacy/theme/tokens/colors.d.ts +0 -129
  322. package/dist/legacy/theme/tokens/shadows.d.ts +0 -53
  323. package/dist/legacy/theme/tokens/transitions.d.ts +0 -25
  324. package/dist/legacy/theme/tokens/typography.d.ts +0 -99
  325. package/dist/legacy/utils/billing-colors.utils.d.ts +0 -7
  326. package/dist/legacy/utils/color.utils.d.ts +0 -11
  327. package/dist/legacy/utils/file.utils.d.ts +0 -2
  328. package/dist/legacy/utils/index.d.ts +0 -3
  329. package/dist/legacy.d.ts +0 -2
  330. package/dist/legacy.js +0 -16282
  331. package/dist/theme/DesignCssVariables.d.ts +0 -12
  332. package/dist/theme/DesignCssVariables.spec.d.ts +0 -1
  333. package/dist/utils/share-notification.utils.d.ts +0 -10
  334. /package/dist/{legacy/components/Cards/project-card-date.spec.d.ts → components/business/AbyssProjectLinkField/AbyssProjectLinkField.spec.d.ts} +0 -0
  335. /package/dist/{legacy/components/Charts/AbyssCashFlowChart/AbyssCashFlowChart.component.spec.d.ts → components/business/PendingInvitations/PendingInvitations.spec.d.ts} +0 -0
  336. /package/dist/{legacy/components/Charts/AbyssLineChart/AbyssLineChart.component.spec.d.ts → components/mobile/MobileShell/MobileShellActionBar.spec.d.ts} +0 -0
  337. /package/dist/{legacy/components/CompanySearchAutocomplete/CompanySearchAutocomplete.date.spec.d.ts → utils/notification-target.utils.spec.d.ts} +0 -0
@@ -1,1991 +0,0 @@
1
- import { jsxs as C, jsx as i, Fragment as J } from "react/jsx-runtime";
2
- import { useId as N, cloneElement as mn, useState as F, useMemo as ge, useRef as X, useCallback as Q, useEffect as V, createContext as ze, useContext as Ae, useLayoutEffect as Le } from "react";
3
- import le from "@mui/material/FormControl";
4
- import se from "@mui/material/FormHelperText";
5
- import $e from "@mui/material/InputLabel";
6
- import Ce from "@mui/material/MenuItem";
7
- import hn from "@mui/material/Select";
8
- import { styled as l, useTheme as bn, getContrastRatio as ke } from "@mui/material/styles";
9
- import { visuallyHidden as fe } from "@mui/utils";
10
- import { useIntl as P } from "react-intl";
11
- import { a as A, p as o, h as D, d as Z, D as K, g as yn, t as De, s as de, i as oe, j as te, c as Pe, e as He, k as vn, B as wn } from "./Surface-B74cXq1M.js";
12
- import { i as xn, b as Cn, r as kn, u as Sn, A as In, E as Fn } from "./index-C27b790L.js";
13
- import Y from "@mui/material/Button";
14
- import { byteSizeIEC as Wn } from "@abyss-project/main";
15
- import Mn from "@mui/icons-material/FileUploadOutlined";
16
- import On, { autocompleteClasses as Se } from "@mui/material/Autocomplete";
17
- import Ie from "@mui/material/CircularProgress";
18
- import ae from "@mui/material/IconButton";
19
- import me from "@mui/material/OutlinedInput";
20
- import Fe from "@mui/material/Tooltip";
21
- import We from "@mui/icons-material/CloudOutlined";
22
- import Tn from "@mui/icons-material/CloudOffOutlined";
23
- import Rn from "@mui/icons-material/FileDownloadOutlined";
24
- import Ne from "@mui/icons-material/FolderOpenOutlined";
25
- import En from "@mui/icons-material/OpenInNewRounded";
26
- import zn from "@mui/icons-material/RefreshRounded";
27
- import An from "@mui/icons-material/CheckCircleOutline";
28
- import _e from "@mui/icons-material/Close";
29
- import Ln from "@mui/icons-material/ErrorOutline";
30
- import $n from "@mui/icons-material/InfoOutlined";
31
- import Dn from "@mui/icons-material/WarningAmber";
32
- import Pn from "@mui/material/Checkbox";
33
- import Hn from "@mui/icons-material/DescriptionOutlined";
34
- import Nn from "@mui/icons-material/FolderOutlined";
35
- import _n from "@mui/icons-material/ChevronRightRounded";
36
- import Bn from "@mui/material/Alert";
37
- import Vn from "@mui/material/TextField";
38
- import jn from "@mui/material/Popover";
39
- import Gn, { formLabelClasses as qn } from "@mui/material/FormLabel";
40
- import Un from "@mui/material/InputAdornment";
41
- import { isMuiElement as Kn } from "@mui/material/utils";
42
- import Be from "@mui/material/ButtonBase";
43
- import { Link as Xn } from "react-router-dom";
44
- const Yn = l(Gn)(({ theme: e }) => ({
45
- display: "block",
46
- maxWidth: "100%",
47
- marginBottom: o(e.design.space[2]),
48
- fontSize: o(e.design.typeScale.small),
49
- fontWeight: A.medium,
50
- lineHeight: e.typography.caption.lineHeight,
51
- color: e.design.tokens["text.secondary"],
52
- "&.Mui-focused": { color: e.design.tokens["text.secondary"] },
53
- "&.Mui-error": { color: e.design.tokens["status.danger"] },
54
- "&.Mui-disabled": { color: e.design.tokens["text.muted"] }
55
- }));
56
- function Ve({
57
- label: e,
58
- help: t,
59
- error: n,
60
- required: r = !1,
61
- children: a
62
- }) {
63
- const u = N(), s = a.props.id ?? u, d = `${s}-label`, g = t !== void 0 ? `${s}-help` : void 0, h = n != null && n !== !1 && n !== "", b = h && n !== !0, m = b ? `${s}-error` : void 0, f = [a.props["aria-describedby"], g, m].filter((c) => c !== void 0 && c !== "").join(" ") || void 0, w = mn(a, {
64
- id: s,
65
- "aria-describedby": f,
66
- ...Kn(a, ["Select"]) && { labelId: d }
67
- });
68
- return /* @__PURE__ */ C(le, { fullWidth: !0, error: h, required: r, children: [
69
- /* @__PURE__ */ i(Yn, { id: d, htmlFor: s, children: e }),
70
- w,
71
- t !== void 0 && /* @__PURE__ */ i(se, { id: g, error: !1, children: t }),
72
- b && /* @__PURE__ */ i(se, { id: m, children: n })
73
- ] });
74
- }
75
- var je = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Danger = "danger", e))(je || {});
76
- const Ge = {
77
- info: { solid: "status.info", soft: "status.info.soft" },
78
- success: {
79
- solid: "status.success",
80
- soft: "status.success.soft"
81
- },
82
- warning: {
83
- solid: "status.warning",
84
- soft: "status.warning.soft"
85
- },
86
- danger: {
87
- solid: "status.danger",
88
- soft: "status.danger.soft"
89
- }
90
- }, Qn = {
91
- info: $n,
92
- success: An,
93
- warning: Dn,
94
- danger: Ln
95
- }, Zn = l("div", {
96
- shouldForwardProp: (e) => e !== "severity"
97
- })(({ theme: e, severity: t }) => {
98
- const { tokens: n, space: r, radii: a, fonts: u, typeScale: s } = e.design, { solid: d, soft: g } = Ge[t];
99
- return {
100
- display: "flex",
101
- alignItems: "flex-start",
102
- gap: o(r[3]),
103
- minWidth: 0,
104
- boxSizing: "border-box",
105
- padding: `${o(r[3])} ${o(r[3])} ${o(r[3])} ${o(r[4])}`,
106
- backgroundColor: n[g],
107
- border: D(n[d]),
108
- borderRadius: o(a.md),
109
- color: n["text.primary"],
110
- fontFamily: u.sans,
111
- fontSize: o(s.body)
112
- };
113
- }), Jn = l("span", {
114
- shouldForwardProp: (e) => e !== "severity"
115
- })(({ theme: e, severity: t }) => {
116
- const { tokens: n, space: r } = e.design;
117
- return {
118
- display: "inline-flex",
119
- flex: "none",
120
- // Centered on the first line of text.
121
- paddingTop: o(r[1] / 2),
122
- color: n[Ge[t].solid],
123
- "& svg": {
124
- width: o(r[4] + r[1]),
125
- height: o(r[4] + r[1])
126
- }
127
- };
128
- }), et = l("div")(({ theme: e }) => ({
129
- display: "flex",
130
- flex: "1 1 auto",
131
- flexWrap: "wrap",
132
- alignItems: "center",
133
- columnGap: o(e.design.space[4]),
134
- rowGap: o(e.design.space[2]),
135
- minWidth: 0,
136
- [Z.down(K.Tablet)]: {
137
- flexDirection: "column",
138
- alignItems: "flex-start"
139
- }
140
- })), nt = l("div")(({ theme: e }) => ({
141
- display: "flex",
142
- flexDirection: "column",
143
- gap: o(e.design.space[1]),
144
- flex: "1 1 auto",
145
- minWidth: 0,
146
- // In the column layout of a narrow screen, `alignItems: flex-start` sizes the text to its content.
147
- maxWidth: "100%",
148
- paddingTop: o(e.design.space[1] / 2),
149
- lineHeight: e.typography.body2.lineHeight,
150
- overflowWrap: "anywhere"
151
- })), tt = l("div")({
152
- minWidth: 0,
153
- "& pre": {
154
- maxWidth: "100%",
155
- overflowX: "auto"
156
- }
157
- }), ot = l("strong")({
158
- display: "block",
159
- fontWeight: A.semibold
160
- }), rt = l("div")({
161
- display: "flex",
162
- flex: "none",
163
- alignItems: "center"
164
- }), it = l(ae)(({ theme: e }) => yn(e));
165
- function st({
166
- severity: e,
167
- title: t,
168
- children: n,
169
- action: r,
170
- onClose: a,
171
- icon: u
172
- }) {
173
- const s = P(), d = N(), g = Qn[e];
174
- return /* @__PURE__ */ C(
175
- Zn,
176
- {
177
- severity: e,
178
- role: e === "danger" ? "alert" : "status",
179
- "aria-labelledby": t !== void 0 ? d : void 0,
180
- "data-severity": e,
181
- children: [
182
- /* @__PURE__ */ i(Jn, { severity: e, "aria-hidden": !0, children: u ?? /* @__PURE__ */ i(g, {}) }),
183
- /* @__PURE__ */ C(et, { children: [
184
- /* @__PURE__ */ C(nt, { children: [
185
- t !== void 0 && /* @__PURE__ */ i(ot, { id: d, children: t }),
186
- /* @__PURE__ */ i(tt, { children: n })
187
- ] }),
188
- r !== void 0 && /* @__PURE__ */ i(rt, { children: r })
189
- ] }),
190
- a !== void 0 && /* @__PURE__ */ i(
191
- it,
192
- {
193
- size: "small",
194
- "aria-label": s.formatMessage({ id: "ds.states.callout.close" }),
195
- onClick: a,
196
- children: /* @__PURE__ */ i(_e, { "aria-hidden": !0 })
197
- }
198
- )
199
- ]
200
- }
201
- );
202
- }
203
- const U = (e) => e.id ?? e.name, qe = (e, t, n) => (t === void 0 || e.sizeOctet <= t) && xn(e, n), Ue = (e, t, n) => [
204
- ...(e.childFile ?? []).filter(
205
- (r) => qe(r, t, n)
206
- ),
207
- ...(e.childFolder ?? []).flatMap(
208
- (r) => Ue(r, t, n)
209
- )
210
- ], ue = l("div", {
211
- shouldForwardProp: (e) => e !== "selected"
212
- })(({ theme: e, selected: t }) => {
213
- const { tokens: n, space: r, radii: a, densityValues: u, density: s, typeScale: d } = e.design;
214
- return {
215
- display: "flex",
216
- alignItems: "center",
217
- gap: o(r[1]),
218
- minHeight: o(u[s].control),
219
- borderRadius: o(a.md),
220
- backgroundColor: t ? de(n.accent) : "transparent",
221
- fontSize: o(d.body),
222
- color: n["text.primary"],
223
- ...De(e)
224
- };
225
- }), Ke = (e) => {
226
- const { tokens: t, space: n, radii: r, fonts: a } = e.design;
227
- return {
228
- flex: "1 1 auto",
229
- minWidth: 0,
230
- display: "flex",
231
- alignItems: "center",
232
- gap: o(n[2]),
233
- alignSelf: "stretch",
234
- margin: 0,
235
- padding: `0 ${o(n[2])}`,
236
- border: "none",
237
- borderRadius: o(r.md),
238
- background: "none",
239
- color: "inherit",
240
- font: "inherit",
241
- fontFamily: a.sans,
242
- textAlign: "left",
243
- cursor: "pointer",
244
- transition: oe(e, ["background-color"]),
245
- "&:hover": { backgroundColor: t["bg.hover"] },
246
- "&:focus-visible": te(e)
247
- };
248
- }, Xe = l("button")(({ theme: e }) => Ke(e)), at = l("label")(({ theme: e }) => Ke(e)), Ye = l("span", {
249
- shouldForwardProp: (e) => e !== "strong"
250
- })(({ strong: e }) => ({
251
- flex: "1 1 auto",
252
- minWidth: 0,
253
- overflow: "hidden",
254
- textOverflow: "ellipsis",
255
- whiteSpace: "nowrap",
256
- fontWeight: e ? A.medium : A.regular
257
- })), Qe = l("span")(({ theme: e }) => {
258
- const { tokens: t, space: n, radii: r } = e.design;
259
- return {
260
- display: "inline-flex",
261
- flex: "none",
262
- alignItems: "center",
263
- justifyContent: "center",
264
- width: o(n[5]),
265
- height: o(n[5]),
266
- overflow: "hidden",
267
- borderRadius: o(r.sm),
268
- color: t["text.muted"],
269
- "& svg": { width: o(n[5]), height: o(n[5]) },
270
- "& img": { width: "100%", height: "100%", objectFit: "cover" }
271
- };
272
- }), lt = l(_n, {
273
- shouldForwardProp: (e) => e !== "open"
274
- })(({ theme: e, open: t }) => ({
275
- flex: "none",
276
- width: o(e.design.space[4]),
277
- height: o(e.design.space[4]),
278
- color: e.design.tokens["text.muted"],
279
- transform: t ? "rotate(90deg)" : "none",
280
- transition: oe(e, ["transform"])
281
- })), Ze = l(Pn)(({ theme: e }) => ({
282
- [Z.down(K.Tablet)]: {
283
- padding: o(
284
- (e.design.densityValues.touchTarget - e.design.space[5]) / 2
285
- )
286
- }
287
- })), dt = l("ul")(({ theme: e }) => ({
288
- margin: 0,
289
- padding: 0,
290
- listStyle: "none",
291
- borderLeft: D(e.design.tokens["border.subtle"]),
292
- marginLeft: o(e.design.space[3])
293
- })), Me = l("li")({ listStyle: "none" });
294
- function Je({
295
- folders: e,
296
- files: t,
297
- context: n
298
- }) {
299
- return /* @__PURE__ */ C(J, { children: [
300
- e.map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(pt, { folder: r, context: n }) }, r.id ?? r.name)),
301
- t.filter((r) => qe(r, n.maxSize, n.accept)).map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(ut, { file: r, context: n }) }, U(r)))
302
- ] });
303
- }
304
- function ct({
305
- file: e,
306
- getFileThumbnailUrl: t
307
- }) {
308
- const [n, r] = F(!1), a = e.thumbnailPublicAccessId !== null && !e.isEncrypt && !n ? t(e.thumbnailPublicAccessId) : null;
309
- return /* @__PURE__ */ i(Qe, { "aria-hidden": !0, children: a !== null ? /* @__PURE__ */ i(
310
- "img",
311
- {
312
- src: a,
313
- alt: "",
314
- draggable: !1,
315
- onError: () => r(!0)
316
- }
317
- ) : /* @__PURE__ */ i(Hn, {}) });
318
- }
319
- function ut({
320
- file: e,
321
- context: t
322
- }) {
323
- const n = N(), r = t.selectedIds.has(U(e)), a = () => r ? t.unselect([e]) : t.select([e]), u = /* @__PURE__ */ C(J, { children: [
324
- /* @__PURE__ */ i(
325
- ct,
326
- {
327
- file: e,
328
- getFileThumbnailUrl: t.getFileThumbnailUrl
329
- }
330
- ),
331
- /* @__PURE__ */ i(Ye, { strong: r, title: e.name, children: e.name })
332
- ] });
333
- return t.multiple ? /* @__PURE__ */ C(ue, { selected: r, children: [
334
- /* @__PURE__ */ i(
335
- Ze,
336
- {
337
- id: n,
338
- size: "small",
339
- checked: r,
340
- onChange: a
341
- }
342
- ),
343
- /* @__PURE__ */ i(at, { htmlFor: n, children: u })
344
- ] }) : /* @__PURE__ */ i(ue, { selected: r, children: /* @__PURE__ */ i(Xe, { type: "button", "aria-pressed": r, onClick: a, children: u }) });
345
- }
346
- function pt({
347
- folder: e,
348
- context: t
349
- }) {
350
- const n = P(), r = N(), [a, u] = F(!1), s = Ue(e, t.maxSize, t.accept), d = s.filter(
351
- (h) => t.selectedIds.has(U(h))
352
- ).length, g = s.length > 0 && d === s.length;
353
- return /* @__PURE__ */ C(J, { children: [
354
- /* @__PURE__ */ C(ue, { selected: g, children: [
355
- t.multiple && /* @__PURE__ */ i(
356
- Ze,
357
- {
358
- size: "small",
359
- checked: g,
360
- indeterminate: d > 0 && !g,
361
- disabled: s.length === 0,
362
- onChange: () => g ? t.unselect(s) : t.select(s),
363
- inputProps: {
364
- "aria-label": n.formatMessage(
365
- { id: "ds.business.cloud-import.select-folder" },
366
- { name: e.name }
367
- )
368
- }
369
- }
370
- ),
371
- /* @__PURE__ */ C(
372
- Xe,
373
- {
374
- type: "button",
375
- "aria-expanded": a,
376
- "aria-controls": a ? r : void 0,
377
- onClick: () => u(!a),
378
- children: [
379
- /* @__PURE__ */ i(lt, { open: a, "aria-hidden": !0 }),
380
- /* @__PURE__ */ i(Qe, { "aria-hidden": !0, children: a ? /* @__PURE__ */ i(Ne, {}) : /* @__PURE__ */ i(Nn, {}) }),
381
- /* @__PURE__ */ i(Ye, { strong: g, title: e.name, children: e.name })
382
- ]
383
- }
384
- )
385
- ] }),
386
- a && /* @__PURE__ */ i(dt, { id: r, children: /* @__PURE__ */ i(
387
- Je,
388
- {
389
- folders: e.childFolder ?? [],
390
- files: e.childFile ?? [],
391
- context: t
392
- }
393
- ) })
394
- ] });
395
- }
396
- const Oe = "shared", Te = {
397
- "org-common": 0,
398
- "perso-in-org": 1,
399
- project: 2,
400
- personal: 3
401
- }, gt = l("div")(({ theme: e }) => ({
402
- display: "flex",
403
- flexDirection: "column",
404
- gap: o(e.design.space[3]),
405
- minWidth: 0
406
- })), ft = l("div")(({ theme: e }) => ({
407
- display: "flex",
408
- alignItems: "flex-end",
409
- gap: o(e.design.space[2]),
410
- minWidth: 0,
411
- // The Space field takes the room the two icon buttons leave.
412
- [`& > .${Se.root}`]: { flex: "1 1 auto", minWidth: 0 },
413
- [`& > :not(.${Se.root})`]: { flex: "none" }
414
- })), mt = l("p")(({ theme: e }) => ({
415
- margin: 0,
416
- fontSize: o(e.design.typeScale.small),
417
- color: e.design.tokens["text.muted"]
418
- })), ht = l("ul")(({ theme: e }) => {
419
- const { tokens: t, space: n, radii: r } = e.design;
420
- return {
421
- margin: 0,
422
- padding: o(n[1]),
423
- listStyle: "none",
424
- minHeight: o(n[10] * 3),
425
- border: D(t["border.subtle"]),
426
- borderRadius: o(r.md)
427
- };
428
- }), ne = l("div")(({ theme: e }) => {
429
- const { tokens: t, space: n, typeScale: r } = e.design;
430
- return {
431
- display: "flex",
432
- flexDirection: "column",
433
- alignItems: "center",
434
- justifyContent: "center",
435
- gap: o(n[3]),
436
- minHeight: o(n[10] * 3),
437
- padding: o(n[5]),
438
- textAlign: "center",
439
- fontSize: o(r.body),
440
- color: t["text.secondary"],
441
- "& > svg": {
442
- width: o(n[7]),
443
- height: o(n[7]),
444
- color: t["text.muted"]
445
- }
446
- };
447
- }), bt = l("span")(({ theme: e }) => {
448
- const { tokens: t, space: n, radii: r } = e.design;
449
- return {
450
- display: "inline-flex",
451
- alignItems: "center",
452
- justifyContent: "center",
453
- width: o(n[9] + n[2]),
454
- height: o(n[9] + n[2]),
455
- borderRadius: o(r.lg),
456
- backgroundColor: de(t["status.warning"]),
457
- color: t["status.warning"],
458
- "& svg": { width: o(n[6]), height: o(n[6]) }
459
- };
460
- }), yt = l("p")(({ theme: e }) => ({
461
- margin: 0,
462
- fontWeight: A.semibold,
463
- color: e.design.tokens["text.primary"]
464
- })), vt = l("p")({ margin: 0 }), wt = l("div")(({ theme: e }) => ({
465
- display: "flex",
466
- flexWrap: "wrap",
467
- alignItems: "center",
468
- justifyContent: "space-between",
469
- gap: o(e.design.space[3])
470
- })), xt = l("span")(({ theme: e }) => ({
471
- fontSize: o(e.design.typeScale.body),
472
- color: e.design.tokens["text.secondary"]
473
- })), Ct = l("li")(({ theme: e }) => ({
474
- display: "flex",
475
- alignItems: "center",
476
- gap: o(e.design.space[2]),
477
- ...De(e)
478
- })), kt = l("span")({
479
- display: "flex",
480
- flexDirection: "column",
481
- minWidth: 0
482
- }), St = l("span")({
483
- overflow: "hidden",
484
- textOverflow: "ellipsis",
485
- whiteSpace: "nowrap"
486
- }), It = l("span")(({ theme: e }) => ({
487
- fontSize: o(e.design.typeScale.caption),
488
- color: e.design.tokens["text.muted"],
489
- // A narrow screen wraps it: the scope and the organization tell same-named Spaces apart.
490
- overflowWrap: "anywhere"
491
- })), en = l("span")(({ theme: e }) => {
492
- const { tokens: t, space: n, radii: r } = e.design;
493
- return {
494
- display: "inline-flex",
495
- flex: "none",
496
- alignItems: "center",
497
- justifyContent: "center",
498
- minWidth: o(n[5]),
499
- height: o(n[5]),
500
- borderRadius: o(r.sm),
501
- color: t["accent.text"],
502
- "& > svg": { width: o(n[4]), height: o(n[4]) }
503
- };
504
- }), Ft = l(en)(({ theme: e }) => ({
505
- marginRight: o(e.design.space[2])
506
- })), Wt = l("li")({ listStyle: "none" }), Mt = l("div")(({ theme: e }) => {
507
- const { space: t, tokens: n, typeScale: r } = e.design;
508
- return {
509
- padding: `${o(t[2])} ${o(t[3])} ${o(t[1])}`,
510
- fontSize: o(r.caption),
511
- fontWeight: A.semibold,
512
- letterSpacing: "0.05em",
513
- textTransform: "uppercase",
514
- color: n["text.muted"]
515
- };
516
- }), Ot = l("ul")({ margin: 0, padding: 0 });
517
- function Tt({
518
- cloudPicker: e,
519
- onImport: t,
520
- multiple: n = !1,
521
- maxSize: r,
522
- accept: a
523
- }) {
524
- const {
525
- abyssCloudUrl: u,
526
- getFileThumbnailUrl: s,
527
- getSpaceDisplay: d,
528
- clouds: g,
529
- cloudShares: h,
530
- isLoading: b,
531
- hasError: m,
532
- refresh: f,
533
- onCreateCloud: w,
534
- fetchCloudRepository: c
535
- } = e, p = P(), [y, v] = F(null), [W, M] = F(null), [O, S] = F(
536
- "loading"
537
- /* Loading */
538
- ), [T, z] = F([]), [R, ee] = F(!1), [re, _] = F(!1), j = ge(() => {
539
- const x = [], I = /* @__PURE__ */ new Map(), k = p.formatMessage({
540
- id: "ds.business.cloud-import.section-organization"
541
- });
542
- for (const E of g ?? []) {
543
- if (!E.organizationId) {
544
- x.push(E);
545
- continue;
546
- }
547
- const $ = d == null ? void 0 : d(E), B = I.get(E.organizationId) ?? {
548
- name: ($ == null ? void 0 : $.organizationName) ?? k,
549
- items: []
550
- };
551
- B.items.push(E), I.set(E.organizationId, B);
552
- }
553
- if (d)
554
- for (const E of I.values())
555
- E.items.sort(($, B) => {
556
- const L = Te[d($).scope ?? "personal"], xe = Te[d(B).scope ?? "personal"];
557
- return L !== xe ? L - xe : d($).label.localeCompare(d(B).label);
558
- });
559
- const H = (E, $) => (B) => {
560
- const L = d == null ? void 0 : d(B);
561
- return {
562
- space: B,
563
- sectionKey: E,
564
- sectionLabel: $,
565
- label: (L == null ? void 0 : L.label) ?? kn(B, p),
566
- subtitle: L == null ? void 0 : L.subtitle,
567
- avatar: L == null ? void 0 : L.avatar
568
- };
569
- };
570
- return [
571
- ...x.map(
572
- H(
573
- "personal",
574
- p.formatMessage({
575
- id: "ds.business.cloud-import.section-personal"
576
- })
577
- )
578
- ),
579
- ...[...I].flatMap(
580
- ([E, $]) => $.items.map(H(`org:${E}`, $.name))
581
- ),
582
- ...(h ?? []).map(
583
- H(
584
- Oe,
585
- p.formatMessage({ id: "ds.business.cloud-import.section-shared" })
586
- )
587
- )
588
- ];
589
- }, [g, h, d, p]), G = j.find((x) => x.space.id === (y == null ? void 0 : y.id)) ?? null, ce = X(0), he = X(c);
590
- he.current = c;
591
- const ie = Q(async (x) => {
592
- const I = ++ce.current;
593
- S(
594
- "loading"
595
- /* Loading */
596
- ), z([]);
597
- try {
598
- if (x.id === void 0)
599
- throw new Error("A Space without an id has no tree");
600
- const k = await he.current(x.id);
601
- I === ce.current && (M(k), S(
602
- "ready"
603
- /* Ready */
604
- ));
605
- } catch {
606
- I === ce.current && S(
607
- "failed"
608
- /* Failed */
609
- );
610
- }
611
- }, []), dn = X(f);
612
- V(() => {
613
- dn.current();
614
- }, []), V(() => {
615
- if (y && j.some((k) => k.space.id === y.id))
616
- return;
617
- const x = j.map((k) => k.space), I = x.find(
618
- (k) => !!k.userId && !k.organizationId && !k.projectId
619
- );
620
- v(I ?? x[0] ?? null);
621
- }, [j, y]), V(() => {
622
- y && ie(y);
623
- }, [y, ie]);
624
- const cn = async () => {
625
- if (_(!1), !await f()) {
626
- _(!0);
627
- return;
628
- }
629
- y && await ie(y);
630
- }, un = async () => {
631
- ee(!0);
632
- try {
633
- await w();
634
- } finally {
635
- ee(!1);
636
- }
637
- }, pn = {
638
- multiple: n,
639
- maxSize: r,
640
- accept: a,
641
- selectedIds: new Set(T.map(U)),
642
- getFileThumbnailUrl: s,
643
- select: (x) => z((I) => {
644
- if (!n)
645
- return x.slice(0, 1);
646
- const k = new Set(I.map(U));
647
- return [
648
- ...I,
649
- ...x.filter((H) => !k.has(U(H)))
650
- ];
651
- }),
652
- unselect: (x) => {
653
- const I = new Set(x.map(U));
654
- z(
655
- (k) => k.filter((H) => !I.has(U(H)))
656
- );
657
- }
658
- }, gn = g !== null && h !== null, be = /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
659
- Ie,
660
- {
661
- size: 32,
662
- "aria-label": p.formatMessage({
663
- id: "ds.business.cloud-import.loading"
664
- })
665
- }
666
- ) });
667
- if (!gn && (b || !m))
668
- return be;
669
- if (j.length === 0)
670
- return /* @__PURE__ */ C(ne, { children: [
671
- /* @__PURE__ */ i(bt, { "aria-hidden": !0, children: /* @__PURE__ */ i(Tn, {}) }),
672
- /* @__PURE__ */ i(yt, { children: p.formatMessage({
673
- id: "ds.business.cloud-import.create-error.title"
674
- }) }),
675
- /* @__PURE__ */ i(vt, { children: p.formatMessage({
676
- id: "ds.business.cloud-import.create-error.description"
677
- }) }),
678
- /* @__PURE__ */ i(
679
- Y,
680
- {
681
- variant: "contained",
682
- startIcon: /* @__PURE__ */ i(We, { "aria-hidden": !0 }),
683
- loading: R || b,
684
- onClick: () => void un(),
685
- children: p.formatMessage({
686
- id: "ds.business.cloud-import.create-error.create-button"
687
- })
688
- }
689
- )
690
- ] });
691
- if (G === null)
692
- return be;
693
- const fn = Cn(
694
- u,
695
- G.space,
696
- G.sectionKey === Oe
697
- ), ye = p.formatMessage({
698
- id: "ds.business.cloud-import.refresh"
699
- }), ve = p.formatMessage({
700
- id: "ds.business.cloud-import.open-in-cloud"
701
- }), we = (x) => x.avatar ?? /* @__PURE__ */ i(We, {});
702
- return /* @__PURE__ */ C(gt, { children: [
703
- re && /* @__PURE__ */ i(
704
- st,
705
- {
706
- severity: je.Danger,
707
- onClose: () => _(!1),
708
- children: p.formatMessage({ id: "ds.business.cloud-import.refresh-error" })
709
- }
710
- ),
711
- /* @__PURE__ */ C(ft, { children: [
712
- /* @__PURE__ */ i(
713
- On,
714
- {
715
- fullWidth: !0,
716
- disableClearable: !0,
717
- options: j,
718
- value: G,
719
- groupBy: (x) => x.sectionLabel,
720
- getOptionLabel: (x) => x.label,
721
- isOptionEqualToValue: (x, I) => x.space.id === I.space.id,
722
- onChange: (x, I) => v(I.space),
723
- filterOptions: (x, { inputValue: I }) => {
724
- const k = I.trim().toLowerCase();
725
- return k === "" || k === G.label.toLowerCase() ? x : x.filter(
726
- (H) => [H.label, H.subtitle ?? ""].some(
727
- (E) => E.toLowerCase().includes(k)
728
- )
729
- );
730
- },
731
- renderGroup: (x) => /* @__PURE__ */ C(Wt, { children: [
732
- /* @__PURE__ */ i(Mt, { children: x.group }),
733
- /* @__PURE__ */ i(Ot, { children: x.children })
734
- ] }, x.key),
735
- renderOption: ({ key: x, ...I }, k) => /* @__PURE__ */ C(Ct, { ...I, children: [
736
- /* @__PURE__ */ i(en, { "aria-hidden": !0, children: we(k) }),
737
- /* @__PURE__ */ C(kt, { children: [
738
- /* @__PURE__ */ i(St, { children: k.label }),
739
- k.subtitle !== void 0 && /* @__PURE__ */ i(It, { children: k.subtitle })
740
- ] })
741
- ] }, x),
742
- renderInput: (x) => /* @__PURE__ */ i(
743
- Ve,
744
- {
745
- label: p.formatMessage({
746
- id: "ds.business.cloud-import.space-label"
747
- }),
748
- children: /* @__PURE__ */ i(
749
- me,
750
- {
751
- ...x.InputProps,
752
- id: x.id,
753
- fullWidth: !0,
754
- inputProps: x.inputProps,
755
- startAdornment: /* @__PURE__ */ i(Ft, { "aria-hidden": !0, children: we(G) })
756
- }
757
- )
758
- }
759
- )
760
- }
761
- ),
762
- /* @__PURE__ */ i(Fe, { title: ye, children: /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(
763
- ae,
764
- {
765
- "aria-label": ye,
766
- disabled: O === "loading" || b,
767
- onClick: () => void cn(),
768
- children: /* @__PURE__ */ i(zn, { "aria-hidden": !0 })
769
- }
770
- ) }) }),
771
- /* @__PURE__ */ i(Fe, { title: ve, children: /* @__PURE__ */ i(
772
- ae,
773
- {
774
- component: "a",
775
- href: fn,
776
- target: "_blank",
777
- rel: "noreferrer",
778
- "aria-label": ve,
779
- children: /* @__PURE__ */ i(En, { "aria-hidden": !0 })
780
- }
781
- ) })
782
- ] }),
783
- /* @__PURE__ */ i(mt, { children: p.formatMessage({ id: "ds.business.cloud-import.filtered-hint" }) }),
784
- O === "loading" && /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
785
- Ie,
786
- {
787
- size: 24,
788
- "aria-label": p.formatMessage({
789
- id: "ds.business.cloud-import.tree-loading"
790
- })
791
- }
792
- ) }),
793
- O === "failed" && /* @__PURE__ */ C(ne, { role: "alert", children: [
794
- p.formatMessage({ id: "ds.business.cloud-import.tree-error" }),
795
- /* @__PURE__ */ i(
796
- Y,
797
- {
798
- variant: "outlined",
799
- onClick: () => void ie(G.space),
800
- children: p.formatMessage({ id: "ds.business.cloud-import.retry" })
801
- }
802
- )
803
- ] }),
804
- O === "ready" && W !== null && (W.folders.length === 0 && W.files.length === 0 ? /* @__PURE__ */ C(ne, { children: [
805
- /* @__PURE__ */ i(Ne, { "aria-hidden": !0 }),
806
- p.formatMessage({ id: "ds.business.cloud-import.empty-space" })
807
- ] }) : /* @__PURE__ */ i(
808
- ht,
809
- {
810
- "aria-label": p.formatMessage({
811
- id: "ds.business.cloud-import.tree-label"
812
- }),
813
- children: /* @__PURE__ */ i(
814
- Je,
815
- {
816
- folders: W.folders,
817
- files: W.files,
818
- context: pn
819
- }
820
- )
821
- }
822
- )),
823
- /* @__PURE__ */ C(wt, { children: [
824
- /* @__PURE__ */ i(xt, { role: "status", children: p.formatMessage(
825
- { id: "ds.business.cloud-import.selected" },
826
- { count: T.length }
827
- ) }),
828
- /* @__PURE__ */ i(
829
- Y,
830
- {
831
- variant: "contained",
832
- startIcon: /* @__PURE__ */ i(Rn, { "aria-hidden": !0 }),
833
- disabled: T.length === 0,
834
- onClick: () => t(G.space, T),
835
- children: p.formatMessage({ id: "ds.business.cloud-import.import" })
836
- }
837
- )
838
- ] })
839
- ] });
840
- }
841
- function Rt({
842
- open: e,
843
- onClose: t,
844
- onImport: n,
845
- cloudPicker: r,
846
- multiple: a,
847
- maxSize: u,
848
- accept: s
849
- }) {
850
- const d = P();
851
- return /* @__PURE__ */ i(
852
- Pe,
853
- {
854
- open: e,
855
- onClose: t,
856
- size: He.Medium,
857
- title: d.formatMessage({ id: "ds.business.cloud-import.title" }),
858
- children: e && /* @__PURE__ */ i(
859
- Tt,
860
- {
861
- cloudPicker: r,
862
- multiple: a,
863
- maxSize: u,
864
- accept: s,
865
- onImport: (g, h) => {
866
- n(g, h), t();
867
- }
868
- }
869
- )
870
- }
871
- );
872
- }
873
- var nn = /* @__PURE__ */ ((e) => (e.Medium = "medium", e.Compact = "compact", e))(nn || {});
874
- const Et = ze(
875
- "medium"
876
- /* Medium */
877
- ), zt = l(le)(({ theme: e }) => ({
878
- // Three times the largest spacing step: room for a label and the arrow.
879
- minWidth: o(e.design.space[10] * 3),
880
- maxWidth: "100%"
881
- })), At = l($e)(({ theme: e }) => ({
882
- position: "relative",
883
- transform: "none",
884
- maxWidth: "100%",
885
- pointerEvents: "auto",
886
- marginBottom: o(e.design.space[2]),
887
- fontSize: o(e.design.typeScale.small),
888
- fontWeight: A.medium,
889
- lineHeight: e.typography.caption.lineHeight,
890
- color: e.design.tokens["text.secondary"],
891
- "&.Mui-focused": { color: e.design.tokens["text.secondary"] },
892
- "&.Mui-error": { color: e.design.tokens["status.danger"] },
893
- "&.Mui-disabled": { color: e.design.tokens["text.muted"] }
894
- })), Lt = l("span")(({ theme: e }) => ({
895
- display: "flex",
896
- alignItems: "center",
897
- gap: o(e.design.space[2]),
898
- minWidth: 0
899
- })), $t = l("i", {
900
- shouldForwardProp: (e) => e !== "token"
901
- })(({ theme: e, token: t }) => ({
902
- flex: "none",
903
- width: o(e.design.space[2]),
904
- height: o(e.design.space[2]),
905
- borderRadius: o(e.design.radii.sm / 2),
906
- backgroundColor: e.design.tokens[t]
907
- })), Dt = l("span")({
908
- display: "flex",
909
- flexDirection: "column",
910
- minWidth: 0
911
- }), Pt = l("span")(({ theme: e }) => ({
912
- fontSize: o(e.design.typeScale.caption),
913
- color: e.design.tokens["text.muted"],
914
- whiteSpace: "normal"
915
- })), pe = l("span")({
916
- overflow: "hidden",
917
- textOverflow: "ellipsis",
918
- whiteSpace: "nowrap"
919
- }), Ht = l(pe)(({ theme: e }) => ({
920
- color: e.design.tokens["text.muted"]
921
- }));
922
- function xr({
923
- label: e,
924
- options: t,
925
- value: n,
926
- onChange: r,
927
- multiple: a = !1,
928
- disabled: u,
929
- error: s,
930
- size: d
931
- }) {
932
- const g = P(), h = Ae(Et), b = (d ?? h) === nn.Compact, m = b ? zt : le, f = N(), w = `${f}-label`, c = `${f}-helper`, p = new Map(t.map((v) => [v.value, v]));
933
- return /* @__PURE__ */ C(m, { fullWidth: !b, disabled: u, error: !!s, children: [
934
- /* @__PURE__ */ i(
935
- At,
936
- {
937
- id: w,
938
- shrink: !0,
939
- style: b ? fe : void 0,
940
- children: e
941
- }
942
- ),
943
- /* @__PURE__ */ C(
944
- hn,
945
- {
946
- labelId: w,
947
- multiple: a,
948
- value: n,
949
- displayEmpty: !0,
950
- renderValue: (v) => {
951
- const W = Array.isArray(v) ? v : [v];
952
- return b && W.length === 0 ? /* @__PURE__ */ i(Ht, { "aria-hidden": !0, children: e }) : /* @__PURE__ */ i(pe, { children: W.map((M) => {
953
- var O;
954
- return ((O = p.get(M)) == null ? void 0 : O.label) ?? M;
955
- }).join(", ") });
956
- },
957
- "aria-describedby": s ? c : void 0,
958
- onChange: (v) => r(v.target.value),
959
- children: [
960
- t.length === 0 && /* @__PURE__ */ i(Ce, { disabled: !0, value: "", children: g.formatMessage({ id: "ds.inputs.rich-select.empty" }) }),
961
- t.map((v) => /* @__PURE__ */ i(Ce, { value: v.value, children: /* @__PURE__ */ C(Lt, { children: [
962
- v.tone && /* @__PURE__ */ i($t, { token: v.tone }),
963
- v.icon,
964
- /* @__PURE__ */ C(Dt, { children: [
965
- /* @__PURE__ */ i(pe, { children: v.label }),
966
- v.description && /* @__PURE__ */ i(Pt, { children: v.description })
967
- ] })
968
- ] }) }, v.value))
969
- ]
970
- }
971
- ),
972
- s && /* @__PURE__ */ i(se, { id: c, children: s })
973
- ] });
974
- }
975
- const Nt = l("div")(({ theme: e }) => ({
976
- display: "flex",
977
- flexDirection: "column",
978
- gap: o(e.design.space[2]),
979
- minWidth: 0
980
- })), _t = l("span")(({ theme: e }) => ({
981
- fontSize: o(e.design.typeScale.small),
982
- fontWeight: A.medium,
983
- color: e.design.tokens["text.secondary"]
984
- })), Bt = l("div", {
985
- shouldForwardProp: (e) => e !== "active"
986
- })(({ theme: e, active: t }) => {
987
- const { tokens: n, space: r, radii: a } = e.design;
988
- return {
989
- display: "flex",
990
- flexDirection: "column",
991
- alignItems: "center",
992
- justifyContent: "center",
993
- gap: o(r[3]),
994
- minHeight: o(r[10] * 3),
995
- padding: `${o(r[6])} ${o(r[4])}`,
996
- boxSizing: "border-box",
997
- border: `1px dashed ${t ? n.accent : n["border.control"]}`,
998
- borderRadius: o(a.md),
999
- backgroundColor: t ? de(n.accent) : n["bg.raised"],
1000
- color: n["text.secondary"],
1001
- textAlign: "center",
1002
- cursor: "pointer",
1003
- transition: oe(e, ["border-color", "background-color"]),
1004
- "&:hover": { borderColor: n.accent }
1005
- };
1006
- }), Vt = l("span")(({ theme: e }) => {
1007
- const { tokens: t, space: n } = e.design;
1008
- return {
1009
- display: "inline-flex",
1010
- alignItems: "center",
1011
- justifyContent: "center",
1012
- width: o(n[9]),
1013
- height: o(n[9]),
1014
- borderRadius: "50%",
1015
- backgroundColor: de(t.accent),
1016
- color: t["accent.text"],
1017
- "& svg": { width: o(n[5]), height: o(n[5]) }
1018
- };
1019
- }), jt = l("span")(({ theme: e }) => ({
1020
- fontSize: o(e.design.typeScale.body),
1021
- [Z.down(K.Tablet)]: { display: "none" }
1022
- })), Gt = l("div")(({ theme: e }) => ({
1023
- display: "flex",
1024
- flexWrap: "wrap",
1025
- alignItems: "center",
1026
- justifyContent: "space-between",
1027
- gap: o(e.design.space[2])
1028
- })), qt = l("span")(({ theme: e }) => ({
1029
- fontSize: o(e.design.typeScale.small),
1030
- color: e.design.tokens["text.muted"]
1031
- })), Ut = l("p")(({ theme: e }) => ({
1032
- margin: 0,
1033
- fontSize: o(e.design.typeScale.small),
1034
- color: e.design.tokens["status.danger"]
1035
- })), Kt = l("img")(({ theme: e }) => ({
1036
- width: o(e.design.space[4]),
1037
- height: o(e.design.space[4])
1038
- })), Xt = (e) => {
1039
- const { value: t, unit: n } = Wn(e);
1040
- return `${t} ${n}`;
1041
- };
1042
- function Cr({
1043
- onDrop: e,
1044
- multiple: t = !0,
1045
- accept: n,
1046
- maxSize: r,
1047
- caption: a,
1048
- title: u,
1049
- cloudImport: s,
1050
- children: d
1051
- }) {
1052
- const g = P(), h = N(), b = N(), [m, f] = F(null), [w, c] = F(!1), p = r === void 0 ? null : Xt(r), y = a ?? (p === null ? null : g.formatMessage(
1053
- { id: "ds.inputs.drop-zone.max-size" },
1054
- { size: p, multiple: String(t) }
1055
- )), v = (z, R) => {
1056
- const ee = r === void 0 ? [] : z.filter((_) => _.size > r), re = z.filter((_) => !ee.includes(_));
1057
- R.some(
1058
- (_) => _.errors.some((j) => j.code === Fn.TooManyFiles)
1059
- ) ? f(
1060
- "too-many"
1061
- /* TooMany */
1062
- ) : R.length > 0 ? f(
1063
- "rejected-type"
1064
- /* Rejected */
1065
- ) : ee.length > 0 ? f(
1066
- z.length === 1 ? "too-big" : "some-too-big"
1067
- /* SomeTooBig */
1068
- ) : f(null), re.length > 0 && e(re);
1069
- }, { getRootProps: W, getInputProps: M, isDragActive: O, open: S } = Sn({
1070
- onDrop: v,
1071
- multiple: t,
1072
- accept: n,
1073
- // The zone itself is not a control: the button inside is, for the keyboard and screen readers.
1074
- noClick: !0,
1075
- noKeyboard: !0
1076
- }), T = g.formatMessage(
1077
- { id: "ds.inputs.drop-zone.browse" },
1078
- { multiple: String(t) }
1079
- );
1080
- return /* @__PURE__ */ C(
1081
- Nt,
1082
- {
1083
- role: "group",
1084
- "aria-labelledby": u !== void 0 ? h : void 0,
1085
- "aria-describedby": y !== null ? b : void 0,
1086
- children: [
1087
- u !== void 0 && /* @__PURE__ */ i(_t, { id: h, children: u }),
1088
- /* @__PURE__ */ C(Bt, { ...W({ onClick: S }), active: O, children: [
1089
- /* @__PURE__ */ i("input", { ...M({ "aria-hidden": !0 }) }),
1090
- d ?? /* @__PURE__ */ C(J, { children: [
1091
- /* @__PURE__ */ i(Vt, { "aria-hidden": !0, children: /* @__PURE__ */ i(Mn, {}) }),
1092
- /* @__PURE__ */ i(jt, { children: g.formatMessage(
1093
- {
1094
- id: O ? "ds.inputs.drop-zone.release" : "ds.inputs.drop-zone.prompt"
1095
- },
1096
- { multiple: String(t) }
1097
- ) })
1098
- ] }),
1099
- /* @__PURE__ */ i(
1100
- Y,
1101
- {
1102
- variant: "outlined",
1103
- onClick: (z) => {
1104
- z.stopPropagation(), S();
1105
- },
1106
- children: T
1107
- }
1108
- )
1109
- ] }),
1110
- (s !== void 0 || y !== null) && /* @__PURE__ */ C(Gt, { children: [
1111
- s !== void 0 && /* @__PURE__ */ i(
1112
- Y,
1113
- {
1114
- variant: "text",
1115
- startIcon: /* @__PURE__ */ i(Kt, { src: In, alt: "" }),
1116
- onClick: () => c(!0),
1117
- children: g.formatMessage({ id: "ds.inputs.drop-zone.cloud" })
1118
- }
1119
- ),
1120
- y !== null && /* @__PURE__ */ i(qt, { id: b, children: y })
1121
- ] }),
1122
- m !== null && /* @__PURE__ */ i(Ut, { role: "alert", children: g.formatMessage(
1123
- { id: `ds.inputs.drop-zone.${m}` },
1124
- { size: p ?? "" }
1125
- ) }),
1126
- s !== void 0 && /* @__PURE__ */ i(
1127
- Rt,
1128
- {
1129
- open: w,
1130
- onClose: () => c(!1),
1131
- onImport: s.onImport,
1132
- cloudPicker: s,
1133
- multiple: t,
1134
- maxSize: r,
1135
- accept: n === void 0 ? void 0 : Object.entries(n).flatMap(([z, R]) => [
1136
- z,
1137
- ...R
1138
- ])
1139
- }
1140
- )
1141
- ]
1142
- }
1143
- );
1144
- }
1145
- const Yt = 1, Qt = (e, t) => t === "vertical" ? e.scrollHeight - e.clientHeight - e.scrollTop : e.scrollWidth - e.clientWidth - e.scrollLeft, Zt = (e, t, n) => {
1146
- const [r, a] = F(!1), u = Q(() => {
1147
- const s = e.current;
1148
- s !== null && a(Qt(s, t) > Yt);
1149
- }, [e, t]);
1150
- return Le(u, [u, n]), V(() => {
1151
- const s = e.current;
1152
- if (s === null)
1153
- return;
1154
- s.addEventListener("scroll", u, { passive: !0 });
1155
- const d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
1156
- return d !== null && (d.observe(s), Array.from(s.children).forEach((g) => d.observe(g))), () => {
1157
- s.removeEventListener("scroll", u), d == null || d.disconnect();
1158
- };
1159
- }, [e, u, n]), r;
1160
- };
1161
- var Jt = /* @__PURE__ */ ((e) => (e.Default = "default", e.Danger = "danger", e.Warning = "warning", e))(Jt || {});
1162
- const eo = l("form")(({ theme: e }) => ({
1163
- display: "flex",
1164
- flexDirection: "column",
1165
- gap: o(e.design.space[4]),
1166
- color: e.design.tokens["text.secondary"],
1167
- overflowWrap: "anywhere"
1168
- })), no = (e, t) => {
1169
- const { paper: n } = e.design.tokens, r = e.design.tokens["paper.on"];
1170
- return ke(t, n) >= ke(t, r) ? n : r;
1171
- }, to = {
1172
- default: "primary",
1173
- danger: "error",
1174
- warning: "warning"
1175
- };
1176
- function oo({
1177
- open: e,
1178
- title: t,
1179
- body: n,
1180
- confirmLabel: r,
1181
- tone: a = "default",
1182
- confirmationText: u,
1183
- onConfirm: s,
1184
- onCancel: d
1185
- }) {
1186
- const g = P(), h = bn(), b = N(), [m, f] = F(""), [w, c] = F(!1), [p, y] = F(!1), [v, W] = F(e);
1187
- e !== v && (W(e), e && (f(""), y(!1)));
1188
- const M = !w && (u === void 0 || m === u), O = a !== "default", S = () => {
1189
- w || d();
1190
- }, T = () => {
1191
- if (!M)
1192
- return;
1193
- y(!1);
1194
- let R;
1195
- try {
1196
- R = s();
1197
- } catch {
1198
- y(!0);
1199
- return;
1200
- }
1201
- R instanceof Promise && (c(!0), R.then(
1202
- () => c(!1),
1203
- () => {
1204
- c(!1), y(!0);
1205
- }
1206
- ));
1207
- }, z = (R) => {
1208
- R.preventDefault(), T();
1209
- };
1210
- return /* @__PURE__ */ i(
1211
- Pe,
1212
- {
1213
- open: e,
1214
- onClose: S,
1215
- size: He.Small,
1216
- title: t,
1217
- actions: /* @__PURE__ */ C(J, { children: [
1218
- /* @__PURE__ */ i(
1219
- Y,
1220
- {
1221
- variant: "outlined",
1222
- disabled: w,
1223
- autoFocus: u === void 0 && O,
1224
- onClick: S,
1225
- children: g.formatMessage({ id: "ds.layers.confirm-dialog.cancel" })
1226
- }
1227
- ),
1228
- /* @__PURE__ */ i(
1229
- Y,
1230
- {
1231
- type: "submit",
1232
- form: b,
1233
- variant: "contained",
1234
- color: to[a],
1235
- disabled: !M,
1236
- loading: w,
1237
- autoFocus: u === void 0 && !O,
1238
- sx: a === "warning" ? {
1239
- "&:not(.Mui-disabled)": {
1240
- color: no(
1241
- h,
1242
- h.design.tokens["status.warning"]
1243
- )
1244
- }
1245
- } : void 0,
1246
- children: r
1247
- }
1248
- )
1249
- ] }),
1250
- children: /* @__PURE__ */ C(eo, { id: b, onSubmit: z, noValidate: !0, children: [
1251
- /* @__PURE__ */ i("div", { children: n }),
1252
- u !== void 0 && /* @__PURE__ */ i(
1253
- Vn,
1254
- {
1255
- label: g.formatMessage(
1256
- { id: "ds.layers.confirm-dialog.type-to-confirm" },
1257
- { text: u }
1258
- ),
1259
- value: m,
1260
- onChange: (R) => f(R.target.value),
1261
- disabled: w,
1262
- autoFocus: !0,
1263
- autoComplete: "off",
1264
- fullWidth: !0
1265
- }
1266
- ),
1267
- p && /* @__PURE__ */ i(Bn, { severity: "error", children: g.formatMessage({ id: "ds.layers.confirm-dialog.failed" }) })
1268
- ] })
1269
- }
1270
- );
1271
- }
1272
- const tn = ze(null);
1273
- function kr({ children: e }) {
1274
- const [t, n] = F([]), [r, a] = F(null), u = X(0), s = X([]);
1275
- s.current = t;
1276
- const d = t.length > 0 ? t[0] : null;
1277
- d !== null && d !== r && a(d), V(
1278
- () => () => {
1279
- s.current.forEach((m) => m.resolve(!1));
1280
- },
1281
- []
1282
- );
1283
- const g = Q(
1284
- (m) => new Promise((f) => {
1285
- u.current += 1;
1286
- const w = { id: u.current, options: m, resolve: f };
1287
- n((c) => [...c, w]);
1288
- }),
1289
- []
1290
- ), h = (m) => {
1291
- d !== null && (d.resolve(m), n((f) => f.filter((w) => w !== d)));
1292
- }, b = ge(() => ({ confirm: g }), [g]);
1293
- return /* @__PURE__ */ C(tn.Provider, { value: b, children: [
1294
- e,
1295
- r !== null && // A new key per request: each one starts from an empty confirmation field.
1296
- /* @__PURE__ */ i(
1297
- oo,
1298
- {
1299
- open: d === r,
1300
- ...r.options,
1301
- onConfirm: () => h(!0),
1302
- onCancel: () => h(!1)
1303
- },
1304
- r.id
1305
- )
1306
- ] });
1307
- }
1308
- function Sr() {
1309
- const e = Ae(tn);
1310
- if (e === null)
1311
- throw new Error(
1312
- "useConfirmDialog must be called inside a ConfirmDialogProvider"
1313
- );
1314
- return e;
1315
- }
1316
- var ro = /* @__PURE__ */ ((e) => (e.BottomStart = "bottom-start", e.BottomEnd = "bottom-end", e))(ro || {});
1317
- const io = 320, so = l("div")(({ theme: e }) => {
1318
- const { tokens: t, space: n } = e.design;
1319
- return {
1320
- flex: "none",
1321
- display: "flex",
1322
- alignItems: "center",
1323
- justifyContent: "space-between",
1324
- gap: o(n[3]),
1325
- padding: `${o(n[2])} ${o(n[2])} ${o(n[2])} ${o(n[4])}`,
1326
- borderBottom: D(t["border.subtle"])
1327
- };
1328
- }), ao = l("h2")(({ theme: e }) => ({
1329
- margin: 0,
1330
- minWidth: 0,
1331
- color: e.design.tokens["text.primary"],
1332
- fontSize: o(e.design.typeScale.body),
1333
- fontWeight: A.semibold,
1334
- overflowWrap: "anywhere"
1335
- })), on = l("div")(({ theme: e }) => ({
1336
- display: "flex",
1337
- flexDirection: "column",
1338
- gap: o(e.design.space[3]),
1339
- fontSize: o(e.design.typeScale.body)
1340
- })), lo = l(on)(({ theme: e }) => ({
1341
- padding: o(e.design.space[4])
1342
- }));
1343
- function Ir({
1344
- anchorEl: e,
1345
- open: t,
1346
- onClose: n,
1347
- title: r,
1348
- placement: a = "bottom-start",
1349
- width: u = io,
1350
- children: s
1351
- }) {
1352
- const d = P(), g = N(), h = vn() === K.Mobile, b = d.formatMessage({
1353
- id: "ds.layers.anchored-panel.close"
1354
- }), m = t && e !== null;
1355
- if (h)
1356
- return /* @__PURE__ */ i(
1357
- wn,
1358
- {
1359
- open: m,
1360
- onClose: n,
1361
- title: r,
1362
- closeLabel: b,
1363
- children: /* @__PURE__ */ i(on, { children: s })
1364
- }
1365
- );
1366
- const f = a === "bottom-end" ? "right" : "left";
1367
- return /* @__PURE__ */ C(
1368
- jn,
1369
- {
1370
- anchorEl: e,
1371
- open: m,
1372
- onClose: () => n(),
1373
- anchorOrigin: { vertical: "bottom", horizontal: f },
1374
- transformOrigin: { vertical: "top", horizontal: f },
1375
- slotProps: {
1376
- paper: {
1377
- role: "dialog",
1378
- "aria-modal": !0,
1379
- "aria-labelledby": g,
1380
- sx: (w) => ({
1381
- width: o(u),
1382
- maxWidth: `calc(100vw - ${o(w.design.space[4] * 2)})`,
1383
- marginTop: o(w.design.space[1]),
1384
- color: w.design.tokens["text.primary"],
1385
- fontFamily: w.design.fonts.sans
1386
- })
1387
- }
1388
- },
1389
- children: [
1390
- /* @__PURE__ */ C(so, { children: [
1391
- /* @__PURE__ */ i(ao, { id: g, children: r }),
1392
- /* @__PURE__ */ i(ae, { "aria-label": b, onClick: n, children: /* @__PURE__ */ i(_e, { "aria-hidden": !0 }) })
1393
- ] }),
1394
- /* @__PURE__ */ i(lo, { children: s })
1395
- ]
1396
- }
1397
- );
1398
- }
1399
- const co = [32, 160, 8239, 8201].map(
1400
- (e) => String.fromCharCode(e)
1401
- ), uo = (e) => {
1402
- var n, r;
1403
- const t = new Intl.NumberFormat(e).formatToParts(11111.1);
1404
- return {
1405
- group: ((n = t.find((a) => a.type === "group")) == null ? void 0 : n.value) ?? " ",
1406
- decimal: ((r = t.find((a) => a.type === "decimal")) == null ? void 0 : r.value) ?? "."
1407
- };
1408
- }, Re = (e, t) => {
1409
- const r = [t.group, ...co].reduce(
1410
- (u, s) => u.split(s).join(""),
1411
- e.trim()
1412
- ).replace(",", ".");
1413
- if (r === "" || !/^-?\d*\.?\d+$|^-?\d+\.$/.test(r))
1414
- return null;
1415
- const a = Number.parseFloat(r);
1416
- return Number.isFinite(a) ? a : null;
1417
- }, po = l("div", {
1418
- shouldForwardProp: (e) => e !== "labelHidden"
1419
- })(({ labelHidden: e }) => ({
1420
- ...e && { [`& .${qn.root}`]: fe }
1421
- }));
1422
- function Fr({
1423
- label: e,
1424
- value: t,
1425
- onChange: n,
1426
- decimals: r = 0,
1427
- min: a = 0,
1428
- max: u,
1429
- hideLabel: s = !1,
1430
- ariaLabel: d,
1431
- help: g,
1432
- error: h,
1433
- testId: b,
1434
- disabled: m,
1435
- adornment: f
1436
- }) {
1437
- const w = P(), c = ge(
1438
- () => uo(w.locale),
1439
- [w.locale]
1440
- ), p = Q(
1441
- (S) => S === null ? "" : w.formatNumber(S, {
1442
- minimumFractionDigits: r,
1443
- maximumFractionDigits: r
1444
- }),
1445
- [w, r]
1446
- ), [y, v] = F(!1), [W, M] = F(() => p(t));
1447
- return V(() => {
1448
- y || M(p(t));
1449
- }, [t, y, p]), /* @__PURE__ */ i(po, { labelHidden: s, children: /* @__PURE__ */ i(Ve, { label: e, help: g, error: h, children: /* @__PURE__ */ i(
1450
- me,
1451
- {
1452
- disabled: m,
1453
- value: W,
1454
- inputProps: {
1455
- inputMode: "decimal",
1456
- "aria-label": d,
1457
- "data-testid": b
1458
- },
1459
- onFocus: () => {
1460
- v(!0), t !== null && M(String(t).replace(".", c.decimal));
1461
- },
1462
- onChange: (S) => {
1463
- M(S.target.value);
1464
- const T = Re(S.target.value, c);
1465
- T !== null ? n(T) : S.target.value === "" && n(null);
1466
- },
1467
- onBlur: () => {
1468
- v(!1);
1469
- let S = Re(W, c);
1470
- if (S !== null) {
1471
- const T = Math.max(S, a);
1472
- S = Number.parseFloat(
1473
- (u === void 0 ? T : Math.min(T, u)).toFixed(
1474
- r
1475
- )
1476
- );
1477
- }
1478
- n(S), M(p(S));
1479
- },
1480
- endAdornment: f ? /* @__PURE__ */ i(Un, { position: "end", children: f }) : void 0
1481
- }
1482
- ) }) });
1483
- }
1484
- const Wr = { l: 0.72, c: 0.12 }, Mr = [
1485
- 266,
1486
- 296,
1487
- 326,
1488
- 356,
1489
- 26,
1490
- 56,
1491
- 86,
1492
- 116,
1493
- 146,
1494
- 176,
1495
- 206,
1496
- 236
1497
- ], rn = [
1498
- "#81a2f0",
1499
- "#ab94e7",
1500
- "#cb89cd",
1501
- "#e084a7",
1502
- "#e6867d",
1503
- "#de9056",
1504
- "#c69f41",
1505
- "#a1ae50",
1506
- "#70b976",
1507
- "#37bda2",
1508
- "#18b9c9",
1509
- "#4eb0e5"
1510
- ], Or = "#767676", Tr = rn[6], Rr = "#111a2f", Er = "#5674be", go = /^#?([0-9a-f]{6})$/i, q = (e) => {
1511
- const t = go.exec(e.trim());
1512
- return t ? `#${t[1].toLowerCase()}` : null;
1513
- }, fo = l("div")(({ theme: e }) => ({
1514
- display: "flex",
1515
- alignItems: "center",
1516
- gap: o(e.design.space[3])
1517
- })), mo = l("span")(({ theme: e }) => ({
1518
- flex: "none",
1519
- width: o(e.design.densityValues[e.design.density].control),
1520
- height: o(e.design.densityValues[e.design.density].control),
1521
- borderRadius: o(e.design.radii.md),
1522
- border: D(e.design.tokens["border.control"])
1523
- })), ho = l("div")(({ theme: e }) => ({
1524
- display: "flex",
1525
- flexWrap: "wrap",
1526
- gap: o(e.design.space[2]),
1527
- marginTop: o(e.design.space[2])
1528
- })), bo = l(Be)(({ theme: e }) => {
1529
- const { densityValues: t, density: n, space: r } = e.design, a = t[n].control - r[2];
1530
- return {
1531
- width: o(a),
1532
- height: o(a),
1533
- borderRadius: o(e.design.radii.sm),
1534
- border: D(e.design.tokens["border.control"]),
1535
- // The chosen swatch carries the ring of the design system (`focus.ring` is the accent).
1536
- '&[aria-pressed="true"]': te(e),
1537
- "&.Mui-focusVisible": te(e),
1538
- [Z.down(K.Tablet)]: {
1539
- width: o(e.design.densityValues.touchTarget),
1540
- height: o(e.design.densityValues.touchTarget)
1541
- }
1542
- };
1543
- });
1544
- function zr({
1545
- label: e,
1546
- value: t,
1547
- onChange: n,
1548
- swatches: r = rn
1549
- }) {
1550
- const a = P(), u = N(), [s, d] = F(t), g = s !== "" && q(s) === null;
1551
- V(() => {
1552
- d(
1553
- (m) => q(m) === q(t) ? m : t
1554
- );
1555
- }, [t]);
1556
- const h = (m) => {
1557
- d(m);
1558
- const f = q(m);
1559
- f !== null && f !== q(t) && n(f);
1560
- }, b = q(t);
1561
- return /* @__PURE__ */ C(le, { fullWidth: !0, error: g, children: [
1562
- /* @__PURE__ */ i($e, { htmlFor: `${u}-hex`, children: e }),
1563
- /* @__PURE__ */ C(fo, { children: [
1564
- /* @__PURE__ */ i(
1565
- mo,
1566
- {
1567
- "aria-hidden": "true",
1568
- style: { backgroundColor: b ?? void 0 }
1569
- }
1570
- ),
1571
- /* @__PURE__ */ i(
1572
- me,
1573
- {
1574
- id: `${u}-hex`,
1575
- fullWidth: !0,
1576
- value: s,
1577
- error: g,
1578
- inputProps: {
1579
- "aria-describedby": g ? `${u}-error` : void 0,
1580
- spellCheck: !1,
1581
- autoComplete: "off"
1582
- },
1583
- onChange: (m) => h(m.target.value)
1584
- }
1585
- )
1586
- ] }),
1587
- g && /* @__PURE__ */ i(se, { id: `${u}-error`, children: a.formatMessage({ id: "ds.inputs.color.invalid" }) }),
1588
- /* @__PURE__ */ i(
1589
- ho,
1590
- {
1591
- role: "group",
1592
- "aria-label": a.formatMessage({ id: "ds.inputs.color.swatches" }),
1593
- children: r.map((m) => /* @__PURE__ */ i(
1594
- bo,
1595
- {
1596
- "aria-pressed": q(m) === b,
1597
- "aria-label": m,
1598
- style: { backgroundColor: m },
1599
- onClick: () => n(q(m) ?? m)
1600
- },
1601
- m
1602
- ))
1603
- }
1604
- )
1605
- ] });
1606
- }
1607
- const yo = 6, vo = l("div", {
1608
- shouldForwardProp: (e) => e !== "edges" && e !== "wrapped"
1609
- })(({ theme: e, edges: t, wrapped: n }) => {
1610
- const { tokens: r, radii: a, space: u } = e.design, s = o(u[1] * yo), d = r["text.primary"], g = t.start ? `transparent, ${d} ${s}` : d, h = t.end ? `${d} calc(100% - ${s}), transparent` : d, b = {
1611
- flexWrap: "wrap",
1612
- rowGap: o(u[1]),
1613
- columnGap: o(u[1]),
1614
- overflowX: "visible",
1615
- maskImage: "none",
1616
- border: "none",
1617
- backgroundColor: "transparent"
1618
- };
1619
- return {
1620
- maskImage: t.start || t.end ? `linear-gradient(to right, ${g}, ${h})` : "none",
1621
- display: "inline-flex",
1622
- maxWidth: "100%",
1623
- minWidth: 0,
1624
- border: D(r["border.subtle"]),
1625
- borderRadius: o(a.md),
1626
- overflowX: "auto",
1627
- overflowY: "hidden",
1628
- backgroundColor: r["bg.surface"],
1629
- // Below 768 px each segment keeps a 44 px target: the band wraps onto more rows rather than
1630
- // hiding segments behind a sideways scroll. A rule between neighbours would then start the
1631
- // second row with a stray line and leave the rows unsplit: the band loses its border and each
1632
- // segment draws its own, apart by a gap in both directions.
1633
- [Z.down(K.Tablet)]: b,
1634
- ...n && b
1635
- };
1636
- }), wo = l(Be, {
1637
- shouldForwardProp: (e) => e !== "wrapped"
1638
- })(({ theme: e, wrapped: t }) => {
1639
- const { tokens: n, space: r, typeScale: a, fonts: u, densityValues: s, radii: d } = e.design, g = {
1640
- minWidth: o(s.touchTarget),
1641
- minHeight: o(s.touchTarget),
1642
- border: D(n["border.subtle"]),
1643
- borderRadius: o(d.md),
1644
- backgroundColor: n["bg.surface"],
1645
- '&[aria-checked="true"]': { backgroundColor: n["bg.raised"] }
1646
- };
1647
- return {
1648
- flex: "none",
1649
- gap: o(r[2]),
1650
- minHeight: o(s[e.design.density].control),
1651
- paddingLeft: o(r[3]),
1652
- paddingRight: o(r[3]),
1653
- fontFamily: u.sans,
1654
- fontSize: o(a.body),
1655
- whiteSpace: "nowrap",
1656
- color: n["text.secondary"],
1657
- transition: oe(e, ["background-color", "color"]),
1658
- "& + &": { borderLeft: D(n["border.subtle"]) },
1659
- '&[aria-checked="true"]': {
1660
- backgroundColor: n["bg.raised"],
1661
- color: n["text.primary"],
1662
- fontWeight: A.medium
1663
- },
1664
- "&:hover": { backgroundColor: n["bg.hover"] },
1665
- "&.Mui-focusVisible": { ...te(e), outlineOffset: "-2px" },
1666
- // A short label (« 1 h », « 7 j ») would leave a segment narrower than a finger. Each segment
1667
- // is its own bordered tile once the band wraps.
1668
- [Z.down(K.Tablet)]: g,
1669
- ...t && g
1670
- };
1671
- }), xo = l("span")(({ theme: e }) => ({
1672
- display: "inline-flex",
1673
- flex: "none",
1674
- "& svg": {
1675
- width: o(e.design.space[4]),
1676
- height: o(e.design.space[4])
1677
- }
1678
- })), Co = l("span")(fe), ko = l("span")(({ theme: e }) => ({
1679
- fontFamily: e.design.fonts.mono,
1680
- fontSize: o(e.design.typeScale.caption),
1681
- color: e.design.tokens["text.muted"]
1682
- }));
1683
- function Ar({
1684
- options: e,
1685
- value: t,
1686
- onChange: n,
1687
- ariaLabel: r,
1688
- testId: a,
1689
- wrap: u = !1
1690
- }) {
1691
- const s = X(null), [d, g] = F({ start: !1, end: !1 }), h = Q(() => {
1692
- const f = s.current;
1693
- if (!f)
1694
- return;
1695
- const w = f.scrollLeft > 0, c = f.scrollLeft + f.clientWidth < f.scrollWidth - 1;
1696
- g(
1697
- (p) => p.start === w && p.end === c ? p : { start: w, end: c }
1698
- );
1699
- }, []);
1700
- V(() => (h(), window.addEventListener("resize", h), () => window.removeEventListener("resize", h)), [h, e]);
1701
- const b = (f) => {
1702
- var p, y;
1703
- const w = e.findIndex((v) => v.value === t);
1704
- let c;
1705
- switch (f.key) {
1706
- case "ArrowRight":
1707
- case "ArrowDown":
1708
- c = (w + 1) % e.length;
1709
- break;
1710
- case "ArrowLeft":
1711
- case "ArrowUp":
1712
- c = (w - 1 + e.length) % e.length;
1713
- break;
1714
- case "Home":
1715
- c = 0;
1716
- break;
1717
- case "End":
1718
- c = e.length - 1;
1719
- break;
1720
- default:
1721
- return;
1722
- }
1723
- f.preventDefault(), n(e[c].value), (y = (p = s.current) == null ? void 0 : p.querySelectorAll('[role="radio"]')[c]) == null || y.focus();
1724
- }, m = Math.max(
1725
- e.findIndex((f) => f.value === t),
1726
- 0
1727
- );
1728
- return /* @__PURE__ */ i(
1729
- vo,
1730
- {
1731
- ref: s,
1732
- role: "radiogroup",
1733
- "aria-label": r,
1734
- "data-testid": a,
1735
- edges: d,
1736
- wrapped: u,
1737
- onKeyDown: b,
1738
- onScroll: h,
1739
- children: e.map((f, w) => {
1740
- const c = f.value === t;
1741
- return /* @__PURE__ */ C(
1742
- wo,
1743
- {
1744
- wrapped: u,
1745
- role: "radio",
1746
- "aria-checked": c,
1747
- "aria-label": f.ariaLabel,
1748
- lang: f.lang,
1749
- "data-testid": f.testId,
1750
- tabIndex: w === m ? 0 : -1,
1751
- onClick: () => n(f.value),
1752
- children: [
1753
- f.icon !== void 0 && /* @__PURE__ */ i(xo, { "aria-hidden": !0, children: f.icon }),
1754
- f.icon !== void 0 && f.iconOnly ? /* @__PURE__ */ i(Co, { children: f.label }) : f.label,
1755
- f.count !== void 0 && /* @__PURE__ */ i(ko, { children: f.count })
1756
- ]
1757
- },
1758
- f.value
1759
- );
1760
- })
1761
- }
1762
- );
1763
- }
1764
- var So = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e))(So || {});
1765
- const Io = 2, Fo = /* @__PURE__ */ new Set(["Enter", " "]), Wo = l("div", {
1766
- shouldForwardProp: (e) => e !== "variant"
1767
- })(({ theme: e, variant: t }) => ({
1768
- minWidth: 0,
1769
- ...t === "primary" && {
1770
- borderBottom: D(e.design.tokens["border.subtle"])
1771
- }
1772
- })), sn = 32, Mo = l("div", {
1773
- shouldForwardProp: (e) => e !== "variant" && e !== "fade"
1774
- })(({ theme: e, variant: t, fade: n }) => {
1775
- const a = `linear-gradient(to right, ${e.design.tokens["text.primary"]} calc(100% - ${o(
1776
- sn
1777
- )}), transparent)`;
1778
- return {
1779
- position: "relative",
1780
- display: "flex",
1781
- gap: o(e.design.space[t === "primary" ? 1 : 2]),
1782
- overflowX: "auto",
1783
- overflowY: "hidden",
1784
- scrollbarWidth: "none",
1785
- "&::-webkit-scrollbar": { display: "none" },
1786
- ...n && { maskImage: a, WebkitMaskImage: a }
1787
- };
1788
- }), an = (e, t) => {
1789
- const { tokens: n, space: r, radii: a, typeScale: u, fonts: s, densityValues: d, density: g } = e.design, h = {
1790
- position: "relative",
1791
- display: "inline-flex",
1792
- alignItems: "center",
1793
- flex: "none",
1794
- gap: o(r[2]),
1795
- boxSizing: "border-box",
1796
- margin: 0,
1797
- border: 0,
1798
- backgroundColor: "transparent",
1799
- cursor: "pointer",
1800
- fontFamily: s.sans,
1801
- whiteSpace: "nowrap",
1802
- textDecoration: "none",
1803
- color: n["text.secondary"],
1804
- transition: oe(e, ["color", "background-color"]),
1805
- "&:hover": { color: n["text.primary"] },
1806
- '&[aria-selected="true"]': {
1807
- color: n["text.primary"],
1808
- fontWeight: A.medium
1809
- },
1810
- // Inside the scrolling row, an outer ring would be clipped: it is drawn inside the tab.
1811
- "&:focus-visible": { ...te(e), outlineOffset: "-2px" }
1812
- }, b = {
1813
- [Z.down(K.Tablet)]: {
1814
- minHeight: o(d.touchTarget)
1815
- }
1816
- };
1817
- return t === "primary" ? {
1818
- ...h,
1819
- minHeight: o(d[g].control + r[2]),
1820
- padding: `0 ${o(r[3])}`,
1821
- fontSize: o(u.body),
1822
- '&[aria-selected="true"]::after': {
1823
- content: '""',
1824
- position: "absolute",
1825
- left: 0,
1826
- right: 0,
1827
- bottom: 0,
1828
- height: o(Io),
1829
- backgroundColor: n.accent
1830
- },
1831
- ...b
1832
- } : {
1833
- ...h,
1834
- minHeight: o(d.compact.control),
1835
- padding: `0 ${o(r[3])}`,
1836
- borderRadius: o(a.md),
1837
- fontSize: o(u.small),
1838
- "&:hover": {
1839
- color: n["text.primary"],
1840
- backgroundColor: n["bg.hover"]
1841
- },
1842
- '&[aria-selected="true"]': {
1843
- color: n["text.primary"],
1844
- fontWeight: A.medium,
1845
- backgroundColor: n["bg.raised"]
1846
- },
1847
- ...b
1848
- };
1849
- }, ln = (e) => e !== "variant", Oo = l(Xn, { shouldForwardProp: ln })(({ theme: e, variant: t }) => an(e, t)), To = l("button", { shouldForwardProp: ln })(({ theme: e, variant: t }) => an(e, t)), Ro = l("span")(({ theme: e }) => {
1850
- const { tokens: t, space: n, radii: r, fonts: a, typeScale: u } = e.design;
1851
- return {
1852
- display: "inline-flex",
1853
- alignItems: "center",
1854
- padding: `0 ${o(n[1])}`,
1855
- borderRadius: o(r.sm),
1856
- border: D(t["border.subtle"]),
1857
- fontFamily: a.mono,
1858
- fontSize: o(u.caption),
1859
- fontWeight: A.regular,
1860
- lineHeight: 1.6,
1861
- color: t["text.muted"]
1862
- };
1863
- }), Ee = (e, t) => {
1864
- const n = t.offsetLeft, r = n + t.offsetWidth + sn;
1865
- n < e.scrollLeft ? e.scrollLeft = n : r > e.scrollLeft + e.clientWidth && (e.scrollLeft = r - e.clientWidth);
1866
- };
1867
- function Lr({
1868
- items: e,
1869
- value: t,
1870
- onChange: n,
1871
- variant: r,
1872
- "aria-label": a
1873
- }) {
1874
- const u = P(), s = X(null), d = e.filter((c) => c.hidden !== !0), g = Zt(s, "horizontal", d.length), h = Q(
1875
- () => {
1876
- var c;
1877
- return Array.from(
1878
- ((c = s.current) == null ? void 0 : c.querySelectorAll('[role="tab"]')) ?? []
1879
- );
1880
- },
1881
- []
1882
- ), b = Q(() => {
1883
- const c = s.current, p = c == null ? void 0 : c.querySelector('[aria-selected="true"]');
1884
- c && p && Ee(c, p);
1885
- }, []);
1886
- Le(b, [b, t]);
1887
- const m = d.map((c) => c.value).join("|");
1888
- V(() => {
1889
- const c = s.current;
1890
- if (c === null || typeof ResizeObserver > "u")
1891
- return;
1892
- const p = new ResizeObserver(b);
1893
- return p.observe(c), Array.from(c.children).forEach((y) => p.observe(y)), () => p.disconnect();
1894
- }, [b, m]);
1895
- const f = (c) => {
1896
- const p = h(), y = p.findIndex((W) => W === document.activeElement);
1897
- if (y < 0)
1898
- return;
1899
- if (Fo.has(c.key)) {
1900
- c.key === " " && p[y] instanceof HTMLAnchorElement && (c.preventDefault(), p[y].click());
1901
- return;
1902
- }
1903
- let v;
1904
- switch (c.key) {
1905
- case "ArrowRight":
1906
- v = (y + 1) % p.length;
1907
- break;
1908
- case "ArrowLeft":
1909
- v = (y - 1 + p.length) % p.length;
1910
- break;
1911
- case "Home":
1912
- v = 0;
1913
- break;
1914
- case "End":
1915
- v = p.length - 1;
1916
- break;
1917
- default:
1918
- return;
1919
- }
1920
- c.preventDefault(), p[v].focus(), s.current && Ee(s.current, p[v]);
1921
- }, w = Math.max(
1922
- d.findIndex((c) => c.value === t),
1923
- 0
1924
- );
1925
- return /* @__PURE__ */ i(Wo, { variant: r, children: /* @__PURE__ */ i(
1926
- Mo,
1927
- {
1928
- ref: s,
1929
- role: "tablist",
1930
- "aria-label": a,
1931
- variant: r,
1932
- fade: g,
1933
- "data-overflowing": g || void 0,
1934
- onKeyDown: f,
1935
- children: d.map((c, p) => {
1936
- const y = c.value === t, v = /* @__PURE__ */ C(J, { children: [
1937
- c.label,
1938
- c.badge !== void 0 && /* @__PURE__ */ i(Ro, { children: typeof c.badge == "number" ? u.formatNumber(c.badge) : c.badge })
1939
- ] }), W = {
1940
- role: "tab",
1941
- "aria-selected": y,
1942
- tabIndex: p === w ? 0 : -1,
1943
- "data-testid": c.testId,
1944
- variant: r,
1945
- onClick: () => n == null ? void 0 : n(c.value)
1946
- };
1947
- return c.to !== void 0 ? /* @__PURE__ */ i(
1948
- Oo,
1949
- {
1950
- to: c.to,
1951
- "aria-current": y ? "page" : void 0,
1952
- ...W,
1953
- children: v
1954
- },
1955
- c.value
1956
- ) : /* @__PURE__ */ i(To, { type: "button", ...W, children: v }, c.value);
1957
- })
1958
- }
1959
- ) });
1960
- }
1961
- export {
1962
- Ir as A,
1963
- st as C,
1964
- Cr as D,
1965
- Ve as F,
1966
- Rt as I,
1967
- Fr as N,
1968
- xr as R,
1969
- Ar as S,
1970
- So as T,
1971
- je as a,
1972
- Et as b,
1973
- nn as c,
1974
- Sr as d,
1975
- Jt as e,
1976
- oo as f,
1977
- Tt as g,
1978
- zr as h,
1979
- ro as i,
1980
- kr as j,
1981
- Lr as k,
1982
- Wr as l,
1983
- Mr as m,
1984
- q as n,
1985
- rn as o,
1986
- Or as p,
1987
- Tr as q,
1988
- Rr as r,
1989
- Er as s,
1990
- Zt as u
1991
- };