pixelize-design-library 2.4.2-beta.61 → 2.4.2-beta.62

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 (503) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/COMPONENT-GOTCHAS.md +119 -1
  3. package/dist/Components/Accordion/Accordion.js +2 -2
  4. package/dist/Components/AddressCard/AddressCard.js +2 -1
  5. package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
  6. package/dist/Components/AppSwitcher/AppSwitcher.js +1 -1
  7. package/dist/Components/AppearanceSettings/AppearanceSettings.js +1 -1
  8. package/dist/Components/AudioRecorder/AudioRecorder.js +2 -1
  9. package/dist/Components/Avatar/Avatar.d.ts +2 -1
  10. package/dist/Components/Avatar/Avatar.js +5 -3
  11. package/dist/Components/Backdrop/Backdrop.js +1 -1
  12. package/dist/Components/BagBar/BagBar.js +2 -1
  13. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
  14. package/dist/Components/CalendarGrid/CalendarGrid.js +5 -5
  15. package/dist/Components/CalendarGrid/calendarMath.js +18 -6
  16. package/dist/Components/Card/PaymentCard/PaymentCard.js +6 -5
  17. package/dist/Components/CartItem/CartItem.js +2 -1
  18. package/dist/Components/Checkbox/Checkbox.d.ts +18 -3
  19. package/dist/Components/Checkbox/Checkbox.js +9 -7
  20. package/dist/Components/CheckoutKit/selectable.js +1 -1
  21. package/dist/Components/ChoiceCard/ChoiceCard.d.ts +3 -0
  22. package/dist/Components/ChoiceCard/ChoiceCard.js +16 -0
  23. package/dist/Components/ChoiceCard/ChoiceCardGroup.d.ts +3 -0
  24. package/dist/Components/ChoiceCard/ChoiceCardGroup.js +6 -0
  25. package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +28 -0
  26. package/dist/Components/ChoiceCard/ChoiceCardProps.js +2 -0
  27. package/dist/Components/CircularProgress/CircularProgress.js +4 -8
  28. package/dist/Components/CircularProgress/CircularProgressProps.d.ts +5 -3
  29. package/dist/Components/CircularProgress/arc.d.ts +9 -1
  30. package/dist/Components/CircularProgress/arc.js +15 -1
  31. package/dist/Components/Common/FormLabel.js +1 -1
  32. package/dist/Components/Common/FormattedDescription.js +1 -1
  33. package/dist/Components/Common/HelperText.d.ts +5 -4
  34. package/dist/Components/Common/HelperText.js +10 -7
  35. package/dist/Components/Common/fieldStyles.d.ts +4 -4
  36. package/dist/Components/Common/fieldStyles.js +2 -1
  37. package/dist/Components/ContactForm/ContactForm.js +1 -1
  38. package/dist/Components/CopyButton/CopyButton.js +12 -5
  39. package/dist/Components/CouponField/CouponField.js +4 -3
  40. package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +18 -0
  41. package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
  42. package/dist/Components/DatePicker/CalendarPanel.js +2 -2
  43. package/dist/Components/DatePicker/DatePicker.js +8 -2
  44. package/dist/Components/DatePicker/RangeDatePicker.d.ts +9 -3
  45. package/dist/Components/DatePicker/RangeDatePicker.js +6 -5
  46. package/dist/Components/DatePicker/SingleDatePicker.d.ts +9 -5
  47. package/dist/Components/DatePicker/SingleDatePicker.js +7 -4
  48. package/dist/Components/DatePicker/ThemeDatePicker.d.ts +8 -4
  49. package/dist/Components/DatePicker/ThemeDatePicker.js +9 -6
  50. package/dist/Components/DatePicker/TimeOnlyPicker.d.ts +9 -5
  51. package/dist/Components/DatePicker/TimeOnlyPicker.js +6 -4
  52. package/dist/Components/DatePicker/TimePickerInput.d.ts +2 -2
  53. package/dist/Components/DatePicker/TimePickerInput.js +6 -5
  54. package/dist/Components/DescriptionList/DescriptionList.d.ts +1 -1
  55. package/dist/Components/DescriptionList/DescriptionList.js +3 -3
  56. package/dist/Components/DescriptionList/DescriptionListProps.d.ts +3 -3
  57. package/dist/Components/Dropdown/DropDown.js +12 -4
  58. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
  59. package/dist/Components/EmptyState/EmptyState.js +2 -2
  60. package/dist/Components/EmptyState/EmptyStateProps.d.ts +3 -3
  61. package/dist/Components/FileUpload/FileUpload.js +21 -15
  62. package/dist/Components/FileUpload/useObjectUrl.d.ts +1 -0
  63. package/dist/Components/FileUpload/useObjectUrl.js +14 -0
  64. package/dist/Components/FileUploader/FileUploader.js +9 -3
  65. package/dist/Components/FileUploader/FileUploaderProps.d.ts +8 -0
  66. package/dist/Components/FilterBar/FilterBar.d.ts +1 -1
  67. package/dist/Components/FilterBar/FilterBar.js +2 -2
  68. package/dist/Components/FilterBar/FilterBarProps.d.ts +3 -3
  69. package/dist/Components/FilterSidebar/FilterSidebar.js +10 -6
  70. package/dist/Components/Form/FormWrapper.js +1 -1
  71. package/dist/Components/FormField/FormField.d.ts +3 -0
  72. package/dist/Components/FormField/FormField.js +57 -0
  73. package/dist/Components/FormField/FormFieldProps.d.ts +33 -0
  74. package/dist/Components/FormField/FormFieldProps.js +2 -0
  75. package/dist/Components/Header/HeaderActions.js +2 -2
  76. package/dist/Components/Header/components/mobileMenu.js +1 -1
  77. package/dist/Components/IconButton/IconButton.d.ts +5 -0
  78. package/dist/Components/IconButton/IconButton.js +24 -0
  79. package/dist/Components/IconButton/IconButtonProps.d.ts +10 -0
  80. package/dist/Components/IconButton/IconButtonProps.js +2 -0
  81. package/dist/Components/Input/PhoneNumberInput.js +14 -0
  82. package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -0
  83. package/dist/Components/KanbanBoard/AccountCard.js +3 -2
  84. package/dist/Components/KanbanBoard/AccountRow.js +1 -1
  85. package/dist/Components/KanbanBoard/KanbanBoard.js +56 -39
  86. package/dist/Components/KanbanBoard/MeasuredItem.js +6 -14
  87. package/dist/Components/KanbanBoard/boardStore.d.ts +8 -0
  88. package/dist/Components/KanbanBoard/boardStore.js +27 -0
  89. package/dist/Components/Kbd/Kbd.js +1 -1
  90. package/dist/Components/LimitReachedModal/LimitReachedModal.js +1 -1
  91. package/dist/Components/Loading/Loading.js +1 -1
  92. package/dist/Components/MediaGallery/MediaGallery.js +1 -1
  93. package/dist/Components/MediaGallery/MediaLightbox.js +2 -1
  94. package/dist/Components/MediaGallery/glass.js +2 -1
  95. package/dist/Components/MediaViewer/MediaViewer.js +1 -1
  96. package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
  97. package/dist/Components/MediaViewer/components/MediaImageViewer.js +1 -1
  98. package/dist/Components/MediaViewer/components/MediaScrubber.js +5 -1
  99. package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
  100. package/dist/Components/MediaViewer/components/PlaybackTimeline.d.ts +20 -0
  101. package/dist/Components/MediaViewer/components/PlaybackTimeline.js +47 -0
  102. package/dist/Components/MediaViewer/components/TileChip.js +1 -1
  103. package/dist/Components/Modal/Modal.js +1 -1
  104. package/dist/Components/MoreItems/MoreItems.js +2 -2
  105. package/dist/Components/NavigationBar/NavigationBar.js +2 -2
  106. package/dist/Components/NoteTextArea/NoteTextArea.js +18 -4
  107. package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +12 -0
  108. package/dist/Components/Notification/Notification.js +17 -3
  109. package/dist/Components/Notification/NotificationProps.d.ts +17 -1
  110. package/dist/Components/NotificationBell/NotificationBell.js +5 -1
  111. package/dist/Components/NotificationBell/NotificationItem.js +1 -1
  112. package/dist/Components/NotificationBell/NotificationList.js +1 -1
  113. package/dist/Components/OffersList/OffersList.js +2 -1
  114. package/dist/Components/OptionChip/OptionChip.js +3 -2
  115. package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
  116. package/dist/Components/OrderSummary/OrderSummary.js +5 -5
  117. package/dist/Components/OrganizationDetails/OrganizationDetails.js +7 -1
  118. package/dist/Components/PageHeader/PageHeader.d.ts +1 -1
  119. package/dist/Components/PageHeader/PageHeader.js +2 -2
  120. package/dist/Components/PageHeader/PageHeaderProps.d.ts +3 -3
  121. package/dist/Components/Pagination/Pagination.d.ts +5 -0
  122. package/dist/Components/Pagination/Pagination.js +48 -0
  123. package/dist/Components/Pagination/PaginationProps.d.ts +46 -0
  124. package/dist/Components/Pagination/PaginationProps.js +9 -0
  125. package/dist/Components/Pagination/pageWindow.d.ts +4 -0
  126. package/dist/Components/Pagination/pageWindow.js +22 -0
  127. package/dist/Components/PaymentOption/PaymentOption.js +1 -1
  128. package/dist/Components/PersonChip/PersonChip.js +2 -2
  129. package/dist/Components/PinInput/PinInput.d.ts +1 -1
  130. package/dist/Components/PinInput/PinInput.js +17 -2
  131. package/dist/Components/PinInput/PinInputProps.d.ts +9 -1
  132. package/dist/Components/PincodeChecker/PincodeChecker.js +4 -4
  133. package/dist/Components/PlanPill/PlanPill.js +2 -1
  134. package/dist/Components/PriceBlock/PriceBlock.js +3 -3
  135. package/dist/Components/Primitives/Primitives.d.ts +2 -2
  136. package/dist/Components/Primitives/Primitives.js +2 -3
  137. package/dist/Components/ProductBadges/ProductBadges.js +2 -1
  138. package/dist/Components/ProductCard/ProductCard.js +1 -1
  139. package/dist/Components/ProductCard/ProductCardAction.js +2 -2
  140. package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
  141. package/dist/Components/ProductCard/cardMetrics.d.ts +1 -1
  142. package/dist/Components/ProductCard/cardMetrics.js +5 -1
  143. package/dist/Components/ProfileCard/ProfileCardProps.d.ts +11 -0
  144. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
  145. package/dist/Components/QuantityStepper/QuantityStepper.js +2 -1
  146. package/dist/Components/RadioButton/RadioButton.d.ts +11 -2
  147. package/dist/Components/RadioButton/RadioButton.js +9 -6
  148. package/dist/Components/RangeSlider/RangeSlider.js +3 -3
  149. package/dist/Components/Rating/Rating.js +2 -1
  150. package/dist/Components/Reorder/Reorder.js +3 -2
  151. package/dist/Components/ReviewList/ReviewList.js +3 -3
  152. package/dist/Components/ReviewSummary/ReviewSummary.js +3 -3
  153. package/dist/Components/SaveBar/SaveBar.d.ts +1 -1
  154. package/dist/Components/SaveBar/SaveBar.js +2 -2
  155. package/dist/Components/SaveBar/SaveBarProps.d.ts +3 -3
  156. package/dist/Components/Search/Search.js +2 -9
  157. package/dist/Components/Search/ctrlShortcut.d.ts +1 -0
  158. package/dist/Components/Search/ctrlShortcut.js +29 -0
  159. package/dist/Components/SearchSelect/SearchSelect.js +117 -30
  160. package/dist/Components/SegmentedControl/SegmentedControl.d.ts +8 -2
  161. package/dist/Components/SegmentedControl/SegmentedControl.js +9 -5
  162. package/dist/Components/Select/SelectPopup.js +6 -4
  163. package/dist/Components/SelectSearch/SelectSearch.js +5 -4
  164. package/dist/Components/SettingRow/SettingRow.js +1 -1
  165. package/dist/Components/SideBar/SecondaryBar.js +2 -1
  166. package/dist/Components/SideBar/SideBar.js +82 -21
  167. package/dist/Components/SideBar/components/MenuItemBox.d.ts +2 -2
  168. package/dist/Components/SideBar/components/MenuItemBox.js +4 -3
  169. package/dist/Components/SideBar/components/MenuItems.d.ts +2 -2
  170. package/dist/Components/SideBar/components/MenuItems.js +3 -3
  171. package/dist/Components/SideBar/components/OtherApps.js +5 -1
  172. package/dist/Components/SideBar/components/OverflowTooltipText.js +4 -5
  173. package/dist/Components/SideBar/components/PinnedSection.js +2 -2
  174. package/dist/Components/SideBar/components/TextTruncation.js +11 -6
  175. package/dist/Components/SideBar/sidebarScale.d.ts +1 -1
  176. package/dist/Components/SideBar/sidebarScale.js +2 -1
  177. package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +8 -0
  178. package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -2
  179. package/dist/Components/Skeletons/Skeletons.d.ts +1 -1
  180. package/dist/Components/Skeletons/Skeletons.js +4 -2
  181. package/dist/Components/SkipLink/SkipLink.d.ts +4 -0
  182. package/dist/Components/SkipLink/SkipLink.js +54 -0
  183. package/dist/Components/SkipLink/SkipLinkProps.d.ts +8 -0
  184. package/dist/Components/SkipLink/SkipLinkProps.js +2 -0
  185. package/dist/Components/Slider/Slider.d.ts +2 -2
  186. package/dist/Components/Slider/Slider.js +11 -4
  187. package/dist/Components/SpecTable/SpecTable.js +2 -1
  188. package/dist/Components/StageProgress/StageItem.js +2 -5
  189. package/dist/Components/StageProgress/StageProgress.js +2 -1
  190. package/dist/Components/StageProgress/StageProgressProps.d.ts +1 -1
  191. package/dist/Components/StageProgress/StepperStage.js +2 -6
  192. package/dist/Components/StageProgress/centerInStrip.d.ts +2 -0
  193. package/dist/Components/StageProgress/centerInStrip.js +15 -0
  194. package/dist/Components/StatCard/StatCard.d.ts +1 -1
  195. package/dist/Components/StatCard/StatCard.js +5 -4
  196. package/dist/Components/StatCard/StatCardProps.d.ts +3 -3
  197. package/dist/Components/StickyBuyBar/StickyBuyBar.js +1 -1
  198. package/dist/Components/Table/components/TableActions.js +40 -24
  199. package/dist/Components/Table/components/TableBody.js +25 -40
  200. package/dist/Components/Table/components/rowMeasurer.d.ts +8 -0
  201. package/dist/Components/Table/components/rowMeasurer.js +71 -0
  202. package/dist/Components/Table/filters/TableFilters.js +2 -13
  203. package/dist/Components/Table/hooks/useTable.js +12 -9
  204. package/dist/Components/Tabs/components/CountBadge.js +3 -3
  205. package/dist/Components/Tabs/components/Tab.d.ts +2 -1
  206. package/dist/Components/Tabs/components/Tab.js +4 -3
  207. package/dist/Components/Tabs/components/TabList.js +16 -1
  208. package/dist/Components/Tag/Tag.d.ts +2 -2
  209. package/dist/Components/Tag/Tag.js +15 -12
  210. package/dist/Components/Tag/Tag.styles.js +6 -4
  211. package/dist/Components/TagInput/TagInput.d.ts +3 -0
  212. package/dist/Components/TagInput/TagInput.js +99 -0
  213. package/dist/Components/TagInput/TagInputProps.d.ts +46 -0
  214. package/dist/Components/TagInput/TagInputProps.js +2 -0
  215. package/dist/Components/TagInput/tagEntries.d.ts +15 -0
  216. package/dist/Components/TagInput/tagEntries.js +45 -0
  217. package/dist/Components/TimePicker/TimePicker.d.ts +3 -0
  218. package/dist/Components/TimePicker/TimePicker.js +50 -0
  219. package/dist/Components/TimePicker/TimePickerProps.d.ts +44 -0
  220. package/dist/Components/TimePicker/TimePickerProps.js +2 -0
  221. package/dist/Components/TimePicker/timeParts.d.ts +10 -0
  222. package/dist/Components/TimePicker/timeParts.js +36 -0
  223. package/dist/Components/Timeline/Timeline.js +11 -9
  224. package/dist/Components/Toaster/Toaster.js +2 -1
  225. package/dist/Components/Toggle/TableToggle.js +4 -3
  226. package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +3 -2
  227. package/dist/Components/ToggleSwitch/ToggleSwitch.js +6 -5
  228. package/dist/Components/ToolTip/ToolTip.js +86 -8
  229. package/dist/Components/UpgradeButton/UpgradeButton.js +4 -2
  230. package/dist/Components/UserDetails/UserDetails.js +7 -1
  231. package/dist/Components/VisuallyHidden/VisuallyHidden.d.ts +15 -0
  232. package/dist/Components/VisuallyHidden/VisuallyHidden.js +21 -0
  233. package/dist/Components/VisuallyHidden/VisuallyHiddenProps.d.ts +3 -0
  234. package/dist/Components/VisuallyHidden/VisuallyHiddenProps.js +2 -0
  235. package/dist/Components/WizardDialog/WizardDialog.js +10 -5
  236. package/dist/Components/WizardDialog/WizardDialogProps.d.ts +4 -0
  237. package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +5 -1
  238. package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +15 -2
  239. package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +2 -1
  240. package/dist/Hooks/sharedResizeObserver.d.ts +6 -0
  241. package/dist/Hooks/sharedResizeObserver.js +77 -0
  242. package/dist/Hooks/useIsTruncated.js +3 -4
  243. package/dist/Theme/chakra/Menu.styles.d.ts +1 -1
  244. package/dist/Theme/chakra/common.web.d.ts +1 -0
  245. package/dist/Theme/chakra/componentStyles.d.ts +1 -1
  246. package/dist/Theme/chakra/createBrandTheme.d.ts +3 -0
  247. package/dist/Theme/chakra/createBrandTheme.js +34 -4
  248. package/dist/Theme/chakra/focusRing.styles.d.ts +2 -0
  249. package/dist/Theme/chakra/focusRing.styles.js +5 -1
  250. package/dist/Theme/chakra/fonts.web.d.ts +2 -0
  251. package/dist/Theme/chakra/motion.d.ts +14 -0
  252. package/dist/Theme/chakra/motion.js +26 -1
  253. package/dist/Theme/index.d.ts +2 -1
  254. package/dist/Theme/index.js +12 -9
  255. package/dist/Theme/provider/PixelizeThemeProvider.d.ts +4 -1
  256. package/dist/Theme/provider/PixelizeThemeProvider.js +21 -12
  257. package/dist/Theme/provider/ThemeSwitcher.js +3 -2
  258. package/dist/Theme/themeProps.d.ts +3 -0
  259. package/dist/Theme/tokens/brands/emerald/palette.dark.js +2 -1
  260. package/dist/Theme/tokens/brands/index.d.ts +1 -1
  261. package/dist/Theme/tokens/brands/index.js +14 -13
  262. package/dist/Theme/tokens/brands/lavender/palette.dark.js +2 -1
  263. package/dist/Theme/tokens/brands/meadow/palette.dark.js +2 -1
  264. package/dist/Theme/tokens/brands/radiant/palette.dark.js +2 -1
  265. package/dist/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
  266. package/dist/Theme/tokens/brands/skyline/palette.dark.js +2 -1
  267. package/dist/Theme/tokens/brands/slate/palette.dark.js +2 -1
  268. package/dist/Theme/tokens/brands/storefront/palette.dark.js +2 -1
  269. package/dist/Theme/tokens/brands/zinc/palette.dark.js +28 -24
  270. package/dist/Theme/tokens/builders/color.js +11 -7
  271. package/dist/Theme/tokens/builders/filledSurface.d.ts +3 -1
  272. package/dist/Theme/tokens/builders/filledSurface.js +7 -7
  273. package/dist/Theme/tokens/builders/lazy.d.ts +5 -0
  274. package/dist/Theme/tokens/builders/lazy.js +55 -0
  275. package/dist/Theme/tokens/builders/memo.d.ts +9 -0
  276. package/dist/Theme/tokens/builders/memo.js +28 -0
  277. package/dist/Theme/tokens/builders/memoByReads.d.ts +2 -0
  278. package/dist/Theme/tokens/builders/memoByReads.js +50 -0
  279. package/dist/Theme/tokens/builders/outlineRung.js +10 -2
  280. package/dist/Theme/tokens/builders/tone.js +5 -4
  281. package/dist/Theme/tokens/primitives/borderWidths.d.ts +6 -0
  282. package/dist/Theme/tokens/primitives/borderWidths.js +5 -0
  283. package/dist/Theme/tokens/primitives/index.d.ts +8 -3
  284. package/dist/Theme/tokens/primitives/index.js +8 -1
  285. package/dist/Theme/tokens/primitives/motion.d.ts +25 -2
  286. package/dist/Theme/tokens/primitives/motion.js +23 -5
  287. package/dist/Theme/tokens/primitives/optionRowSizes.d.ts +1 -1
  288. package/dist/Theme/tokens/primitives/optionRowSizes.js +2 -1
  289. package/dist/Theme/tokens/primitives/radii.d.ts +15 -0
  290. package/dist/Theme/tokens/primitives/radii.js +14 -0
  291. package/dist/Theme/tokens/primitives/shadows.d.ts +5 -1
  292. package/dist/Theme/tokens/primitives/shadows.js +5 -1
  293. package/dist/Theme/tokens/primitives/states.d.ts +1 -0
  294. package/dist/Theme/tokens/primitives/states.js +4 -0
  295. package/dist/Theme/tokens/primitives/typography.d.ts +17 -0
  296. package/dist/Theme/tokens/primitives/typography.js +21 -1
  297. package/dist/Theme/tokens/primitives/zIndices.d.ts +1 -0
  298. package/dist/Theme/tokens/primitives/zIndices.js +1 -0
  299. package/dist/Utils/formatDate.d.ts +25 -0
  300. package/dist/Utils/formatDate.js +144 -0
  301. package/dist/esm/Components/Accordion/Accordion.js +2 -2
  302. package/dist/esm/Components/AddressCard/AddressCard.js +2 -1
  303. package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
  304. package/dist/esm/Components/AppSwitcher/AppSwitcher.js +1 -1
  305. package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +1 -1
  306. package/dist/esm/Components/AudioRecorder/AudioRecorder.js +2 -1
  307. package/dist/esm/Components/Avatar/Avatar.js +6 -4
  308. package/dist/esm/Components/Backdrop/Backdrop.js +1 -1
  309. package/dist/esm/Components/BagBar/BagBar.js +2 -1
  310. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
  311. package/dist/esm/Components/CalendarGrid/CalendarGrid.js +6 -6
  312. package/dist/esm/Components/CalendarGrid/calendarMath.js +18 -6
  313. package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +6 -5
  314. package/dist/esm/Components/CartItem/CartItem.js +2 -1
  315. package/dist/esm/Components/Checkbox/Checkbox.js +8 -5
  316. package/dist/esm/Components/CheckoutKit/selectable.js +1 -1
  317. package/dist/esm/Components/ChoiceCard/ChoiceCard.js +14 -0
  318. package/dist/esm/Components/ChoiceCard/ChoiceCardGroup.js +4 -0
  319. package/dist/esm/Components/ChoiceCard/ChoiceCardProps.js +1 -0
  320. package/dist/esm/Components/CircularProgress/CircularProgress.js +5 -9
  321. package/dist/esm/Components/CircularProgress/arc.js +13 -0
  322. package/dist/esm/Components/Common/FormLabel.js +1 -1
  323. package/dist/esm/Components/Common/FormattedDescription.js +1 -1
  324. package/dist/esm/Components/Common/HelperText.js +11 -8
  325. package/dist/esm/Components/Common/fieldStyles.js +2 -1
  326. package/dist/esm/Components/ContactForm/ContactForm.js +1 -1
  327. package/dist/esm/Components/CopyButton/CopyButton.js +14 -7
  328. package/dist/esm/Components/CouponField/CouponField.js +4 -3
  329. package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
  330. package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -2
  331. package/dist/esm/Components/DatePicker/DatePicker.js +8 -2
  332. package/dist/esm/Components/DatePicker/RangeDatePicker.js +8 -6
  333. package/dist/esm/Components/DatePicker/SingleDatePicker.js +7 -4
  334. package/dist/esm/Components/DatePicker/ThemeDatePicker.js +7 -4
  335. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +5 -3
  336. package/dist/esm/Components/DatePicker/TimePickerInput.js +8 -6
  337. package/dist/esm/Components/DescriptionList/DescriptionList.js +3 -3
  338. package/dist/esm/Components/Dropdown/DropDown.js +12 -4
  339. package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
  340. package/dist/esm/Components/EmptyState/EmptyState.js +2 -2
  341. package/dist/esm/Components/FileUpload/FileUpload.js +21 -15
  342. package/dist/esm/Components/FileUpload/useObjectUrl.js +10 -0
  343. package/dist/esm/Components/FileUploader/FileUploader.js +9 -3
  344. package/dist/esm/Components/FilterBar/FilterBar.js +2 -2
  345. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +10 -6
  346. package/dist/esm/Components/Form/FormWrapper.js +1 -1
  347. package/dist/esm/Components/FormField/FormField.js +52 -0
  348. package/dist/esm/Components/FormField/FormFieldProps.js +1 -0
  349. package/dist/esm/Components/Header/HeaderActions.js +2 -2
  350. package/dist/esm/Components/Header/components/mobileMenu.js +1 -1
  351. package/dist/esm/Components/IconButton/IconButton.js +21 -0
  352. package/dist/esm/Components/IconButton/IconButtonProps.js +1 -0
  353. package/dist/esm/Components/Input/PhoneNumberInput.js +15 -1
  354. package/dist/esm/Components/KanbanBoard/AccountCard.js +3 -2
  355. package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -1
  356. package/dist/esm/Components/KanbanBoard/KanbanBoard.js +56 -39
  357. package/dist/esm/Components/KanbanBoard/MeasuredItem.js +6 -14
  358. package/dist/esm/Components/KanbanBoard/boardStore.js +22 -0
  359. package/dist/esm/Components/Kbd/Kbd.js +1 -1
  360. package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +1 -1
  361. package/dist/esm/Components/Loading/Loading.js +1 -1
  362. package/dist/esm/Components/MediaGallery/MediaGallery.js +2 -2
  363. package/dist/esm/Components/MediaGallery/MediaLightbox.js +2 -1
  364. package/dist/esm/Components/MediaGallery/glass.js +2 -1
  365. package/dist/esm/Components/MediaViewer/MediaViewer.js +1 -1
  366. package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
  367. package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +1 -1
  368. package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +5 -1
  369. package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
  370. package/dist/esm/Components/MediaViewer/components/PlaybackTimeline.js +38 -0
  371. package/dist/esm/Components/MediaViewer/components/TileChip.js +1 -1
  372. package/dist/esm/Components/Modal/Modal.js +1 -1
  373. package/dist/esm/Components/MoreItems/MoreItems.js +2 -2
  374. package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -2
  375. package/dist/esm/Components/NoteTextArea/NoteTextArea.js +18 -4
  376. package/dist/esm/Components/Notification/Notification.js +17 -3
  377. package/dist/esm/Components/NotificationBell/NotificationBell.js +2 -1
  378. package/dist/esm/Components/NotificationBell/NotificationItem.js +1 -1
  379. package/dist/esm/Components/NotificationBell/NotificationList.js +1 -1
  380. package/dist/esm/Components/OffersList/OffersList.js +2 -1
  381. package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
  382. package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
  383. package/dist/esm/Components/OrderSummary/OrderSummary.js +5 -5
  384. package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +7 -1
  385. package/dist/esm/Components/PageHeader/PageHeader.js +2 -2
  386. package/dist/esm/Components/Pagination/Pagination.js +42 -0
  387. package/dist/esm/Components/Pagination/PaginationProps.js +6 -0
  388. package/dist/esm/Components/Pagination/pageWindow.js +16 -0
  389. package/dist/esm/Components/PaymentOption/PaymentOption.js +1 -1
  390. package/dist/esm/Components/PersonChip/PersonChip.js +2 -2
  391. package/dist/esm/Components/PinInput/PinInput.js +14 -2
  392. package/dist/esm/Components/PincodeChecker/PincodeChecker.js +4 -4
  393. package/dist/esm/Components/PlanPill/PlanPill.js +2 -1
  394. package/dist/esm/Components/PriceBlock/PriceBlock.js +3 -3
  395. package/dist/esm/Components/Primitives/Primitives.js +1 -1
  396. package/dist/esm/Components/ProductBadges/ProductBadges.js +2 -1
  397. package/dist/esm/Components/ProductCard/ProductCard.js +1 -1
  398. package/dist/esm/Components/ProductCard/ProductCardAction.js +3 -3
  399. package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
  400. package/dist/esm/Components/ProductCard/cardMetrics.js +2 -1
  401. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
  402. package/dist/esm/Components/QuantityStepper/QuantityStepper.js +2 -1
  403. package/dist/esm/Components/RadioButton/RadioButton.js +7 -4
  404. package/dist/esm/Components/RangeSlider/RangeSlider.js +3 -3
  405. package/dist/esm/Components/Rating/Rating.js +2 -1
  406. package/dist/esm/Components/Reorder/Reorder.js +3 -2
  407. package/dist/esm/Components/ReviewList/ReviewList.js +3 -3
  408. package/dist/esm/Components/ReviewSummary/ReviewSummary.js +3 -3
  409. package/dist/esm/Components/SaveBar/SaveBar.js +2 -2
  410. package/dist/esm/Components/Search/Search.js +2 -9
  411. package/dist/esm/Components/Search/ctrlShortcut.js +25 -0
  412. package/dist/esm/Components/SearchSelect/SearchSelect.js +120 -33
  413. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +11 -6
  414. package/dist/esm/Components/Select/SelectPopup.js +6 -4
  415. package/dist/esm/Components/SelectSearch/SelectSearch.js +5 -4
  416. package/dist/esm/Components/SettingRow/SettingRow.js +1 -1
  417. package/dist/esm/Components/SideBar/SecondaryBar.js +2 -1
  418. package/dist/esm/Components/SideBar/SideBar.js +83 -22
  419. package/dist/esm/Components/SideBar/components/MenuItemBox.js +4 -3
  420. package/dist/esm/Components/SideBar/components/MenuItems.js +4 -4
  421. package/dist/esm/Components/SideBar/components/OtherApps.js +2 -1
  422. package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +4 -5
  423. package/dist/esm/Components/SideBar/components/PinnedSection.js +2 -2
  424. package/dist/esm/Components/SideBar/components/TextTruncation.js +9 -7
  425. package/dist/esm/Components/SideBar/sidebarScale.js +2 -1
  426. package/dist/esm/Components/Skeletons/Skeletons.js +4 -2
  427. package/dist/esm/Components/SkipLink/SkipLink.js +50 -0
  428. package/dist/esm/Components/SkipLink/SkipLinkProps.js +1 -0
  429. package/dist/esm/Components/Slider/Slider.js +11 -4
  430. package/dist/esm/Components/SpecTable/SpecTable.js +2 -1
  431. package/dist/esm/Components/StageProgress/StageItem.js +2 -5
  432. package/dist/esm/Components/StageProgress/StageProgress.js +2 -1
  433. package/dist/esm/Components/StageProgress/StepperStage.js +2 -6
  434. package/dist/esm/Components/StageProgress/centerInStrip.js +11 -0
  435. package/dist/esm/Components/StatCard/StatCard.js +5 -4
  436. package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -2
  437. package/dist/esm/Components/Table/components/TableActions.js +42 -26
  438. package/dist/esm/Components/Table/components/TableBody.js +25 -40
  439. package/dist/esm/Components/Table/components/rowMeasurer.js +66 -0
  440. package/dist/esm/Components/Table/filters/TableFilters.js +3 -14
  441. package/dist/esm/Components/Table/hooks/useTable.js +12 -9
  442. package/dist/esm/Components/Tabs/components/CountBadge.js +3 -3
  443. package/dist/esm/Components/Tabs/components/Tab.js +5 -4
  444. package/dist/esm/Components/Tabs/components/TabList.js +16 -1
  445. package/dist/esm/Components/Tag/Tag.js +11 -8
  446. package/dist/esm/Components/Tag/Tag.styles.js +6 -4
  447. package/dist/esm/Components/TagInput/TagInput.js +94 -0
  448. package/dist/esm/Components/TagInput/TagInputProps.js +1 -0
  449. package/dist/esm/Components/TagInput/tagEntries.js +39 -0
  450. package/dist/esm/Components/TimePicker/TimePicker.js +45 -0
  451. package/dist/esm/Components/TimePicker/TimePickerProps.js +1 -0
  452. package/dist/esm/Components/TimePicker/timeParts.js +26 -0
  453. package/dist/esm/Components/Timeline/Timeline.js +11 -9
  454. package/dist/esm/Components/Toaster/Toaster.js +2 -1
  455. package/dist/esm/Components/Toggle/TableToggle.js +4 -3
  456. package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +7 -5
  457. package/dist/esm/Components/ToolTip/ToolTip.js +89 -11
  458. package/dist/esm/Components/UpgradeButton/UpgradeButton.js +4 -2
  459. package/dist/esm/Components/UserDetails/UserDetails.js +7 -1
  460. package/dist/esm/Components/VisuallyHidden/VisuallyHidden.js +18 -0
  461. package/dist/esm/Components/VisuallyHidden/VisuallyHiddenProps.js +1 -0
  462. package/dist/esm/Components/WizardDialog/WizardDialog.js +11 -6
  463. package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +2 -1
  464. package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +13 -3
  465. package/dist/esm/Hooks/sharedResizeObserver.js +73 -0
  466. package/dist/esm/Hooks/useIsTruncated.js +3 -4
  467. package/dist/esm/Theme/chakra/createBrandTheme.js +34 -4
  468. package/dist/esm/Theme/chakra/focusRing.styles.js +3 -0
  469. package/dist/esm/Theme/chakra/motion.js +25 -0
  470. package/dist/esm/Theme/index.js +12 -9
  471. package/dist/esm/Theme/provider/PixelizeThemeProvider.js +22 -13
  472. package/dist/esm/Theme/provider/ThemeSwitcher.js +3 -2
  473. package/dist/esm/Theme/tokens/brands/emerald/palette.dark.js +2 -1
  474. package/dist/esm/Theme/tokens/brands/index.js +14 -13
  475. package/dist/esm/Theme/tokens/brands/lavender/palette.dark.js +2 -1
  476. package/dist/esm/Theme/tokens/brands/meadow/palette.dark.js +2 -1
  477. package/dist/esm/Theme/tokens/brands/radiant/palette.dark.js +2 -1
  478. package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
  479. package/dist/esm/Theme/tokens/brands/skyline/palette.dark.js +2 -1
  480. package/dist/esm/Theme/tokens/brands/slate/palette.dark.js +2 -1
  481. package/dist/esm/Theme/tokens/brands/storefront/palette.dark.js +2 -1
  482. package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +28 -24
  483. package/dist/esm/Theme/tokens/builders/color.js +10 -6
  484. package/dist/esm/Theme/tokens/builders/filledSurface.js +7 -7
  485. package/dist/esm/Theme/tokens/builders/lazy.js +49 -0
  486. package/dist/esm/Theme/tokens/builders/memo.js +21 -0
  487. package/dist/esm/Theme/tokens/builders/memoByReads.js +46 -0
  488. package/dist/esm/Theme/tokens/builders/outlineRung.js +10 -2
  489. package/dist/esm/Theme/tokens/builders/tone.js +5 -4
  490. package/dist/esm/Theme/tokens/primitives/borderWidths.js +2 -0
  491. package/dist/esm/Theme/tokens/primitives/index.js +5 -3
  492. package/dist/esm/Theme/tokens/primitives/motion.js +20 -4
  493. package/dist/esm/Theme/tokens/primitives/optionRowSizes.js +2 -1
  494. package/dist/esm/Theme/tokens/primitives/radii.js +13 -0
  495. package/dist/esm/Theme/tokens/primitives/shadows.js +3 -1
  496. package/dist/esm/Theme/tokens/primitives/states.js +1 -0
  497. package/dist/esm/Theme/tokens/primitives/typography.js +20 -0
  498. package/dist/esm/Theme/tokens/primitives/zIndices.js +1 -0
  499. package/dist/esm/Utils/formatDate.js +138 -0
  500. package/dist/esm/index.js +18 -2
  501. package/dist/index.d.ts +33 -5
  502. package/dist/index.js +47 -4
  503. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect, useCallback, forwardRef } from "react";
2
+ import { useState, useEffect, useCallback, forwardRef, useRef } from "react";
3
3
  import { Box, Flex, Icon, Input, Select, InputGroup, InputLeftElement, FormControl, } from "@chakra-ui/react";
4
4
  import ErrorMessage from "../Common/ErrorMessage.js";
5
5
  import HelperText from "../Common/HelperText.js";
@@ -28,6 +28,20 @@ const PhoneNumberInput = forwardRef(function PhoneNumberInput({ size = "sm", val
28
28
  const [number, setNumber] = useState(value);
29
29
  const [selectedCountry, setSelectedCountry] = useState(country);
30
30
  const [countryCode, setCountryCode] = useState(country);
31
+ const countryCodeRef = useRef(countryCode);
32
+ countryCodeRef.current = countryCode;
33
+ const firstValue = useRef(true);
34
+ useEffect(() => {
35
+ if (firstValue.current) {
36
+ firstValue.current = false;
37
+ return;
38
+ }
39
+ if (value === undefined)
40
+ return;
41
+ const dial = countryCodeRef.current;
42
+ const digits = dial && value.startsWith(`${dial} `) ? value.slice(dial.length + 1) : value;
43
+ setNumber(digits);
44
+ }, [value]);
31
45
  useEffect(() => {
32
46
  if (country) {
33
47
  const code = getCountryTelCode(country);
@@ -6,6 +6,7 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
6
  import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
7
7
  import { resolveSoftTone } from "../../Theme/tokens/builders/tone.js";
8
8
  import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
9
+ import { BORDER_WIDTHS } from "../../Theme/tokens/primitives/borderWidths.js";
9
10
  import { reducedMotionSx } from "../../Theme/chakra/motion.js";
10
11
  import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
11
12
  import AccountRow from "./AccountRow.js";
@@ -20,11 +21,11 @@ const AccountCard = React.memo(({ account, onDelete, onOpen, isExpanded = false,
20
21
  const handleToggle = () => {
21
22
  onToggleExpand === null || onToggleExpand === void 0 ? void 0 : onToggleExpand();
22
23
  };
23
- return (_jsx(Box, { role: "group", width: "100%", borderRadius: "xl", background: colors.background[50], border: `0.063rem solid ${colors.boxborder[200]}`, p: 3, boxSizing: "border-box", minHeight: isExpanded ? "11.25rem" : "5rem", transition: transitionFor(["border-color", "box-shadow", "transform"]), sx: reducedMotionSx({ transform: "none" }), _hover: {
24
+ return (_jsx(Box, { role: "group", width: "100%", borderRadius: "xl", background: colors.background[50], border: `${BORDER_WIDTHS.hairline} solid ${colors.boxborder[200]}`, p: 3, boxSizing: "border-box", minHeight: isExpanded ? "11.25rem" : "5rem", transition: transitionFor(["border-color", "box-shadow", "transform"]), sx: reducedMotionSx({ transform: "none" }), _hover: {
24
25
  borderColor: colors.primary[300],
25
26
  boxShadow: "md",
26
27
  transform: "translateY(-0.063rem)",
27
- }, children: _jsxs(VStack, { align: "stretch", spacing: 1, fontSize: "0.875rem", color: colors.text[500], children: [visibleKeys.map((key) => (_jsx(AccountRow, { label: key.replace(/\b\w/g, (c) => c.toUpperCase()), value: account[key] }, key))), _jsx(Collapse, { in: isExpanded && account.details !== undefined, animateOpacity: true, children: _jsx(Text, { pt: 2, fontSize: "0.8125rem", color: colors.text[600], children: account.details }) }), _jsxs(Flex, { justify: "space-between", w: "full", pt: 2, alignItems: "center", children: [keys.length > 4 ? (_jsxs(Text, { as: "button", type: "button", "aria-expanded": isExpanded, color: colors.accentText, fontSize: "0.75rem", fontWeight: 600, cursor: "pointer", onClick: handleToggle, display: "flex", alignItems: "center", gap: 1, borderRadius: "sm", _hover: { textDecoration: "underline" }, sx: focusVisibleStyles(colors), children: ["Show ", isExpanded ? "less" : "more", " ", isExpanded ? _jsx(ChevronUp, { size: 13 }) : _jsx(ChevronDown, { size: 13 })] })) : (_jsx(Spacer, {})), _jsxs(HStack, { spacing: 1, opacity: 0, transition: transitionFor(["opacity"]), _groupHover: { opacity: 1 }, _groupFocusWithin: { opacity: 1 }, sx: reducedMotionSx(), children: [isDeletable && (_jsx(Tooltip, { label: "Delete", hasArrow: true, children: _jsx(Flex, { as: "button", type: "button", align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "lg", cursor: "pointer", color: colors.textMuted, transition: ACTION_TRANSITION, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, _hover: { bg: errorTone.bg, color: errorTone.fg }, onClick: () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(account), "aria-label": "Delete", children: _jsx(Trash2, { size: 15 }) }) })), _jsx(Tooltip, { label: "Open", hasArrow: true, children: _jsx(Flex, { as: "button", type: "button", align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "lg", cursor: "pointer", color: colors.textMuted, transition: ACTION_TRANSITION, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, _hover: {
28
+ }, children: _jsxs(VStack, { align: "stretch", spacing: 1, fontSize: "sm", color: colors.text[500], children: [visibleKeys.map((key) => (_jsx(AccountRow, { label: key.replace(/\b\w/g, (c) => c.toUpperCase()), value: account[key] }, key))), _jsx(Collapse, { in: isExpanded && account.details !== undefined, animateOpacity: true, children: _jsx(Text, { pt: 2, fontSize: "xs-plus", color: colors.text[600], children: account.details }) }), _jsxs(Flex, { justify: "space-between", w: "full", pt: 2, alignItems: "center", children: [keys.length > 4 ? (_jsxs(Text, { as: "button", type: "button", "aria-expanded": isExpanded, color: colors.accentText, fontSize: "xs", fontWeight: 600, cursor: "pointer", onClick: handleToggle, display: "flex", alignItems: "center", gap: 1, borderRadius: "sm", _hover: { textDecoration: "underline" }, sx: focusVisibleStyles(colors), children: ["Show ", isExpanded ? "less" : "more", " ", isExpanded ? _jsx(ChevronUp, { size: 13 }) : _jsx(ChevronDown, { size: 13 })] })) : (_jsx(Spacer, {})), _jsxs(HStack, { spacing: 1, opacity: 0, transition: transitionFor(["opacity"]), _groupHover: { opacity: 1 }, _groupFocusWithin: { opacity: 1 }, sx: reducedMotionSx(), children: [isDeletable && (_jsx(Tooltip, { label: "Delete", hasArrow: true, children: _jsx(Flex, { as: "button", type: "button", align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "lg", cursor: "pointer", color: colors.textMuted, transition: ACTION_TRANSITION, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, _hover: { bg: errorTone.bg, color: errorTone.fg }, onClick: () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(account), "aria-label": "Delete", children: _jsx(Trash2, { size: 15 }) }) })), _jsx(Tooltip, { label: "Open", hasArrow: true, children: _jsx(Flex, { as: "button", type: "button", align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "lg", cursor: "pointer", color: colors.textMuted, transition: ACTION_TRANSITION, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, _hover: {
28
29
  bg: colors.primary[50],
29
30
  color: accentTextOnCanvas(colors.primary, colors.primary[50]),
30
31
  }, onClick: () => onOpen === null || onOpen === void 0 ? void 0 : onOpen(account), "aria-label": "Open", children: _jsx(ExternalLink, { size: 15 }) }) })] })] })] }) }));
@@ -5,6 +5,6 @@ import { toWords } from "../../Utils/functions.js";
5
5
  /** Renders one label:value row; `label` is re-run through `toWords`, which splits snake_case, kebab-case and camelCase. */
6
6
  const AccountRow = ({ label, value }) => {
7
7
  const { colors } = useCustomTheme();
8
- return (_jsxs(Flex, { w: "full", gap: 1, children: [_jsx(Tooltip, { label: label, isDisabled: label.length <= 15, hasArrow: true, children: _jsx(Text, { color: colors.text[700], w: "30%", noOfLines: 1, fontSize: "0.75rem", children: toWords(label) }) }), _jsx(Text, { w: "0.75rem", textAlign: "center", fontSize: "0.75rem", children: ":" }), _jsx(Tooltip, { label: value, isDisabled: value.length <= 17, hasArrow: true, children: _jsx(Text, { fontWeight: 600, color: colors.text[800], w: "calc(55% - 0.625rem)", noOfLines: 1, fontSize: "0.75rem", children: value }) })] }));
8
+ return (_jsxs(Flex, { w: "full", gap: 1, children: [_jsx(Tooltip, { label: label, isDisabled: label.length <= 15, hasArrow: true, children: _jsx(Text, { color: colors.text[700], w: "30%", noOfLines: 1, fontSize: "xs", children: toWords(label) }) }), _jsx(Text, { w: "0.75rem", textAlign: "center", fontSize: "xs", children: ":" }), _jsx(Tooltip, { label: value, isDisabled: value.length <= 17, hasArrow: true, children: _jsx(Text, { fontWeight: 600, color: colors.text[800], w: "calc(55% - 0.625rem)", noOfLines: 1, fontSize: "xs", children: value }) })] }));
9
9
  };
10
10
  export default AccountRow;
@@ -7,6 +7,7 @@ import { VariableSizeList as List, } from "react-window";
7
7
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
8
8
  import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
9
9
  import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
10
+ import { BORDER_WIDTHS } from "../../Theme/tokens/primitives/borderWidths.js";
10
11
  import { reducedMotionSx } from "../../Theme/chakra/motion.js";
11
12
  import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
12
13
  import { useGetPreferences, useSavePreferences, } from "../../Hooks/usePreferences.js";
@@ -16,6 +17,7 @@ import MeasuredItem from "./MeasuredItem.js";
16
17
  import OverflowTooltipText from "../SideBar/components/OverflowTooltipText.js";
17
18
  import Button from "../Button/Button.js";
18
19
  import { rafThrottle } from "../../Utils/rafThrottle.js";
20
+ import { createBoardStore, useBoardStore } from "./boardStore.js";
19
21
  /** Narrow rail width when a column is horizontally collapsed. */
20
22
  const COLLAPSED_KANBAN_COLUMN_WIDTH = "2.75rem";
21
23
  const CARD_LABEL_EXCLUDE = ["id", "details"];
@@ -33,21 +35,31 @@ const MIN_LIST_HEIGHT = 120;
33
35
  const KANBAN_VIRTUALIZE_THRESHOLD = 30;
34
36
  const COLUMN_TRANSITION = `${transitionFor(["background-color", "border-color"])}, ${transitionFor(["width"], "base")}`;
35
37
  const SKELETON_ROWS = [3, 4, 3];
36
- const CardSkeleton = ({ colors, rows }) => (_jsx(Box, { "data-testid": "kanban-card-skeleton", borderRadius: "lg", bg: colors.background[50], border: `0.063rem solid ${colors.boxborder[200]}`, p: 3, minH: "5rem", children: _jsx(Flex, { direction: "column", gap: 2.5, children: Array.from({ length: rows }).map((_, i) => (_jsxs(Flex, { gap: 2, align: "center", children: [_jsx(Skeleton, { h: 2.5, w: "30%", borderRadius: "sm" }), _jsx(Skeleton, { h: 2.5, flex: "1", maxW: i % 2 ? "40%" : "55%", borderRadius: "sm" })] }, i))) }) }));
38
+ const CardSkeleton = ({ colors, rows }) => (_jsx(Box, { "data-testid": "kanban-card-skeleton", borderRadius: "lg", bg: colors.background[50], border: `${BORDER_WIDTHS.hairline} solid ${colors.boxborder[200]}`, p: 3, minH: "5rem", children: _jsx(Flex, { direction: "column", gap: 2.5, children: Array.from({ length: rows }).map((_, i) => (_jsxs(Flex, { gap: 2, align: "center", children: [_jsx(Skeleton, { h: 2.5, w: "30%", borderRadius: "sm" }), _jsx(Skeleton, { h: 2.5, flex: "1", maxW: i % 2 ? "40%" : "55%", borderRadius: "sm" })] }, i))) }) }));
37
39
  // Top buffer above the first card so its border + hover lift aren't clipped by the
38
40
  // scroll/virtualized list's top edge.
39
41
  const KANBAN_LIST_TOP_PAD = 6;
42
+ const KanbanCardBody = ({ account, index, colId, canDelete, onDelete, onOpen, expandedStore, toggleExpand, }) => {
43
+ const isExpanded = useBoardStore(expandedStore, (expanded) => expanded[account.id]);
44
+ const onToggleExpand = useCallback(() => toggleExpand(account.id, colId, index), [toggleExpand, account.id, colId, index]);
45
+ if (account.customNode)
46
+ return _jsx(_Fragment, { children: account.customNode() });
47
+ return (_jsx(AccountCard, { account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: isExpanded, onToggleExpand: onToggleExpand, isDeletable: canDelete }));
48
+ };
49
+ const ColumnDeleteAll = ({ colId, title, hoveredColumn, colors, onDelete }) => {
50
+ const isHovered = useBoardStore(hoveredColumn, (hovered) => hovered === colId);
51
+ if (!isHovered)
52
+ return _jsx(Box, { boxSize: 4, flexShrink: 0 });
53
+ return (_jsx(Box, { as: "button", type: "button", "aria-label": `Delete all cards in ${title}`, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: 4, borderRadius: "sm", cursor: "pointer", color: colors.text[600], _hover: { color: colors.semanticText.error }, onClick: () => onDelete(colId), transition: transitionFor(["color"]), sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, flexShrink: 0, children: _jsx(Trash2, { size: 16 }) }));
54
+ };
40
55
  const KanbanRow = React.memo(({ index, style, data }) => {
41
56
  const { colors: rowColors } = useCustomTheme();
42
- const { items, colId, canDrag, expanded, onDelete, onOpen, canDelete, setSize, toggleExpand } = data;
57
+ const { items, colId, canDrag, expandedStore, onDelete, onOpen, canDelete, setSize, toggleExpand } = data;
43
58
  const account = items[index];
44
59
  if (!account) {
45
60
  return _jsx("div", { style: style });
46
61
  }
47
- return (_jsx("div", { style: style, children: _jsx("div", { style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 }, children: _jsx(MeasuredItem, { index: index, setSize: (i, h) => setSize(i, h, colId), children: _jsx(Draggable, { draggableId: account.id.toString(), index: index, isDragDisabled: !canDrag, children: (provided) => {
48
- var _a;
49
- return (_jsx(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, "aria-label": getCardAccessibleName(account), style: provided.draggableProps.style, borderRadius: "lg", sx: focusVisibleStyles(rowColors), children: (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (_jsx(AccountCard, { account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: () => toggleExpand(account.id, colId, index), isDeletable: canDelete }, account.id)) }));
50
- } }, account.id) }) }) }));
62
+ return (_jsx("div", { style: style, children: _jsx("div", { style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 }, children: _jsx(MeasuredItem, { index: index, setSize: (i, h) => setSize(i, h, colId), children: _jsx(Draggable, { draggableId: account.id.toString(), index: index, isDragDisabled: !canDrag, children: (provided) => (_jsx(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, "aria-label": getCardAccessibleName(account), style: provided.draggableProps.style, borderRadius: "lg", sx: focusVisibleStyles(rowColors), children: _jsx(KanbanCardBody, { account: account, index: index, colId: colId, canDelete: canDelete, onDelete: onDelete, onOpen: onOpen, expandedStore: expandedStore, toggleExpand: toggleExpand }) })) }, account.id) }) }) }));
51
63
  });
52
64
  const NoItemsTemplate = React.memo(({ column, noItems, colors }) => (_jsx(Box, { children: _jsxs(Flex, { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2, children: [_jsx(Text, { fontSize: "sm", color: colors.text[600], textAlign: "center", mt: 4, children: (noItems === null || noItems === void 0 ? void 0 : noItems.text) || "No items in this column" }), !(noItems === null || noItems === void 0 ? void 0 : noItems.isEmptyTextOnly) && (_jsx(Button, { onClick: () => { var _a; return (_a = noItems === null || noItems === void 0 ? void 0 : noItems.onClick) === null || _a === void 0 ? void 0 : _a.call(noItems, column); }, size: "xs", children: (noItems === null || noItems === void 0 ? void 0 : noItems.buttonText) || "Add Item" }))] }) })));
53
65
  function reorderColumnEntries(entries, startIndex, endIndex) {
@@ -97,20 +109,21 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
97
109
  kanbanPreferencesJsonRef.current = kanbanPreferencesJson;
98
110
  const isBoardLoading = isLoading || (Boolean(preferences.baseurl) && preferencesLoading);
99
111
  const [columns, setColumns] = useState(mergedColumns);
112
+ const [adoptedColumns, setAdoptedColumns] = useState(mergedColumns);
100
113
  const [viewportHeight, setViewportHeight] = useState(600);
101
114
  const [measuredHeight, setMeasuredHeight] = useState(0);
102
- const [hoveredColumn, setHoveredColumn] = useState(null);
103
- useEffect(() => {
115
+ const [hoveredColumn] = useState(() => createBoardStore(null));
116
+ if (adoptedColumns !== mergedColumns) {
117
+ setAdoptedColumns(mergedColumns);
104
118
  setColumns(mergedColumns);
105
- }, [mergedColumns]);
119
+ }
106
120
  // Responsive column width
107
121
  const columnWidth = useBreakpointValue({
108
122
  base: "16rem",
109
123
  md: "17.5rem",
110
124
  lg: "19rem",
111
125
  });
112
- // track expanded cards
113
- const [expanded, setExpanded] = useState({});
126
+ const [expandedStore] = useState(() => createBoardStore({}));
114
127
  /** When true, column id maps to collapsed (body hidden). */
115
128
  const [collapsedColumns, setCollapsedColumns] = useState(() => ({ ...defaultCollapsedColumns }));
116
129
  const hasHydratedCollapsedFromPrefs = useRef(false);
@@ -291,14 +304,12 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
291
304
  // toggle expand/collapse — memoized so it doesn't bust `rowBaseProps`/itemData
292
305
  // every render (which would re-render every virtualized row).
293
306
  const toggleExpand = useCallback((id, colId, index) => {
294
- setExpanded((prev) => {
295
- const newExpanded = { ...prev, [id]: !prev[id] };
296
- if (listRefs.current[colId]) {
297
- listRefs.current[colId].resetAfterIndex(index);
298
- }
299
- return newExpanded;
300
- });
301
- }, []);
307
+ const expanded = expandedStore.get();
308
+ expandedStore.set({ ...expanded, [id]: !expanded[id] });
309
+ if (listRefs.current[colId]) {
310
+ listRefs.current[colId].resetAfterIndex(index);
311
+ }
312
+ }, [expandedStore]);
302
313
  // drag handler
303
314
  const onDragEnd = useCallback((result) => {
304
315
  const { source, destination, type } = result;
@@ -365,15 +376,14 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
365
376
  }, [columns, onColumnDelete]);
366
377
  const rowBaseProps = useMemo(() => ({
367
378
  canDrag,
368
- expanded,
379
+ expandedStore,
369
380
  onDelete,
370
381
  onOpen,
371
382
  canDelete,
372
383
  setSize,
373
384
  toggleExpand,
374
- }), [canDrag, expanded, onDelete, onOpen, canDelete, setSize, toggleExpand]);
375
- // Stable per-column itemData so unrelated board re-renders (e.g. column hover)
376
- // don't change the reference react-window hands to every row → no row re-renders.
385
+ }), [canDrag, expandedStore, onDelete, onOpen, canDelete, setSize, toggleExpand]);
386
+ // Stable per-column itemData, so unrelated board re-renders don't re-render every virtualized row.
377
387
  const itemDataByCol = useMemo(() => {
378
388
  const map = {};
379
389
  for (const [colId, column] of Object.entries(columns)) {
@@ -384,28 +394,25 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
384
394
  const renderColumnDroppable = (colId, column, columnDragHandleProps, isColCollapsed) => {
385
395
  const shouldVirtualize = virtualization !== null && virtualization !== void 0 ? virtualization : column.items.length > KANBAN_VIRTUALIZE_THRESHOLD;
386
396
  return (_jsx(Droppable, { droppableId: colId, mode: shouldVirtualize ? "virtual" : "standard", renderClone: (provided, _snapshot, rubric) => {
387
- var _a;
388
397
  const item = column.items[rubric.source.index];
389
398
  return (_jsx(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, "aria-label": item ? getCardAccessibleName(item) : undefined, style: {
390
399
  ...provided.draggableProps.style,
391
400
  width: columnWidth,
392
401
  paddingBottom: KANBAN_CARD_GAP,
393
- }, borderRadius: "lg", sx: focusVisibleStyles(colors), children: (item === null || item === void 0 ? void 0 : item.customNode) ? (_a = item === null || item === void 0 ? void 0 : item.customNode) === null || _a === void 0 ? void 0 : _a.call(item) : (_jsx(AccountCard, { account: item, index: rubric.source.index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[item.id], onToggleExpand: () => toggleExpand(item.id, colId, rubric.source.index), isDeletable: canDelete }, item.id)) }));
402
+ }, borderRadius: "lg", sx: focusVisibleStyles(colors), children: _jsx(KanbanCardBody, { account: item, index: rubric.source.index, colId: colId, canDelete: canDelete, onDelete: onDelete, onOpen: onOpen, expandedStore: expandedStore, toggleExpand: toggleExpand }) }));
394
403
  }, children: (provided, snapshot) => {
395
404
  var _a, _b, _c, _d, _e, _f, _g;
396
405
  return (_jsxs(Box, { ref: provided.innerRef, ...provided.droppableProps, width: isColCollapsed ? COLLAPSED_KANBAN_COLUMN_WIDTH : columnWidth, borderRadius: "xl", background: snapshot.isDraggingOver
397
406
  ? colors.primary[50]
398
- : colors.background[100], border: `0.063rem ${snapshot.isDraggingOver ? "dashed" : "solid"} ${snapshot.isDraggingOver
407
+ : colors.background[100], border: `${BORDER_WIDTHS.hairline} ${snapshot.isDraggingOver ? "dashed" : "solid"} ${snapshot.isDraggingOver
399
408
  ? colors.primary[300]
400
- : colors.boxborder[200]}`, transition: COLUMN_TRANSITION, display: "flex", flexDirection: "column", flexShrink: 0, overflow: isColCollapsed ? "visible" : "hidden", height: COLUMN_HEIGHT, sx: reducedMotionSx(), onMouseEnter: () => setHoveredColumn(colId), onMouseLeave: () => setHoveredColumn(null), onFocus: () => setHoveredColumn(colId), onBlur: (e) => {
409
+ : colors.boxborder[200]}`, transition: COLUMN_TRANSITION, display: "flex", flexDirection: "column", flexShrink: 0, overflow: isColCollapsed ? "visible" : "hidden", height: COLUMN_HEIGHT, sx: reducedMotionSx(), onMouseEnter: () => hoveredColumn.set(colId), onMouseLeave: () => hoveredColumn.set(null), onFocus: () => hoveredColumn.set(colId), onBlur: (e) => {
401
410
  if (!e.currentTarget.contains(e.relatedTarget))
402
- setHoveredColumn(null);
403
- }, children: [isColCollapsed ? (_jsxs(Flex, { direction: "column", align: "stretch", flex: "1", width: "100%", minH: 0, overflow: "visible", position: "relative", children: [_jsxs(Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (_a = column.color) !== null && _a !== void 0 ? _a : colors.primary[500], bg: colors.background[100], position: "relative", zIndex: 1, children: [enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, "aria-label": `Reorder ${column.title} column`, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, enableColumnCollapse && (_jsx(Flex, { flexShrink: 0, w: "100%", justify: "center", bg: colors.background[100], position: "relative", zIndex: 3, children: _jsx(IconButton, { "aria-label": "Expand column", icon: _jsx(ChevronRight, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", onClick: () => toggleColumnCollapsed(colId) }) })), _jsx(Text, { as: "span", fontWeight: "700", fontSize: "0.75rem", color: colors.text[700], sx: {
411
+ hoveredColumn.set(null);
412
+ }, children: [isColCollapsed ? (_jsxs(Flex, { direction: "column", align: "stretch", flex: "1", width: "100%", minH: 0, overflow: "visible", position: "relative", children: [_jsxs(Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (_a = column.color) !== null && _a !== void 0 ? _a : colors.primary[500], bg: colors.background[100], position: "relative", zIndex: 1, children: [enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, "aria-label": `Reorder ${column.title} column`, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, enableColumnCollapse && (_jsx(Flex, { flexShrink: 0, w: "100%", justify: "center", bg: colors.background[100], position: "relative", zIndex: 3, children: _jsx(IconButton, { "aria-label": "Expand column", icon: _jsx(ChevronRight, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", onClick: () => toggleColumnCollapsed(colId) }) })), _jsx(Text, { as: "span", fontWeight: "700", fontSize: "xs", color: colors.text[700], sx: {
404
413
  writingMode: "vertical-rl",
405
414
  textOrientation: "mixed",
406
- }, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: 5, h: 5, borderRadius: "full", border: "0.063rem solid", borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "xs", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `0.063rem solid ${colors.boxborder[200]}`, children: [_jsxs(Flex, { direction: "column", gap: 1, minW: 0, flex: "1", children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Box, { boxSize: 2.5, borderRadius: "full", bg: (_e = column.color) !== null && _e !== void 0 ? _e : colors.primary[500], flexShrink: 0 }), enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, "aria-label": `Reorder ${column.title} column`, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, _jsx(Text, { as: "span", fontWeight: "600", fontSize: "0.875rem", color: colors.text[700], noOfLines: 1, minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", children: column.title }) })] }), column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: colors.text[600], children: (_f = column.customNode) === null || _f === void 0 ? void 0 : _f.call(column) })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Badge, { minW: 6, h: 6, px: 2, borderRadius: "full", backgroundColor: colors.backgroundColor.subtle, display: "flex", alignItems: "center", justifyContent: "center", color: colors.text[500], fontWeight: 600, fontSize: "xs", children: (_g = column === null || column === void 0 ? void 0 : column.items) === null || _g === void 0 ? void 0 : _g.length }), enableColumnCollapse && (_jsx(IconButton, { "aria-label": "Collapse column", icon: _jsx(ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: () => toggleColumnCollapsed(colId) })), canDelete &&
407
- hoveredColumn === colId &&
408
- column.items.length > 0 ? (_jsx(Box, { as: "button", type: "button", "aria-label": `Delete all cards in ${column.title}`, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: 4, borderRadius: "sm", cursor: "pointer", color: colors.text[600], _hover: { color: colors.semanticText.error }, onClick: () => handleColumnDelete(colId), transition: transitionFor(["color"]), sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, flexShrink: 0, children: _jsx(Trash2, { size: 16 }) })) : (_jsx(Box, { boxSize: 4, flexShrink: 0 }))] })] })), !isColCollapsed && (_jsxs(Box, { px: 2, flex: "1", overflowY: "auto", width: "100%", sx: {
415
+ }, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: 5, h: 5, borderRadius: "full", border: `${BORDER_WIDTHS.hairline} solid`, borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "xs", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `${BORDER_WIDTHS.hairline} solid ${colors.boxborder[200]}`, children: [_jsxs(Flex, { direction: "column", gap: 1, minW: 0, flex: "1", children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Box, { boxSize: 2.5, borderRadius: "full", bg: (_e = column.color) !== null && _e !== void 0 ? _e : colors.primary[500], flexShrink: 0 }), enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, "aria-label": `Reorder ${column.title} column`, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, _jsx(Text, { as: "span", fontWeight: "600", fontSize: "sm", color: colors.text[700], noOfLines: 1, minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", children: column.title }) })] }), column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: colors.text[600], children: (_f = column.customNode) === null || _f === void 0 ? void 0 : _f.call(column) })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Badge, { minW: 6, h: 6, px: 2, borderRadius: "full", backgroundColor: colors.backgroundColor.subtle, display: "flex", alignItems: "center", justifyContent: "center", color: colors.text[500], fontWeight: 600, fontSize: "xs", children: (_g = column === null || column === void 0 ? void 0 : column.items) === null || _g === void 0 ? void 0 : _g.length }), enableColumnCollapse && (_jsx(IconButton, { "aria-label": "Collapse column", icon: _jsx(ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: () => toggleColumnCollapsed(colId) })), canDelete && column.items.length > 0 ? (_jsx(ColumnDeleteAll, { colId: colId, title: column.title, hoveredColumn: hoveredColumn, colors: colors, onDelete: handleColumnDelete })) : (_jsx(Box, { boxSize: 4, flexShrink: 0 }))] })] })), !isColCollapsed && (_jsxs(Box, { px: 2, flex: "1", overflowY: "auto", width: "100%", sx: {
409
416
  ...scrollbarStyles(colors),
410
417
  overflowY: "auto",
411
418
  overflowX: "hidden",
@@ -415,10 +422,7 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
415
422
  if (el)
416
423
  listRefs.current[colId] = el;
417
424
  }, height: Math.max(MIN_LIST_HEIGHT, containerHeight - 150), itemCount: column.items.length +
418
- (snapshot.isUsingPlaceholder ? 1 : 0), itemSize: (index) => getItemSize(index, column.items, colId), width: "100%", itemData: itemDataByCol[colId], children: KanbanRow })) : (_jsxs(Box, { children: [column.items.map((account, index) => (_jsx("div", { style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 }, children: _jsx(Draggable, { draggableId: account.id.toString(), index: index, isDragDisabled: !canDrag, children: (dragProvided) => {
419
- var _a;
420
- return (_jsx(Box, { ref: dragProvided.innerRef, ...dragProvided.draggableProps, ...dragProvided.dragHandleProps, "aria-label": getCardAccessibleName(account), style: dragProvided.draggableProps.style, borderRadius: "lg", sx: focusVisibleStyles(colors), children: (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (_jsx(AccountCard, { account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: () => toggleExpand(account.id, colId, index), isDeletable: canDelete })) }));
421
- } }, account.id) }, account.id))), provided.placeholder] }))] }))] }));
425
+ (snapshot.isUsingPlaceholder ? 1 : 0), itemSize: (index) => getItemSize(index, column.items, colId), width: "100%", itemData: itemDataByCol[colId], children: KanbanRow })) : (_jsxs(Box, { children: [column.items.map((account, index) => (_jsx("div", { style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 }, children: _jsx(Draggable, { draggableId: account.id.toString(), index: index, isDragDisabled: !canDrag, children: (dragProvided) => (_jsx(Box, { ref: dragProvided.innerRef, ...dragProvided.draggableProps, ...dragProvided.dragHandleProps, "aria-label": getCardAccessibleName(account), style: dragProvided.draggableProps.style, borderRadius: "lg", sx: focusVisibleStyles(colors), children: _jsx(KanbanCardBody, { account: account, index: index, colId: colId, canDelete: canDelete, onDelete: onDelete, onOpen: onOpen, expandedStore: expandedStore, toggleExpand: toggleExpand }) })) }, account.id) }, account.id))), provided.placeholder] }))] }))] }));
422
426
  } }, colId));
423
427
  };
424
428
  if (!canView)
@@ -426,7 +430,20 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
426
430
  const showAddColumn = Boolean(customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.isVisible);
427
431
  const hasAnyColumns = Object.keys(columns).length > 0;
428
432
  const flexScrollSx = scrollbarStyles(colors);
429
- const addColumnBox = !isBoardLoading && showAddColumn && hasAnyColumns && (_jsx(Box, { width: columnWidth, borderRadius: "lg", border: `0.125rem dashed ${colors.boxborder[500]}`, bg: colors.background[100], flexShrink: 0, height: COLUMN_HEIGHT, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", _hover: { borderColor: colors.primary[500] }, onClick: () => { var _a; return (_a = customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.onAddColumn) === null || _a === void 0 ? void 0 : _a.call(customizeColumn); }, children: _jsxs(Flex, { direction: "column", align: "center", gap: 2, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) }));
433
+ const addColumn = () => { var _a; return (_a = customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.onAddColumn) === null || _a === void 0 ? void 0 : _a.call(customizeColumn); };
434
+ const addColumnKeyboard = {
435
+ role: "button",
436
+ tabIndex: 0,
437
+ sx: focusVisibleStyles(colors),
438
+ onClick: addColumn,
439
+ onKeyDown: (e) => {
440
+ if (e.key !== "Enter" && e.key !== " ")
441
+ return;
442
+ e.preventDefault();
443
+ addColumn();
444
+ },
445
+ };
446
+ const addColumnBox = !isBoardLoading && showAddColumn && hasAnyColumns && (_jsx(Box, { width: columnWidth, borderRadius: "lg", border: `0.125rem dashed ${colors.boxborder[500]}`, bg: colors.background[100], flexShrink: 0, height: COLUMN_HEIGHT, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", _hover: { borderColor: colors.primary[500] }, ...addColumnKeyboard, children: _jsxs(Flex, { direction: "column", align: "center", gap: 2, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) }));
430
447
  const columnsList = Object.entries(columns).map(([colId, column], colIndex) => {
431
448
  const isColCollapsed = enableColumnCollapse && Boolean(collapsedColumns[colId]);
432
449
  if (enableColumnReorder) {
@@ -437,7 +454,7 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
437
454
  }
438
455
  return renderColumnDroppable(colId, column, null, isColCollapsed);
439
456
  });
440
- const loadingSkeletonRow = Array.from({ length: 4 }).map((_, idx) => (_jsxs(Box, { "aria-hidden": true, width: columnWidth, borderRadius: "xl", bg: colors.background[100], border: `0.063rem solid ${colors.boxborder[200]}`, flexShrink: 0, alignSelf: "flex-start", overflow: "hidden", children: [_jsxs(Flex, { h: "2.75rem", align: "center", gap: 2, px: 3, borderBottom: `0.063rem solid ${colors.boxborder[200]}`, children: [_jsx(SkeletonCircle, { size: "2.5" }), _jsx(Skeleton, { h: 3, w: "40%", borderRadius: "sm" }), _jsx(Skeleton, { h: 6, w: 6, ml: "auto", borderRadius: "full" })] }), _jsx(Flex, { direction: "column", gap: 3, px: 2, pt: 1.5, pb: 3, children: SKELETON_ROWS.slice(0, 3 - (idx % 2)).map((rows, i) => (_jsx(CardSkeleton, { colors: colors, rows: rows }, i))) })] }, idx)));
441
- return (_jsxs(_Fragment, { children: [_jsx(HeaderActions, { select: kanbanSelect, edit: canDrag ? kanbanEdit : undefined, create: canCreate ? kanbanCreate : undefined }), _jsx(DragDropContext, { onDragEnd: onDragEnd, children: _jsxs(Box, { ref: containerRef, "data-testid": "kanban-board", "aria-busy": isBoardLoading || undefined, bg: colors.backgroundColor.main, h: height !== null && height !== void 0 ? height : `${viewportHeight}px`, maxH: maxH, position: "relative", overflow: "hidden", mt: 2, children: [showAddColumn && !isBoardLoading && !hasAnyColumns && (_jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", pointerEvents: "none", zIndex: 1, children: _jsxs(Flex, { direction: "column", align: "center", justify: "center", gap: 2, pointerEvents: "auto", cursor: "pointer", px: 6, py: 5, borderRadius: "lg", bg: colors.background[100], border: `0.125rem dashed ${colors.boxborder[500]}`, _hover: { borderColor: colors.primary[500] }, onClick: () => { var _a; return (_a = customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.onAddColumn) === null || _a === void 0 ? void 0 : _a.call(customizeColumn); }, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) })), isBoardLoading ? (_jsx(Flex, { role: "status", "aria-label": "Loading board", gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: loadingSkeletonRow })) : enableColumnReorder ? (_jsx(Droppable, { droppableId: "COLUMN_REORDER", direction: "horizontal", type: "COLUMN", children: (colReorderProvided) => (_jsxs(Flex, { ref: colReorderProvided.innerRef, ...colReorderProvided.droppableProps, gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: [columnsList, colReorderProvided.placeholder, addColumnBox] })) })) : (_jsxs(Flex, { gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: [columnsList, addColumnBox] }))] }) })] }));
457
+ const loadingSkeletonRow = Array.from({ length: 4 }).map((_, idx) => (_jsxs(Box, { "aria-hidden": true, width: columnWidth, borderRadius: "xl", bg: colors.background[100], border: `${BORDER_WIDTHS.hairline} solid ${colors.boxborder[200]}`, flexShrink: 0, alignSelf: "flex-start", overflow: "hidden", children: [_jsxs(Flex, { h: "2.75rem", align: "center", gap: 2, px: 3, borderBottom: `${BORDER_WIDTHS.hairline} solid ${colors.boxborder[200]}`, children: [_jsx(SkeletonCircle, { size: "2.5" }), _jsx(Skeleton, { h: 3, w: "40%", borderRadius: "sm" }), _jsx(Skeleton, { h: 6, w: 6, ml: "auto", borderRadius: "full" })] }), _jsx(Flex, { direction: "column", gap: 3, px: 2, pt: 1.5, pb: 3, children: SKELETON_ROWS.slice(0, 3 - (idx % 2)).map((rows, i) => (_jsx(CardSkeleton, { colors: colors, rows: rows }, i))) })] }, idx)));
458
+ return (_jsxs(_Fragment, { children: [_jsx(HeaderActions, { select: kanbanSelect, edit: canDrag ? kanbanEdit : undefined, create: canCreate ? kanbanCreate : undefined }), _jsx(DragDropContext, { onDragEnd: onDragEnd, children: _jsxs(Box, { ref: containerRef, "data-testid": "kanban-board", "aria-busy": isBoardLoading || undefined, bg: colors.backgroundColor.main, h: height !== null && height !== void 0 ? height : `${viewportHeight}px`, maxH: maxH, position: "relative", overflow: "hidden", mt: 2, children: [showAddColumn && !isBoardLoading && !hasAnyColumns && (_jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", pointerEvents: "none", zIndex: 1, children: _jsxs(Flex, { direction: "column", align: "center", justify: "center", gap: 2, pointerEvents: "auto", cursor: "pointer", px: 6, py: 5, borderRadius: "lg", bg: colors.background[100], border: `0.125rem dashed ${colors.boxborder[500]}`, _hover: { borderColor: colors.primary[500] }, ...addColumnKeyboard, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) })), isBoardLoading ? (_jsx(Flex, { role: "status", "aria-label": "Loading board", gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: loadingSkeletonRow })) : enableColumnReorder ? (_jsx(Droppable, { droppableId: "COLUMN_REORDER", direction: "horizontal", type: "COLUMN", children: (colReorderProvided) => (_jsxs(Flex, { ref: colReorderProvided.innerRef, ...colReorderProvided.droppableProps, gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: [columnsList, colReorderProvided.placeholder, addColumnBox] })) })) : (_jsxs(Flex, { gap: 4, p: 4, pb: 6, overflowX: "auto", overflowY: "hidden", height: "100%", sx: flexScrollSx, children: [columnsList, addColumnBox] }))] }) })] }));
442
459
  };
443
460
  export default KanbanBoard;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef, useLayoutEffect, useEffect } from "react";
3
+ import { observeResize } from "../../Hooks/sharedResizeObserver.js";
3
4
  /** Wraps one virtualized row to report its rendered height to KanbanBoard's row-size cache; not exported, virtualization-only. */
4
5
  const MeasuredItem = ({ index, setSize, children, }) => {
5
6
  const ref = useRef(null);
@@ -24,23 +25,14 @@ const MeasuredItem = ({ index, setSize, children, }) => {
24
25
  measure();
25
26
  // A second measure after paint catches any layout that finishes after the synchronous tick (font loads, async CSS, etc).
26
27
  const raf = requestAnimationFrame(measure);
27
- let ro;
28
- if (typeof ResizeObserver !== "undefined" && element) {
29
- ro = new ResizeObserver(() => {
30
- measure();
31
- });
32
- ro.observe(element);
33
- }
34
- else {
28
+ const unobserve = typeof ResizeObserver !== "undefined" && element ? observeResize(element, measure) : undefined;
29
+ if (!unobserve)
35
30
  window.addEventListener("resize", measure);
36
- }
37
31
  return () => {
38
32
  cancelAnimationFrame(raf);
39
- // disconnect, not unobserve — the observer itself has to be released, or a board that
40
- // remounts cards as it scrolls leaves one behind per card.
41
- if (ro)
42
- ro.disconnect();
43
- if (!ro)
33
+ if (unobserve)
34
+ unobserve();
35
+ else
44
36
  window.removeEventListener("resize", measure);
45
37
  };
46
38
  }, []);
@@ -0,0 +1,22 @@
1
+ import { useSyncExternalStore } from "react";
2
+ /** Board-local state that only the components selecting a changed slice re-render for. */
3
+ export const createBoardStore = (initial) => {
4
+ let value = initial;
5
+ const listeners = new Set();
6
+ return {
7
+ get: () => value,
8
+ set: (next) => {
9
+ if (Object.is(next, value))
10
+ return;
11
+ value = next;
12
+ listeners.forEach((listener) => listener());
13
+ },
14
+ subscribe: (listener) => {
15
+ listeners.add(listener);
16
+ return () => {
17
+ listeners.delete(listener);
18
+ };
19
+ },
20
+ };
21
+ };
22
+ export const useBoardStore = (store, select) => useSyncExternalStore(store.subscribe, () => select(store.get()));
@@ -16,7 +16,7 @@ export const detectApple = () => typeof navigator !== "undefined" && /Mac|iPhone
16
16
  /** One keyboard key cap; decorative hint rows should wrap it in `aria-hidden`. */
17
17
  const Kbd = ({ children, size = "sm", "data-testid": testId }) => {
18
18
  const { colors } = useCustomTheme();
19
- return (_jsx(Box, { as: "kbd", "data-testid": testId, display: "inline-flex", alignItems: "center", justifyContent: "center", minW: HEIGHT[size], h: HEIGHT[size], px: 1.5, fontFamily: "inherit", fontSize: "0.6875rem", fontWeight: 600, lineHeight: 1, whiteSpace: "nowrap", borderWidth: "1px", borderColor: colors.boxborder[200], borderRadius: "base", bg: colors.backgroundColor.subtle, color: colors.textMuted, children: children }));
19
+ return (_jsx(Box, { as: "kbd", "data-testid": testId, display: "inline-flex", alignItems: "center", justifyContent: "center", minW: HEIGHT[size], h: HEIGHT[size], px: 1.5, fontFamily: "inherit", fontSize: "xs-minus", fontWeight: 600, lineHeight: 1, whiteSpace: "nowrap", borderWidth: "1px", borderColor: colors.boxborder[200], borderRadius: "base", bg: colors.backgroundColor.subtle, color: colors.textMuted, children: children }));
20
20
  };
21
21
  export const KbdShortcut = ({ shortcut, size, isApple, "data-testid": testId }) => {
22
22
  const parts = shortcut.split("+").map((p) => p.trim()).filter(Boolean);
@@ -22,6 +22,6 @@ const LimitReachedModal = ({ isOpen, onClose, kind, limit = null, used = null, c
22
22
  // Header banner uses the brand gradient so it reads correctly across all 9 brands.
23
23
  const gradient = resolveGradient(colors.gradient, colors.white, colors.black);
24
24
  const ink = gradient.ink;
25
- return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, size: "lg", motionPreset: "slideInBottom", children: [_jsx(ModalOverlay, {}), _jsxs(ModalContent, { overflow: "hidden", boxShadow: "2xl", mx: 4, children: [_jsxs(Box, { bgGradient: `linear(to-r, ${gradient.from}, ${gradient.to})`, color: ink, children: [_jsx(ModalHeader, { color: "inherit", borderBottomWidth: 0, children: _jsxs(Flex, { align: "center", children: [_jsx(Icon, { as: KindIcon, boxSize: "24px", mr: "12px" }), _jsx(Text, { fontSize: "xl", fontWeight: "bold", children: title !== null && title !== void 0 ? title : copy.title })] }) }), _jsx(ModalCloseButton, { "aria-label": "Dismiss", color: ink, _hover: { opacity: 0.7 } })] }), _jsxs(ModalBody, { py: 6, children: [_jsx(Text, { textAlign: "center", fontSize: "md", fontWeight: 600, color: colors.text[700], children: message !== null && message !== void 0 ? message : copy.message }), usage && (_jsx(Text, { textAlign: "center", fontSize: "sm", color: colors.textMuted, mt: 2, children: usage })), features && features.length > 0 && (_jsx(List, { spacing: 2, mt: 5, children: features.map((feature) => (_jsxs(ListItem, { display: "flex", alignItems: "center", fontSize: "sm", color: colors.text[600], children: [_jsx(ListIcon, { as: CheckCircle, color: colors.semanticText.success }), feature] }, feature))) }))] }), _jsx(ModalFooter, { children: _jsxs(HStack, { spacing: 3, children: [_jsx(Button, { label: canManageBilling ? "Maybe later" : "Close", variant: "outline", colorScheme: "gray", size: "md", onClick: onClose }), canManageBilling && (_jsx(UpgradeButton, { label: "Upgrade plan", size: "md", onClick: () => onUpgrade === null || onUpgrade === void 0 ? void 0 : onUpgrade() }))] }) })] })] }));
25
+ return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, size: "lg", motionPreset: "slideInBottom", children: [_jsx(ModalOverlay, {}), _jsxs(ModalContent, { overflow: "hidden", boxShadow: "2xl", mx: 4, children: [_jsxs(Box, { bgGradient: `linear(to-r, ${gradient.from}, ${gradient.to})`, color: ink, children: [_jsx(ModalHeader, { color: "inherit", borderBottomWidth: 0, children: _jsxs(Flex, { align: "center", children: [_jsx(Icon, { as: KindIcon, boxSize: "24px", mr: "12px" }), _jsx(Text, { fontSize: "xl", fontWeight: 700, children: title !== null && title !== void 0 ? title : copy.title })] }) }), _jsx(ModalCloseButton, { "aria-label": "Dismiss", color: ink, _hover: { opacity: 0.7 } })] }), _jsxs(ModalBody, { py: 6, children: [_jsx(Text, { textAlign: "center", fontSize: "md", fontWeight: 600, color: colors.text[700], children: message !== null && message !== void 0 ? message : copy.message }), usage && (_jsx(Text, { textAlign: "center", fontSize: "sm", color: colors.textMuted, mt: 2, children: usage })), features && features.length > 0 && (_jsx(List, { spacing: 2, mt: 5, children: features.map((feature) => (_jsxs(ListItem, { display: "flex", alignItems: "center", fontSize: "sm", color: colors.text[600], children: [_jsx(ListIcon, { as: CheckCircle, color: colors.semanticText.success }), feature] }, feature))) }))] }), _jsx(ModalFooter, { children: _jsxs(HStack, { spacing: 3, children: [_jsx(Button, { label: canManageBilling ? "Maybe later" : "Close", variant: "outline", colorScheme: "gray", size: "md", onClick: onClose }), canManageBilling && (_jsx(UpgradeButton, { label: "Upgrade plan", size: "md", onClick: () => onUpgrade === null || onUpgrade === void 0 ? void 0 : onUpgrade() }))] }) })] })] }));
26
26
  };
27
27
  export default LimitReachedModal;
@@ -19,5 +19,5 @@ export default function Loading({ text, isLoading, onlytext, container, variant
19
19
  if (!isLoading) {
20
20
  return null;
21
21
  }
22
- return (_jsx(Box, { role: "status", "aria-live": "polite", "aria-busy": true, position: container ? "absolute" : "fixed", inset: "0", ...overlayScrimStyles(colors), color: colors.white, display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", gap: 3, zIndex: container ? "10" : "9999", children: onlytext ? (_jsx(Text, { fontSize: "3.125rem", textTransform: "uppercase", fontWeight: 500, animation: `${pulse} 2s ease-in-out infinite`, sx: reducedMotionSx(), children: text })) : (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "lg", color: colors.white, label: text ? "" : "Loading" }), text && _jsx(Text, { fontSize: "0.875rem", children: text })] })) }));
22
+ return (_jsx(Box, { role: "status", "aria-live": "polite", "aria-busy": true, position: container ? "absolute" : "fixed", inset: "0", ...overlayScrimStyles(colors), color: colors.white, display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", gap: 3, zIndex: container ? "10" : "9999", children: onlytext ? (_jsx(Text, { fontSize: "3.125rem", textTransform: "uppercase", fontWeight: 500, animation: `${pulse} 2s ease-in-out infinite`, sx: reducedMotionSx(), children: text })) : (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "lg", color: colors.white, label: text ? "" : "Loading" }), text && _jsx(Text, { fontSize: "sm", children: text })] })) }));
23
23
  }
@@ -6,7 +6,7 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
6
  import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
7
7
  import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
8
8
  import { reducedMotionSx, usePrefersReducedMotion } from "../../Theme/chakra/motion.js";
9
- import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
9
+ import { focusVisibleStyles, insetFocusRingShadow } from "../../Theme/chakra/focusRing.styles.js";
10
10
  import Skeletons from "../Skeletons/Skeletons.js";
11
11
  import MediaFrame from "./MediaFrame.js";
12
12
  import MediaThumb from "./MediaThumb.js";
@@ -174,7 +174,7 @@ const MediaGallery = ({ media, layout = "auto", aspectRatio = "4/5", zoom = "lig
174
174
  const thumbRing = { gap: colors.background[50], ink: colors.header[900] };
175
175
  const thumbs = (width, height) => frames.map((frame, position) => (_jsx(MediaThumb, { media: frame, label: labels.frame(position + 1, count, frame.alt), selected: position === current, onSelect: () => commit(position), width: width, height: height, ring: thumbRing }, frame.id)));
176
176
  const glassDots = glassStyles(colors);
177
- const focusInset = { outline: "2px solid transparent", boxShadow: `inset 0 0 0 2px ${colors.focusRing.halo}, inset 0 0 0 4px ${colors.focusRing.ring}` };
177
+ const focusInset = { outline: "2px solid transparent", boxShadow: insetFocusRingShadow(colors) };
178
178
  const well = (_jsxs(Box, { position: "relative", flex: 1, minW: 0, overflow: "hidden", isolation: "isolate", borderRadius: radius, bg: colors.background[100], sx: { aspectRatio: ratio }, "data-testid": "media-gallery-well", children: [_jsxs(Flex, { ref: trackRef, position: "absolute", inset: 0, tabIndex: 0, role: "group", "aria-label": labels.region, overflowX: "auto", overflowY: "hidden", animation: fadeKey > 0 ? fadeIn(CROSSFADE_MS) : undefined, onScroll: onScroll, onPointerDown: () => {
179
179
  settling.current = null;
180
180
  }, outline: "none", _focusVisible: focusInset, sx: {
@@ -9,6 +9,7 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
9
9
  import { overlayScrim } from "../../Theme/tokens/builders/scrim.js";
10
10
  import { fullViewportHeight } from "../../Theme/tokens/builders/viewportHeight.js";
11
11
  import { reducedMotionSx, usePrefersReducedMotion } from "../../Theme/chakra/motion.js";
12
+ import { NUMERIC_TEXT } from "../../Theme/tokens/primitives/typography.js";
12
13
  import MediaFrame from "./MediaFrame.js";
13
14
  import MediaThumb from "./MediaThumb.js";
14
15
  import { fadeIn } from "./motion.js";
@@ -71,7 +72,7 @@ const MediaLightbox = ({ isOpen, onClose, items, index, defaultIndex = 0, onInde
71
72
  return null;
72
73
  const alt = (_a = item.alt) !== null && _a !== void 0 ? _a : labels.image(current + 1, total);
73
74
  const bar = { bg: overlayScrim(colors), color: chrome.ink };
74
- return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, size: "full", hideCloseButton: true, motionPreset: reduced ? "none" : "scale", initialFocusRef: stageRef, finalFocusRef: finalFocusRef, overlaybg: overlayScrim(colors), contentProps: { bg: chrome.stage, m: 0, borderRadius: 0, "aria-label": labels.dialog }, children: _jsxs(ModalBody, { p: 0, display: "flex", flexDirection: "column", sx: fullViewportHeight, children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: 2, px: 4, py: 2, ...bar, "data-testid": "media-lightbox-bar", children: [_jsx(Text, { as: "span", fontSize: "sm", fontWeight: 600, "aria-live": "polite", sx: { fontVariantNumeric: "tabular-nums" }, children: labels.counter(current + 1, total) }), _jsx(ViewerIconButton, { label: labels.close, icon: _jsx(X, { size: 20, "aria-hidden": true }), onClick: onClose, testId: "media-lightbox-close" })] }), _jsxs(Box, { ref: stageRef, tabIndex: -1, flex: 1, minH: 0, position: "relative", outline: "none", onKeyDown: onKeyDown, onTouchStart: (event) => {
75
+ return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, size: "full", hideCloseButton: true, motionPreset: reduced ? "none" : "scale", initialFocusRef: stageRef, finalFocusRef: finalFocusRef, overlaybg: overlayScrim(colors), contentProps: { bg: chrome.stage, m: 0, borderRadius: 0, "aria-label": labels.dialog }, children: _jsxs(ModalBody, { p: 0, display: "flex", flexDirection: "column", sx: fullViewportHeight, children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: 2, px: 4, py: 2, ...bar, "data-testid": "media-lightbox-bar", children: [_jsx(Text, { as: "span", fontSize: "sm", fontWeight: 600, "aria-live": "polite", sx: NUMERIC_TEXT, children: labels.counter(current + 1, total) }), _jsx(ViewerIconButton, { label: labels.close, icon: _jsx(X, { size: 20, "aria-hidden": true }), onClick: onClose, testId: "media-lightbox-close" })] }), _jsxs(Box, { ref: stageRef, tabIndex: -1, flex: 1, minH: 0, position: "relative", outline: "none", onKeyDown: onKeyDown, onTouchStart: (event) => {
75
76
  touchStartX.current = event.touches.length === 1 ? event.touches[0].clientX : null;
76
77
  }, onTouchEnd: onTouchEnd, "data-testid": "media-lightbox-stage", children: [_jsx(Box, { position: "absolute", inset: { base: 0, md: 6 }, animation: fadeIn(), sx: reducedMotionSx(), children: _jsx(MediaFrame, { media: item, alt: alt, fit: "contain", autoPlay: true, surface: "transparent", playLabel: labels.playVideo, unavailableLabel: labels.imageUnavailable }) }, item.id), total > 1 && (_jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", left: { base: 2, md: 4 }, top: "calc(50% - 20px)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.previous, icon: _jsx(ChevronLeft, { size: 24, "aria-hidden": true }), onClick: () => go(current - 1), isDisabled: current === 0, round: true, testId: "media-lightbox-prev" }) }), _jsx(Box, { position: "absolute", right: { base: 2, md: 4 }, top: "calc(50% - 20px)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.next, icon: _jsx(ChevronRight, { size: 24, "aria-hidden": true }), onClick: () => go(current + 1), isDisabled: current === total - 1, round: true, testId: "media-lightbox-next" }) })] }))] }), total > 1 && (_jsx(Flex, { as: "nav", "aria-label": labels.thumbnails, ...bar, py: 3, px: 4, justify: "center", children: _jsx(Flex, { ref: stripRef, gap: 3, p: "4px", maxW: "100%", overflowX: "auto", onKeyDown: onKeyDown, "data-testid": "media-lightbox-thumbs", children: items.map((frame, position) => (_jsx(MediaThumb, { media: frame, label: labels.frame(position + 1, total, frame.alt), selected: position === current, onSelect: () => go(position), width: 56, height: 70, ring: { gap: chrome.stage, ink: chrome.ink }, surface: chrome.raised }, frame.id))) }) }))] }) }));
77
78
  };
@@ -4,6 +4,7 @@ import { Box, Flex } from "@chakra-ui/react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
5
  import { hexToRgb } from "../../Theme/tokens/builders/color.js";
6
6
  import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
7
+ import { NUMERIC_TEXT } from "../../Theme/tokens/primitives/typography.js";
7
8
  import { reducedMotionSx } from "../../Theme/chakra/motion.js";
8
9
  import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
9
10
  const GLASS_ALPHA = 0.72;
@@ -38,5 +39,5 @@ GlassIconButton.displayName = "GlassIconButton";
38
39
  export const GlassPill = ({ children, height = 28, ...placement }) => {
39
40
  const { colors } = useCustomTheme();
40
41
  const glass = glassStyles(colors);
41
- return (_jsx(Flex, { align: "center", gap: 1.5, h: `${height}px`, px: 3, borderRadius: "full", position: "absolute", fontSize: "xs", fontWeight: 600, pointerEvents: "none", whiteSpace: "nowrap", ...glass, sx: { ...glass.sx, fontVariantNumeric: "tabular-nums" }, ...placement, children: children }));
42
+ return (_jsx(Flex, { align: "center", gap: 1.5, h: `${height}px`, px: 3, borderRadius: "full", position: "absolute", fontSize: "xs", fontWeight: 600, pointerEvents: "none", whiteSpace: "nowrap", ...glass, sx: { ...glass.sx, ...NUMERIC_TEXT }, ...placement, children: children }));
42
43
  };
@@ -183,7 +183,7 @@ const MediaViewer = ({ isOpen, onClose, items, index, onIndexChange, defaultInde
183
183
  const uploaded = item.uploadedAt ? labels.uploadedOn(format(new Date(item.uploadedAt), "MMM d, yyyy")) : null;
184
184
  return [parts.join(" · "), uploaded].filter(Boolean).join(" — ");
185
185
  })();
186
- return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, size: "full", hideCloseButton: true, initialFocusRef: stageRef, contentProps: { bg: chrome.stage, m: 0, borderRadius: 0 }, children: _jsxs(ModalBody, { p: 0, display: "flex", flexDirection: "column", sx: fullViewportHeight, children: [total > 1 && (_jsx(VisuallyHidden, { "aria-live": "polite", children: labels.nowShowing(safeIndex + 1, total) })), _jsxs(Flex, { align: "center", gap: 2, px: 4, py: 3, bg: chrome.raised, color: chrome.ink, "data-testid": "media-viewer-header", children: [_jsx(Heading, { as: "h2", size: "sm", noOfLines: 1, color: chrome.ink, children: title }), total > 1 && (_jsx(Text, { as: "span", color: chrome.muted, fontSize: "sm", "data-testid": "media-viewer-counter", children: labels.counter(safeIndex + 1, total) })), kindLabelKey && (_jsx(Text, { as: "span", px: 2, py: 0.5, borderRadius: "4px", bg: chrome.hover, color: chrome.ink, fontSize: "xs", fontWeight: 600, children: labels[kindLabelKey] })), _jsx(Flex, { flex: 1 }), item.kind === "youtube" ? (_jsx(ViewerIconButton, { label: labels.openOnYoutube, icon: _jsx(ExternalLink, { size: 16 }), href: youtubeWatch(item.src) })) : (_jsx(ViewerIconButton, { label: labels.download, icon: _jsx(Download, { size: 16 }), href: item.src })), _jsx(ViewerIconButton, { label: copied ? labels.copied : labels.copyLink, icon: _jsx(Copy, { size: 16 }), onClick: copyLink, testId: "media-viewer-copy-link" }), _jsx(ViewerIconButton, { label: labels.close, icon: _jsx(X, { size: 18 }), onClick: onClose, testId: "media-viewer-close" })] }), _jsxs(Box, { ref: stageRef, tabIndex: -1, flex: 1, position: "relative", minH: 0, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, "data-testid": "media-viewer-stage", children: [renderStage(), total > 1 && (_jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", top: "50%", left: { base: 2, md: 4 }, transform: "translateY(-50%)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.previous, icon: _jsx(ChevronLeft, { size: 24 }), onClick: () => go.current(-1), round: true, testId: "media-viewer-prev" }) }), _jsx(Box, { position: "absolute", top: "50%", right: { base: 2, md: 4 }, transform: "translateY(-50%)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.next, icon: _jsx(ChevronRight, { size: 24 }), onClick: () => go.current(1), round: true, testId: "media-viewer-next" }) })] }))] }), _jsxs(Box, { bg: chrome.raised, py: 3, minW: 0, children: [meta && (_jsx(Text, { fontSize: "xs", color: chrome.muted, mb: 2, px: 4, overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", title: meta, children: meta })), total > 1 && (_jsx(Flex, { as: "nav", "aria-label": labels.filmstrip, ref: stripRef, gap: 2, px: 4, overflowX: "auto", justifyContent: filmstripOverflows ? "flex-start" : "center", "data-testid": "media-viewer-filmstrip", children: items.map((tile, i) => {
186
+ return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, size: "full", hideCloseButton: true, initialFocusRef: stageRef, contentProps: { bg: chrome.stage, m: 0, borderRadius: 0 }, children: _jsxs(ModalBody, { p: 0, display: "flex", flexDirection: "column", sx: fullViewportHeight, children: [total > 1 && (_jsx(VisuallyHidden, { "aria-live": "polite", children: labels.nowShowing(safeIndex + 1, total) })), _jsxs(Flex, { align: "center", gap: 2, px: 4, py: 3, bg: chrome.raised, color: chrome.ink, "data-testid": "media-viewer-header", children: [_jsx(Heading, { as: "h2", size: "sm", noOfLines: 1, color: chrome.ink, children: title }), total > 1 && (_jsx(Text, { as: "span", color: chrome.muted, fontSize: "sm", "data-testid": "media-viewer-counter", children: labels.counter(safeIndex + 1, total) })), kindLabelKey && (_jsx(Text, { as: "span", px: 2, py: 0.5, borderRadius: "base", bg: chrome.hover, color: chrome.ink, fontSize: "xs", fontWeight: 600, children: labels[kindLabelKey] })), _jsx(Flex, { flex: 1 }), item.kind === "youtube" ? (_jsx(ViewerIconButton, { label: labels.openOnYoutube, icon: _jsx(ExternalLink, { size: 16 }), href: youtubeWatch(item.src) })) : (_jsx(ViewerIconButton, { label: labels.download, icon: _jsx(Download, { size: 16 }), href: item.src })), _jsx(ViewerIconButton, { label: copied ? labels.copied : labels.copyLink, icon: _jsx(Copy, { size: 16 }), onClick: copyLink, testId: "media-viewer-copy-link" }), _jsx(ViewerIconButton, { label: labels.close, icon: _jsx(X, { size: 18 }), onClick: onClose, testId: "media-viewer-close" })] }), _jsxs(Box, { ref: stageRef, tabIndex: -1, flex: 1, position: "relative", minH: 0, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, "data-testid": "media-viewer-stage", children: [renderStage(), total > 1 && (_jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", top: "50%", left: { base: 2, md: 4 }, transform: "translateY(-50%)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.previous, icon: _jsx(ChevronLeft, { size: 24 }), onClick: () => go.current(-1), round: true, testId: "media-viewer-prev" }) }), _jsx(Box, { position: "absolute", top: "50%", right: { base: 2, md: 4 }, transform: "translateY(-50%)", zIndex: 2, children: _jsx(ViewerIconButton, { label: labels.next, icon: _jsx(ChevronRight, { size: 24 }), onClick: () => go.current(1), round: true, testId: "media-viewer-next" }) })] }))] }), _jsxs(Box, { bg: chrome.raised, py: 3, minW: 0, children: [meta && (_jsx(Text, { fontSize: "xs", color: chrome.muted, mb: 2, px: 4, overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", title: meta, children: meta })), total > 1 && (_jsx(Flex, { as: "nav", "aria-label": labels.filmstrip, ref: stripRef, gap: 2, px: 4, overflowX: "auto", justifyContent: filmstripOverflows ? "flex-start" : "center", "data-testid": "media-viewer-filmstrip", children: items.map((tile, i) => {
187
187
  const isSelected = i === safeIndex;
188
188
  const showPoster = tile.kind === "video" && !isUnsupportedVideoSrc(tile.src);
189
189
  const showThumb = !showPoster && tile.thumb && !(tile.kind === "image" && isUnsupportedImageSrc(tile.src));
@@ -5,7 +5,7 @@ import { ChevronDown, Download, Music, Pause, Play, SkipBack, SkipForward, Volum
5
5
  import { settleBetween } from "../../../Theme/tokens/builders/focusRing.js";
6
6
  import { formatClock, isTypingTarget, PLAYBACK_SPEEDS, SEEK_STEP_SECONDS } from "../mediaItems.js";
7
7
  import { useViewerChrome } from "../useViewerChrome.js";
8
- import MediaScrubber from "./MediaScrubber.js";
8
+ import { TimelineClock, TimelineScrubber, usePlaybackTimeline } from "./PlaybackTimeline.js";
9
9
  import MediaStatusPanel from "./MediaStatusPanel.js";
10
10
  import ViewerIconButton from "./ViewerIconButton.js";
11
11
  import { defaultMediaAudioPlayerLabels } from "./MediaAudioPlayerProps.js";
@@ -17,7 +17,7 @@ const MediaAudioPlayer = ({ item, label, onTimeChange, labels: labelOverrides })
17
17
  const shellRef = useRef(null);
18
18
  const audioRef = useRef(null);
19
19
  const [playing, setPlaying] = useState(false);
20
- const [current, setCurrent] = useState(0);
20
+ const timeline = usePlaybackTimeline();
21
21
  const [duration, setDuration] = useState(0);
22
22
  const [volume, setVolume] = useState(1);
23
23
  const [muted, setMuted] = useState(false);
@@ -42,7 +42,7 @@ const MediaAudioPlayer = ({ item, label, onTimeChange, labels: labelOverrides })
42
42
  return;
43
43
  const max = Number.isFinite(a.duration) ? a.duration : seconds;
44
44
  a.currentTime = Math.min(max, Math.max(0, seconds));
45
- setCurrent(a.currentTime);
45
+ timeline.set(a.currentTime);
46
46
  };
47
47
  const seekBy = (delta) => { var _a, _b; return seekTo(((_b = (_a = audio()) === null || _a === void 0 ? void 0 : _a.currentTime) !== null && _b !== void 0 ? _b : 0) + delta); };
48
48
  const toggleMute = () => {
@@ -109,25 +109,25 @@ const MediaAudioPlayer = ({ item, label, onTimeChange, labels: labelOverrides })
109
109
  }, []);
110
110
  useEffect(() => {
111
111
  setPlaying(false);
112
- setCurrent(0);
112
+ timeline.set(0);
113
113
  setDuration(0);
114
114
  setRate(1);
115
115
  setFailed(false);
116
116
  setBuffered([]);
117
117
  if (audioRef.current)
118
118
  audioRef.current.playbackRate = 1;
119
- }, [item.key]);
119
+ }, [item.key, timeline]);
120
120
  const clock = (seconds) => formatClock(seconds);
121
121
  const effectiveVolume = muted ? 0 : Math.round(volume * 100);
122
122
  return (_jsxs(Box, { ref: shellRef, as: "section", "aria-label": `${labels.audioPlayer}: ${label}`, position: "absolute", inset: 0, bg: chrome.stage, children: [_jsx("audio", { ref: audioRef, src: item.src, preload: "metadata", onPlay: () => setPlaying(true), onPause: () => setPlaying(false), onEnded: () => setPlaying(false), onError: () => setFailed(true), onProgress: (e) => {
123
123
  const ranges = e.currentTarget.buffered;
124
124
  setBuffered(Array.from({ length: ranges.length }, (_, i) => ({ start: ranges.start(i), end: ranges.end(i) })));
125
125
  }, onTimeUpdate: (e) => {
126
- setCurrent(e.currentTarget.currentTime);
126
+ timeline.set(e.currentTarget.currentTime);
127
127
  onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(e.currentTarget.currentTime);
128
128
  }, onLoadedMetadata: (e) => setDuration(e.currentTarget.duration), onDurationChange: (e) => setDuration(e.currentTarget.duration), onVolumeChange: (e) => {
129
129
  setVolume(e.currentTarget.volume);
130
130
  setMuted(e.currentTarget.muted);
131
- }, "data-testid": "media-audio" }), failed ? (_jsx(MediaStatusPanel, { icon: _jsx(VolumeX, {}), label: label, message: labels.audioError, downloadHref: item.src, downloadLabel: labels.download, tone: "warning", testId: "media-audio-error" })) : (_jsxs(Flex, { direction: "column", align: "center", justify: "center", h: "100%", px: { base: 4, md: 10 }, gap: 6, children: [_jsx(Flex, { boxSize: { base: "96px", md: "140px" }, borderRadius: "full", bg: chrome.raised, align: "center", justify: "center", color: chrome.accent, children: _jsx(Music, { size: 48, "aria-hidden": true }) }), _jsx(Text, { fontSize: "sm", fontWeight: 600, color: chrome.ink, noOfLines: 1, maxW: "480px", textAlign: "center", children: label }), _jsxs(Box, { w: "100%", maxW: "480px", children: [_jsx(MediaScrubber, { value: Math.min(current, duration || current), max: duration > 0 ? duration : 0, buffered: buffered, onSeek: seekTo, ariaLabel: labels.seek, ariaValueText: (v) => labels.seekValue(clock(v), clock(duration)), formatTime: clock, isDisabled: duration <= 0, testId: "media-audio-seek" }), _jsxs(Flex, { role: "toolbar", "aria-label": labels.audioControls, align: "center", justify: "space-between", gap: 2, wrap: "wrap", mt: 1, children: [_jsxs(Flex, { align: "center", gap: 1, wrap: "wrap", children: [_jsx(IconButton, { "aria-label": playing ? labels.pause : labels.play, icon: playing ? _jsx(Pause, { size: 20 }) : _jsx(Play, { size: 20 }), onClick: togglePlay, isRound: true, variant: "ghost", bg: chrome.raised, color: chrome.accent, _hover: { bg: chrome.hover }, _focusVisible: { boxShadow: `0 0 0 2px ${ring}` }, "data-testid": "media-audio-toggle" }), _jsx(ViewerIconButton, { label: labels.rewind, hint: "J", icon: _jsx(SkipBack, { size: 16 }), onClick: () => seekBy(-SEEK_STEP_SECONDS), testId: "media-audio-rewind" }), _jsx(ViewerIconButton, { label: labels.forward, hint: "L", icon: _jsx(SkipForward, { size: 16 }), onClick: () => seekBy(SEEK_STEP_SECONDS), testId: "media-audio-forward" }), _jsxs(Flex, { align: "center", onMouseEnter: () => setVolumeHover(true), onMouseLeave: () => setVolumeHover(false), sx: { "&:focus-within": { "--volume-w": "88px" } }, children: [_jsx(ViewerIconButton, { label: muted || volume === 0 ? labels.unmute : labels.mute, hint: "M", icon: muted || volume === 0 ? _jsx(VolumeX, { size: 18 }) : _jsx(Volume2, { size: 18 }), onClick: toggleMute, pressed: muted, testId: "media-audio-mute" }), _jsx(Box, { w: volumeHover ? "88px" : "0px", overflow: "hidden", px: volumeHover ? 1 : 0, transition: "width 0.2s ease-out", sx: { "&:focus-within": { width: "88px", paddingInline: "4px" } }, children: _jsxs(Slider, { "aria-label": labels.volume, min: 0, max: 100, step: 5, value: effectiveVolume, onChange: changeVolume, focusThumbOnChange: false, getAriaValueText: (v) => `${v}%`, children: [_jsx(SliderTrack, { bg: chrome.track, h: "4px", borderRadius: "full", children: _jsx(SliderFilledTrack, { bg: chrome.ink }) }), _jsx(SliderThumb, { bg: chrome.ink, boxSize: "12px", _focusVisible: { boxShadow: `0 0 0 2px ${ring}` } })] }) })] }), _jsxs(Text, { as: "span", ml: 2, fontSize: "sm", fontWeight: 500, color: chrome.ink, sx: { fontVariantNumeric: "tabular-nums" }, "data-testid": "media-audio-time", children: [clock(current), _jsx(Text, { as: "span", color: chrome.muted, children: ` / ${clock(duration)}` })] })] }), _jsxs(Flex, { align: "center", gap: 1, children: [_jsxs(Menu, { placement: "top-end", children: [_jsx(MenuButton, { "aria-label": labels.speed, h: "32px", px: 3, borderRadius: "full", borderWidth: "1px", borderColor: chrome.track, bg: chrome.raised, color: chrome.ink, fontSize: "sm", fontWeight: 600, _hover: { bg: chrome.hover }, _focusVisible: { boxShadow: `0 0 0 2px ${ring}` }, "data-testid": "media-audio-speed", children: _jsxs(Flex, { as: "span", align: "center", gap: 1, children: [`${rate}x`, _jsx(ChevronDown, { size: 14, "aria-hidden": true })] }) }), _jsx(MenuList, { minW: "160px", bg: chrome.raised, zIndex: 1500, children: _jsx(MenuOptionGroup, { type: "radio", title: labels.speed, value: String(rate), onChange: (value) => changeRate(Number(value)), children: PLAYBACK_SPEEDS.map((speed) => (_jsx(MenuItemOption, { value: String(speed), bg: chrome.raised, color: chrome.ink, _hover: { bg: chrome.hover }, _focus: { bg: chrome.hover }, children: speed === 1 ? `1x - ${labels.normalSpeed}` : `${speed}x` }, speed))) }) })] }), _jsx(ViewerIconButton, { label: labels.download, icon: _jsx(Download, { size: 18 }), href: item.src, testId: "media-audio-download" })] })] })] })] }))] }));
131
+ }, "data-testid": "media-audio" }), failed ? (_jsx(MediaStatusPanel, { icon: _jsx(VolumeX, {}), label: label, message: labels.audioError, downloadHref: item.src, downloadLabel: labels.download, tone: "warning", testId: "media-audio-error" })) : (_jsxs(Flex, { direction: "column", align: "center", justify: "center", h: "100%", px: { base: 4, md: 10 }, gap: 6, children: [_jsx(Flex, { boxSize: { base: "96px", md: "140px" }, borderRadius: "full", bg: chrome.raised, align: "center", justify: "center", color: chrome.accent, children: _jsx(Music, { size: 48, "aria-hidden": true }) }), _jsx(Text, { fontSize: "sm", fontWeight: 600, color: chrome.ink, noOfLines: 1, maxW: "480px", textAlign: "center", children: label }), _jsxs(Box, { w: "100%", maxW: "480px", children: [_jsx(TimelineScrubber, { timeline: timeline, duration: duration, buffered: buffered, onSeek: seekTo, ariaLabel: labels.seek, ariaValueText: (v) => labels.seekValue(clock(v), clock(duration)), formatTime: clock, isDisabled: duration <= 0, testId: "media-audio-seek" }), _jsxs(Flex, { role: "toolbar", "aria-label": labels.audioControls, align: "center", justify: "space-between", gap: 2, wrap: "wrap", mt: 1, children: [_jsxs(Flex, { align: "center", gap: 1, wrap: "wrap", children: [_jsx(IconButton, { "aria-label": playing ? labels.pause : labels.play, icon: playing ? _jsx(Pause, { size: 20 }) : _jsx(Play, { size: 20 }), onClick: togglePlay, isRound: true, variant: "ghost", bg: chrome.raised, color: chrome.accent, _hover: { bg: chrome.hover }, _focusVisible: { boxShadow: `0 0 0 2px ${ring}` }, "data-testid": "media-audio-toggle" }), _jsx(ViewerIconButton, { label: labels.rewind, hint: "J", icon: _jsx(SkipBack, { size: 16 }), onClick: () => seekBy(-SEEK_STEP_SECONDS), testId: "media-audio-rewind" }), _jsx(ViewerIconButton, { label: labels.forward, hint: "L", icon: _jsx(SkipForward, { size: 16 }), onClick: () => seekBy(SEEK_STEP_SECONDS), testId: "media-audio-forward" }), _jsxs(Flex, { align: "center", onMouseEnter: () => setVolumeHover(true), onMouseLeave: () => setVolumeHover(false), sx: { "&:focus-within": { "--volume-w": "88px" } }, children: [_jsx(ViewerIconButton, { label: muted || volume === 0 ? labels.unmute : labels.mute, hint: "M", icon: muted || volume === 0 ? _jsx(VolumeX, { size: 18 }) : _jsx(Volume2, { size: 18 }), onClick: toggleMute, pressed: muted, testId: "media-audio-mute" }), _jsx(Box, { w: volumeHover ? "88px" : "0px", overflow: "hidden", px: volumeHover ? 1 : 0, transition: "width 0.2s ease-out", sx: { "&:focus-within": { width: "88px", paddingInline: "4px" } }, children: _jsxs(Slider, { "aria-label": labels.volume, min: 0, max: 100, step: 5, value: effectiveVolume, onChange: changeVolume, focusThumbOnChange: false, getAriaValueText: (v) => `${v}%`, children: [_jsx(SliderTrack, { bg: chrome.track, h: "4px", borderRadius: "full", children: _jsx(SliderFilledTrack, { bg: chrome.ink }) }), _jsx(SliderThumb, { bg: chrome.ink, boxSize: "12px", _focusVisible: { boxShadow: `0 0 0 2px ${ring}` } })] }) })] }), _jsx(TimelineClock, { timeline: timeline, duration: duration, testId: "media-audio-time" })] }), _jsxs(Flex, { align: "center", gap: 1, children: [_jsxs(Menu, { placement: "top-end", children: [_jsx(MenuButton, { "aria-label": labels.speed, h: "32px", px: 3, borderRadius: "full", borderWidth: "1px", borderColor: chrome.track, bg: chrome.raised, color: chrome.ink, fontSize: "sm", fontWeight: 600, _hover: { bg: chrome.hover }, _focusVisible: { boxShadow: `0 0 0 2px ${ring}` }, "data-testid": "media-audio-speed", children: _jsxs(Flex, { as: "span", align: "center", gap: 1, children: [`${rate}x`, _jsx(ChevronDown, { size: 14, "aria-hidden": true })] }) }), _jsx(MenuList, { minW: "160px", bg: chrome.raised, zIndex: "popover", children: _jsx(MenuOptionGroup, { type: "radio", title: labels.speed, value: String(rate), onChange: (value) => changeRate(Number(value)), children: PLAYBACK_SPEEDS.map((speed) => (_jsx(MenuItemOption, { value: String(speed), bg: chrome.raised, color: chrome.ink, _hover: { bg: chrome.hover }, _focus: { bg: chrome.hover }, children: speed === 1 ? `1x - ${labels.normalSpeed}` : `${speed}x` }, speed))) }) })] }), _jsx(ViewerIconButton, { label: labels.download, icon: _jsx(Download, { size: 18 }), href: item.src, testId: "media-audio-download" })] })] })] })] }))] }));
132
132
  };
133
133
  export default MediaAudioPlayer;