pixelize-design-library 2.4.2-beta.64 → 2.4.2-beta.66

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 (517) hide show
  1. package/CHANGELOG.md +520 -21
  2. package/COMPONENT-GOTCHAS.md +187 -95
  3. package/DESIGN-GUIDE.md +54 -10
  4. package/README.md +37 -3
  5. package/dist/Components/Accordion/Accordion.js +11 -8
  6. package/dist/Components/Accordion/AccordionProps.d.ts +4 -0
  7. package/dist/Components/Accordion/accordionColors.js +1 -2
  8. package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
  9. package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +2 -2
  10. package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -1
  11. package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
  12. package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +3 -1
  13. package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.d.ts +2 -0
  14. package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.js +13 -0
  15. package/dist/Components/AppSwitcher/AppSwitcher.js +6 -3
  16. package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +3 -1
  17. package/dist/Components/AppSwitcher/AppSwitcherProps.js +18 -11
  18. package/dist/Components/AppSwitcher/pixelizeSuite.d.ts +24 -0
  19. package/dist/Components/AppSwitcher/pixelizeSuite.js +71 -0
  20. package/dist/Components/AppearanceSettings/AppearanceSettings.js +3 -3
  21. package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -2
  22. package/dist/Components/Avatar/avatarColorway.d.ts +2 -2
  23. package/dist/Components/Avatar/avatarColorway.js +7 -6
  24. package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +1 -1
  25. package/dist/Components/Button/Button.styles.js +5 -2
  26. package/dist/Components/Button/ButtonProps.d.ts +2 -4
  27. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
  28. package/dist/Components/CalendarGrid/CalendarGrid.js +5 -3
  29. package/dist/Components/CalendarGrid/CalendarGridProps.d.ts +1 -1
  30. package/dist/Components/Card/Card.d.ts +1 -0
  31. package/dist/Components/Card/Card.js +1 -0
  32. package/dist/Components/Checkbox/Checkbox.styles.js +3 -1
  33. package/dist/Components/CheckoutKit/selectable.d.ts +3 -1
  34. package/dist/Components/CheckoutKit/selectable.js +10 -7
  35. package/dist/Components/CheckoutKit/tonalHover.d.ts +2 -0
  36. package/dist/Components/CheckoutKit/tonalHover.js +6 -0
  37. package/dist/Components/ChoiceCard/ChoiceCard.d.ts +1 -1
  38. package/dist/Components/ChoiceCard/ChoiceCard.js +2 -1
  39. package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +6 -0
  40. package/dist/Components/Common/FieldMessage.d.ts +1 -0
  41. package/dist/Components/Common/FormLabel.d.ts +1 -1
  42. package/dist/Components/Common/FormLabel.js +4 -3
  43. package/dist/Components/Common/HelperText.d.ts +2 -2
  44. package/dist/Components/Common/HelperText.js +1 -2
  45. package/dist/Components/Common/activationKey.d.ts +5 -0
  46. package/dist/Components/Common/activationKey.js +12 -0
  47. package/dist/Components/Common/dataAttributes.d.ts +4 -0
  48. package/dist/Components/Common/fieldMessageStyles.js +2 -1
  49. package/dist/Components/Common/findSlot.d.ts +2 -0
  50. package/dist/Components/Common/findSlot.js +24 -0
  51. package/dist/Components/Common/surfaceFocusRing.d.ts +1 -0
  52. package/dist/Components/Common/surfaceFocusRing.js +7 -0
  53. package/dist/Components/ConfirmDialog/ConfirmDialog.js +17 -5
  54. package/dist/Components/ConfirmDialog/ConfirmDialogProps.d.ts +38 -10
  55. package/dist/Components/CopyButton/CopyButton.d.ts +4 -1
  56. package/dist/Components/CopyButton/CopyButton.js +5 -8
  57. package/dist/Components/CouponField/CouponField.js +5 -2
  58. package/dist/Components/CustomModulesTable/CustomModulesTable.js +3 -1
  59. package/dist/Components/DatePicker/CalendarPanel.d.ts +1 -0
  60. package/dist/Components/DatePicker/CalendarPanel.js +3 -1
  61. package/dist/Components/DatePicker/DatePicker.js +24 -26
  62. package/dist/Components/DatePicker/DatePickerProps.d.ts +8 -0
  63. package/dist/Components/DatePicker/PickerPortal.js +1 -1
  64. package/dist/Components/DatePicker/RangeDatePicker.d.ts +7 -0
  65. package/dist/Components/DatePicker/RangeDatePicker.js +10 -29
  66. package/dist/Components/DatePicker/SingleDatePicker.js +5 -21
  67. package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -20
  68. package/dist/Components/DescriptionList/DescriptionList.js +1 -1
  69. package/dist/Components/DetailSections/DetailSections.js +2 -1
  70. package/dist/Components/Divider/Divider.d.ts +3 -3
  71. package/dist/Components/Divider/Divider.js +3 -3
  72. package/dist/Components/Drawer/Drawer.d.ts +3 -1
  73. package/dist/Components/Drawer/Drawer.js +28 -26
  74. package/dist/Components/Drawer/DrawerProps.d.ts +4 -0
  75. package/dist/Components/Dropdown/DropDown.js +6 -21
  76. package/dist/Components/Editor/Editor.js +6 -2
  77. package/dist/Components/Editor/EditorProps.d.ts +17 -1
  78. package/dist/Components/Editor/editorLabels.js +1 -0
  79. package/dist/Components/Editor/editorTokenStyles.d.ts +8 -0
  80. package/dist/Components/Editor/editorTokenStyles.js +9 -1
  81. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -1
  82. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +9 -2
  83. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +15 -1
  84. package/dist/Components/EmptyState/EmptyStateProps.d.ts +21 -0
  85. package/dist/Components/EmptyState/FilteredEmptyState.d.ts +5 -0
  86. package/dist/Components/EmptyState/FilteredEmptyState.js +23 -0
  87. package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +1 -0
  88. package/dist/Components/FilePreview/FilePreview.js +7 -3
  89. package/dist/Components/FilePreview/FilePreviewProps.d.ts +2 -1
  90. package/dist/Components/FileUpload/FileUpload.js +8 -9
  91. package/dist/Components/FileUpload/FileUploadProps.d.ts +2 -2
  92. package/dist/Components/FileUploader/FileUploader.js +5 -6
  93. package/dist/Components/FilterSidebar/FilterSidebar.d.ts +7 -9
  94. package/dist/Components/FilterSidebar/FilterSidebar.js +90 -233
  95. package/dist/Components/FilterSidebar/OptionsSection.d.ts +14 -0
  96. package/dist/Components/FilterSidebar/OptionsSection.js +46 -0
  97. package/dist/Components/FilterSidebar/RangeSection.d.ts +17 -0
  98. package/dist/Components/FilterSidebar/RangeSection.js +80 -0
  99. package/dist/Components/FilterSidebar/SectionHeader.d.ts +13 -0
  100. package/dist/Components/FilterSidebar/SectionHeader.js +29 -0
  101. package/dist/Components/FilterSidebar/useStableCallback.d.ts +1 -0
  102. package/dist/Components/FilterSidebar/useStableCallback.js +12 -0
  103. package/dist/Components/Form/FormWrapper.d.ts +7 -7
  104. package/dist/Components/Form/FormWrapper.js +5 -3
  105. package/dist/Components/FormDrawer/FormDrawer.d.ts +1 -1
  106. package/dist/Components/FormDrawer/FormDrawer.js +3 -3
  107. package/dist/Components/FormDrawer/FormDrawerProps.d.ts +2 -0
  108. package/dist/Components/FormField/FormField.js +1 -1
  109. package/dist/Components/Header/Header.js +1 -1
  110. package/dist/Components/Header/HeaderActions.js +4 -2
  111. package/dist/Components/IconButton/IconButtonProps.d.ts +2 -1
  112. package/dist/Components/Input/TextInput.js +2 -2
  113. package/dist/Components/Input/TextInputProps.d.ts +3 -1
  114. package/dist/Components/KanbanBoard/AccountCard.js +1 -1
  115. package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -1
  116. package/dist/Components/KanbanBoard/KanbanBoard.js +11 -7
  117. package/dist/Components/LauncherTrigger/LauncherTrigger.js +1 -1
  118. package/dist/Components/LazyWrapper/LazyWrapper.d.ts +2 -1
  119. package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
  120. package/dist/Components/MediaViewer/MediaViewer.js +4 -3
  121. package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
  122. package/dist/Components/MediaViewer/components/MediaImageViewer.js +19 -8
  123. package/dist/Components/MediaViewer/components/MediaScrubber.js +7 -2
  124. package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
  125. package/dist/Components/MediaViewer/components/ViewerIconButton.js +3 -1
  126. package/dist/Components/MediaViewer/hooks/useFileViewer.d.ts +1 -0
  127. package/dist/Components/MediaViewer/mediaItems.d.ts +1 -0
  128. package/dist/Components/MediaViewer/mediaItems.js +5 -0
  129. package/dist/Components/Modal/Modal.d.ts +1 -0
  130. package/dist/Components/Modal/Modal.js +7 -25
  131. package/dist/Components/Modal/dialogNaming.d.ts +8 -0
  132. package/dist/Components/Modal/dialogNaming.js +21 -0
  133. package/dist/Components/Modal/warnDroppedSlotChildren.d.ts +1 -1
  134. package/dist/Components/Modal/warnDroppedSlotChildren.js +7 -3
  135. package/dist/Components/NavLauncher/LauncherTabs.js +4 -3
  136. package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
  137. package/dist/Components/NavLauncher/NavLauncher.js +288 -56
  138. package/dist/Components/NavLauncher/NavLauncherProps.d.ts +83 -5
  139. package/dist/Components/NavLauncher/ScopeBar.d.ts +14 -0
  140. package/dist/Components/NavLauncher/ScopeBar.js +139 -0
  141. package/dist/Components/NavLauncher/engine/distance.d.ts +4 -0
  142. package/dist/Components/NavLauncher/engine/distance.js +41 -0
  143. package/dist/Components/NavLauncher/engine/engine.d.ts +84 -0
  144. package/dist/Components/NavLauncher/engine/engine.js +472 -0
  145. package/dist/Components/NavLauncher/engine/fold.d.ts +15 -0
  146. package/dist/Components/NavLauncher/engine/fold.js +84 -0
  147. package/dist/Components/NavLauncher/engine/index.d.ts +21 -0
  148. package/dist/Components/NavLauncher/engine/index.js +17 -0
  149. package/dist/Components/NavLauncher/launcherParts.d.ts +14 -0
  150. package/dist/Components/NavLauncher/launcherParts.js +51 -13
  151. package/dist/Components/NavLauncher/match.d.ts +13 -2
  152. package/dist/Components/NavLauncher/match.js +26 -12
  153. package/dist/Components/NavLauncher/searchLayout.d.ts +61 -0
  154. package/dist/Components/NavLauncher/searchLayout.js +110 -0
  155. package/dist/Components/NavLauncher/spotlight.d.ts +39 -0
  156. package/dist/Components/NavLauncher/spotlight.js +202 -0
  157. package/dist/Components/NavLauncher/spotlightParts.d.ts +53 -0
  158. package/dist/Components/NavLauncher/spotlightParts.js +121 -0
  159. package/dist/Components/NavLauncher/useCopiedFlash.d.ts +6 -0
  160. package/dist/Components/NavLauncher/useCopiedFlash.js +21 -0
  161. package/dist/Components/NavigationBar/NavigationBar.js +6 -5
  162. package/dist/Components/NoteTextArea/NoteTextArea.js +12 -17
  163. package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +5 -3
  164. package/dist/Components/Notification/Notification.js +19 -21
  165. package/dist/Components/Notification/NotificationProps.d.ts +1 -1
  166. package/dist/Components/NotificationBell/notificationHelpers.d.ts +16 -1
  167. package/dist/Components/NotificationBell/notificationHelpers.js +13 -7
  168. package/dist/Components/OffersList/OffersList.js +4 -2
  169. package/dist/Components/OptionChip/OptionChip.js +3 -2
  170. package/dist/Components/OptionChip/optionInk.js +4 -2
  171. package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
  172. package/dist/Components/OrgSwitcher/OrgSwitcher.js +13 -6
  173. package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +1 -1
  174. package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -7
  175. package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +4 -2
  176. package/dist/Components/PdfViewer/PdfViewer.d.ts +1 -0
  177. package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +1 -1
  178. package/dist/Components/PlanPill/PlanPill.js +4 -2
  179. package/dist/Components/PlanPill/PlanPillProps.d.ts +1 -1
  180. package/dist/Components/ProductCard/ProductCardAction.js +2 -1
  181. package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
  182. package/dist/Components/ProductDetails/ProductDetails.js +2 -1
  183. package/dist/Components/ProfileCard/ProfileCard.d.ts +1 -0
  184. package/dist/Components/ProfileCard/ProfileCard.js +12 -26
  185. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
  186. package/dist/Components/ProgressBar/ProgressBar.js +2 -1
  187. package/dist/Components/QuantityStepper/QuantityStepper.js +5 -2
  188. package/dist/Components/QueryState/QueryStateBoundary.d.ts +1 -1
  189. package/dist/Components/QueryState/QueryStateBoundary.js +5 -1
  190. package/dist/Components/QueryState/QueryStateProps.d.ts +6 -2
  191. package/dist/Components/RadioButton/RadioButton.js +2 -3
  192. package/dist/Components/RolesPermission/RolesPermission.js +12 -8
  193. package/dist/Components/ScrollToTop/ScrollToTop.d.ts +1 -0
  194. package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +4 -1
  195. package/dist/Components/ScrollbarBox/ScrollbarBox.js +10 -4
  196. package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
  197. package/dist/Components/SearchSelect/SearchSelect.js +8 -5
  198. package/dist/Components/SearchSelect/SearchSelectProps.d.ts +3 -3
  199. package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  200. package/dist/Components/SegmentedControl/SegmentedControl.js +1 -1
  201. package/dist/Components/Select/Select.js +6 -0
  202. package/dist/Components/Select/SelectNative.d.ts +16 -0
  203. package/dist/Components/Select/SelectPopup.js +170 -63
  204. package/dist/Components/Select/SelectProps.d.ts +30 -2
  205. package/dist/Components/Select/groupedWindow.d.ts +21 -0
  206. package/dist/Components/Select/groupedWindow.js +50 -0
  207. package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
  208. package/dist/Components/SelectSearch/SelectSearch.js +48 -38
  209. package/dist/Components/SelectSearch/SelectSearchProps.d.ts +3 -3
  210. package/dist/Components/SelectV2/SelectV2.d.ts +1 -1
  211. package/dist/Components/SelectV2/SelectV2.js +1 -1
  212. package/dist/Components/SelectV2/SelectV2Props.d.ts +3 -3
  213. package/dist/Components/SideBar/SecondaryBar.js +3 -2
  214. package/dist/Components/SideBar/components/MenuItemBox.js +3 -2
  215. package/dist/Components/SideBar/components/MenuItems.js +1 -1
  216. package/dist/Components/SideBar/components/OtherApps.js +2 -2
  217. package/dist/Components/SideBar/components/PinnedSection.js +1 -1
  218. package/dist/Components/SideBar/sidebarScale.d.ts +2 -2
  219. package/dist/Components/SideBar/sidebarScale.js +2 -2
  220. package/dist/Components/SignInActivityTable/SignInActivityTable.js +7 -2
  221. package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +1 -1
  222. package/dist/Components/SignInActivityTable/scrollRegionRing.d.ts +10 -0
  223. package/dist/Components/SignInActivityTable/scrollRegionRing.js +14 -0
  224. package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -1
  225. package/dist/Components/Slider/Slider.d.ts +2 -0
  226. package/dist/Components/Slider/Slider.js +5 -4
  227. package/dist/Components/StageProgress/StageItem.js +2 -1
  228. package/dist/Components/StageProgress/StageProgress.js +8 -2
  229. package/dist/Components/StageProgress/StageProgressProps.d.ts +2 -0
  230. package/dist/Components/StageProgress/StepperStage.js +2 -1
  231. package/dist/Components/StickyBuyBar/StickyBuyBar.js +2 -1
  232. package/dist/Components/Table/Table.js +5 -3
  233. package/dist/Components/Table/components/HeaderActions.js +5 -3
  234. package/dist/Components/Table/components/TableBody.js +13 -8
  235. package/dist/Components/Table/components/TableGroupRow.js +2 -1
  236. package/dist/Components/Table/components/TableHeader.js +17 -21
  237. package/dist/Components/Table/components/TableLoading.js +8 -2
  238. package/dist/Components/Table/components/rowDetail.js +3 -2
  239. package/dist/Components/Table/filters/ActiveFilters.js +6 -3
  240. package/dist/Components/Table/filters/CompactSelect.js +2 -1
  241. package/dist/Components/Table/filters/FilterDatePicker.d.ts +6 -0
  242. package/dist/Components/Table/filters/FilterDatePicker.js +61 -0
  243. package/dist/Components/Table/filters/LeftFilterPane.d.ts +1 -0
  244. package/dist/Components/Table/filters/LeftFilterPane.js +14 -6
  245. package/dist/Components/Table/hooks/useTable.js +11 -7
  246. package/dist/Components/Table/settings/ManageColumns.js +4 -3
  247. package/dist/Components/Table/settings/TableSettings.js +4 -4
  248. package/dist/Components/Tabs/Tabs.d.ts +1 -0
  249. package/dist/Components/Tabs/Tabs.js +1 -0
  250. package/dist/Components/Tabs/components/CountBadge.d.ts +1 -0
  251. package/dist/Components/Tabs/components/TabList.d.ts +1 -0
  252. package/dist/Components/Tabs/components/TabList.js +1 -0
  253. package/dist/Components/Tabs/components/TabPanel.d.ts +1 -0
  254. package/dist/Components/Tabs/components/TabPanel.js +1 -0
  255. package/dist/Components/Tabs/tabStyles.js +4 -2
  256. package/dist/Components/Tag/Tag.js +5 -4
  257. package/dist/Components/Tag/Tag.styles.js +5 -4
  258. package/dist/Components/Tag/TagProps.d.ts +4 -1
  259. package/dist/Components/Tag/tagDot.js +10 -3
  260. package/dist/Components/TagInput/TagInput.js +6 -5
  261. package/dist/Components/TagInput/TagInputProps.d.ts +15 -0
  262. package/dist/Components/TagInput/tagEntries.d.ts +7 -1
  263. package/dist/Components/TagInput/tagEntries.js +18 -5
  264. package/dist/Components/TimePicker/TimePicker.js +7 -3
  265. package/dist/Components/TimePicker/TimePickerProps.d.ts +2 -0
  266. package/dist/Components/Timeline/Timeline.js +13 -9
  267. package/dist/Components/Toaster/Toaster.js +2 -1
  268. package/dist/Components/Toggle/TableToggle.d.ts +1 -1
  269. package/dist/Components/Toggle/TableToggle.js +1 -1
  270. package/dist/Components/UpgradeButton/UpgradeButton.js +3 -2
  271. package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +1 -1
  272. package/dist/Components/UserDetails/UserDetails.js +5 -7
  273. package/dist/Components/WishlistToggle/WishlistToggle.js +2 -1
  274. package/dist/Components/WizardDialog/WizardDialog.d.ts +1 -1
  275. package/dist/Components/WizardDialog/WizardDialog.js +15 -3
  276. package/dist/Components/WizardDialog/WizardDialogProps.d.ts +5 -3
  277. package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +11 -1
  278. package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +6 -3
  279. package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +16 -15
  280. package/dist/Hooks/useOutsideMouseDown.d.ts +11 -0
  281. package/dist/Hooks/useOutsideMouseDown.js +30 -0
  282. package/dist/Hooks/usePreferences.js +30 -12
  283. package/dist/Hooks/useScrollableRegion.d.ts +17 -0
  284. package/dist/Hooks/useScrollableRegion.js +36 -0
  285. package/dist/Hooks/useSidebarPrefs.d.ts +1 -0
  286. package/dist/Theme/chakra/Menu.styles.d.ts +4 -0
  287. package/dist/Theme/chakra/Menu.styles.js +6 -0
  288. package/dist/Theme/chakra/componentStyles.d.ts +4 -0
  289. package/dist/Theme/chakra/componentStyles.js +1 -1
  290. package/dist/Theme/chakra/createBrandTheme.d.ts +1 -0
  291. package/dist/Theme/chakra/focusRing.styles.d.ts +1 -1
  292. package/dist/Theme/chakra/focusRing.styles.js +3 -3
  293. package/dist/Theme/chakra/paletteFromTheme.d.ts +2 -1
  294. package/dist/Theme/chakra/paletteFromTheme.js +18 -4
  295. package/dist/Theme/chakra/ringShadow.d.ts +3 -0
  296. package/dist/Theme/chakra/ringShadow.js +7 -0
  297. package/dist/Theme/provider/PixelizeThemeProvider.d.ts +1 -0
  298. package/dist/Theme/provider/ThemeSwitcher.d.ts +1 -0
  299. package/dist/Theme/provider/ThemeSwitcher.js +1 -1
  300. package/dist/Theme/testing/testPalette.d.ts +1 -0
  301. package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -1
  302. package/dist/Theme/tokens/builders/buildDarkPalette.js +5 -5
  303. package/dist/Theme/tokens/builders/filledSurface.js +3 -2
  304. package/dist/Theme/tokens/builders/focusRing.js +4 -1
  305. package/dist/Theme/tokens/builders/paletteScale.d.ts +2 -0
  306. package/dist/Theme/tokens/builders/paletteScale.js +10 -0
  307. package/dist/Theme/tokens/types.d.ts +1 -0
  308. package/dist/Utils/accountHandoff.d.ts +3 -0
  309. package/dist/Utils/price.d.ts +1 -0
  310. package/dist/Utils/tabular.d.ts +30 -0
  311. package/dist/Utils/tabular.js +61 -0
  312. package/dist/esm/Components/Accordion/Accordion.js +11 -8
  313. package/dist/esm/Components/Accordion/accordionColors.js +2 -3
  314. package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +2 -1
  315. package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
  316. package/dist/esm/Components/Apexcharts/ApexPieChart/pieImageTexture.js +10 -0
  317. package/dist/esm/Components/AppSwitcher/AppSwitcher.js +6 -3
  318. package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +18 -11
  319. package/dist/esm/Components/AppSwitcher/pixelizeSuite.js +67 -0
  320. package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +3 -3
  321. package/dist/esm/Components/Avatar/avatarColorway.js +4 -4
  322. package/dist/esm/Components/Button/Button.styles.js +5 -2
  323. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
  324. package/dist/esm/Components/CalendarGrid/CalendarGrid.js +5 -3
  325. package/dist/esm/Components/Card/Card.js +1 -0
  326. package/dist/esm/Components/Checkbox/Checkbox.styles.js +3 -1
  327. package/dist/esm/Components/CheckoutKit/selectable.js +10 -7
  328. package/dist/esm/Components/CheckoutKit/tonalHover.js +2 -0
  329. package/dist/esm/Components/ChoiceCard/ChoiceCard.js +2 -1
  330. package/dist/esm/Components/Common/FormLabel.js +4 -3
  331. package/dist/esm/Components/Common/HelperText.js +1 -2
  332. package/dist/esm/Components/Common/activationKey.js +7 -0
  333. package/dist/esm/Components/Common/fieldMessageStyles.js +2 -1
  334. package/dist/esm/Components/Common/findSlot.js +17 -0
  335. package/dist/esm/Components/Common/surfaceFocusRing.js +3 -0
  336. package/dist/esm/Components/ConfirmDialog/ConfirmDialog.js +18 -6
  337. package/dist/esm/Components/CopyButton/CopyButton.js +5 -8
  338. package/dist/esm/Components/CouponField/CouponField.js +5 -2
  339. package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +3 -1
  340. package/dist/esm/Components/DatePicker/CalendarPanel.js +3 -1
  341. package/dist/esm/Components/DatePicker/DatePicker.js +25 -27
  342. package/dist/esm/Components/DatePicker/PickerPortal.js +2 -2
  343. package/dist/esm/Components/DatePicker/RangeDatePicker.js +10 -29
  344. package/dist/esm/Components/DatePicker/SingleDatePicker.js +5 -21
  345. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -20
  346. package/dist/esm/Components/DescriptionList/DescriptionList.js +1 -1
  347. package/dist/esm/Components/DetailSections/DetailSections.js +2 -1
  348. package/dist/esm/Components/Divider/Divider.js +3 -3
  349. package/dist/esm/Components/Drawer/Drawer.js +24 -19
  350. package/dist/esm/Components/Dropdown/DropDown.js +7 -22
  351. package/dist/esm/Components/Editor/Editor.js +7 -3
  352. package/dist/esm/Components/Editor/editorLabels.js +1 -0
  353. package/dist/esm/Components/Editor/editorTokenStyles.js +7 -0
  354. package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +8 -4
  355. package/dist/esm/Components/EmptyState/FilteredEmptyState.js +18 -0
  356. package/dist/esm/Components/FilePreview/FilePreview.js +8 -4
  357. package/dist/esm/Components/FileUpload/FileUpload.js +8 -9
  358. package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
  359. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +94 -237
  360. package/dist/esm/Components/FilterSidebar/OptionsSection.js +41 -0
  361. package/dist/esm/Components/FilterSidebar/RangeSection.js +78 -0
  362. package/dist/esm/Components/FilterSidebar/SectionHeader.js +23 -0
  363. package/dist/esm/Components/FilterSidebar/useStableCallback.js +8 -0
  364. package/dist/esm/Components/Form/FormWrapper.js +5 -3
  365. package/dist/esm/Components/FormDrawer/FormDrawer.js +3 -3
  366. package/dist/esm/Components/FormField/FormField.js +1 -1
  367. package/dist/esm/Components/Header/Header.js +1 -1
  368. package/dist/esm/Components/Header/HeaderActions.js +6 -4
  369. package/dist/esm/Components/Input/TextInput.js +2 -2
  370. package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -1
  371. package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
  372. package/dist/esm/Components/KanbanBoard/KanbanBoard.js +11 -7
  373. package/dist/esm/Components/LauncherTrigger/LauncherTrigger.js +1 -1
  374. package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
  375. package/dist/esm/Components/MediaViewer/MediaViewer.js +5 -4
  376. package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
  377. package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +19 -8
  378. package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +7 -2
  379. package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
  380. package/dist/esm/Components/MediaViewer/components/ViewerIconButton.js +3 -1
  381. package/dist/esm/Components/MediaViewer/mediaItems.js +4 -0
  382. package/dist/esm/Components/Modal/Modal.js +2 -17
  383. package/dist/esm/Components/Modal/dialogNaming.js +18 -0
  384. package/dist/esm/Components/Modal/warnDroppedSlotChildren.js +7 -3
  385. package/dist/esm/Components/NavLauncher/LauncherTabs.js +4 -3
  386. package/dist/esm/Components/NavLauncher/NavLauncher.js +291 -59
  387. package/dist/esm/Components/NavLauncher/ScopeBar.js +136 -0
  388. package/dist/esm/Components/NavLauncher/engine/distance.js +37 -0
  389. package/dist/esm/Components/NavLauncher/engine/engine.js +459 -0
  390. package/dist/esm/Components/NavLauncher/engine/fold.js +75 -0
  391. package/dist/esm/Components/NavLauncher/engine/index.js +14 -0
  392. package/dist/esm/Components/NavLauncher/launcherParts.js +46 -10
  393. package/dist/esm/Components/NavLauncher/match.js +25 -12
  394. package/dist/esm/Components/NavLauncher/searchLayout.js +101 -0
  395. package/dist/esm/Components/NavLauncher/spotlight.js +194 -0
  396. package/dist/esm/Components/NavLauncher/spotlightParts.js +108 -0
  397. package/dist/esm/Components/NavLauncher/useCopiedFlash.js +17 -0
  398. package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -5
  399. package/dist/esm/Components/NoteTextArea/NoteTextArea.js +12 -17
  400. package/dist/esm/Components/Notification/Notification.js +20 -22
  401. package/dist/esm/Components/NotificationBell/notificationHelpers.js +12 -6
  402. package/dist/esm/Components/OffersList/OffersList.js +4 -2
  403. package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
  404. package/dist/esm/Components/OptionChip/optionInk.js +4 -2
  405. package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
  406. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -7
  407. package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -8
  408. package/dist/esm/Components/PlanPill/PlanPill.js +4 -2
  409. package/dist/esm/Components/ProductCard/ProductCardAction.js +2 -1
  410. package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
  411. package/dist/esm/Components/ProductDetails/ProductDetails.js +2 -1
  412. package/dist/esm/Components/ProfileCard/ProfileCard.js +6 -17
  413. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
  414. package/dist/esm/Components/ProgressBar/ProgressBar.js +2 -1
  415. package/dist/esm/Components/QuantityStepper/QuantityStepper.js +5 -2
  416. package/dist/esm/Components/QueryState/QueryStateBoundary.js +5 -1
  417. package/dist/esm/Components/RadioButton/RadioButton.js +2 -3
  418. package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -8
  419. package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -3
  420. package/dist/esm/Components/SearchSelect/SearchSelect.js +8 -5
  421. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +1 -1
  422. package/dist/esm/Components/Select/Select.js +6 -0
  423. package/dist/esm/Components/Select/SelectPopup.js +171 -64
  424. package/dist/esm/Components/Select/groupedWindow.js +44 -0
  425. package/dist/esm/Components/SelectSearch/SelectSearch.js +49 -39
  426. package/dist/esm/Components/SelectV2/SelectV2.js +1 -1
  427. package/dist/esm/Components/SideBar/SecondaryBar.js +3 -2
  428. package/dist/esm/Components/SideBar/components/MenuItemBox.js +3 -2
  429. package/dist/esm/Components/SideBar/components/MenuItems.js +1 -1
  430. package/dist/esm/Components/SideBar/components/OtherApps.js +2 -2
  431. package/dist/esm/Components/SideBar/components/PinnedSection.js +1 -1
  432. package/dist/esm/Components/SideBar/sidebarScale.js +2 -2
  433. package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +8 -3
  434. package/dist/esm/Components/SignInActivityTable/scrollRegionRing.js +9 -0
  435. package/dist/esm/Components/Slider/Slider.js +6 -5
  436. package/dist/esm/Components/StageProgress/StageItem.js +2 -1
  437. package/dist/esm/Components/StageProgress/StageProgress.js +8 -2
  438. package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
  439. package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -1
  440. package/dist/esm/Components/Table/Table.js +8 -6
  441. package/dist/esm/Components/Table/components/HeaderActions.js +7 -5
  442. package/dist/esm/Components/Table/components/TableBody.js +13 -8
  443. package/dist/esm/Components/Table/components/TableGroupRow.js +2 -1
  444. package/dist/esm/Components/Table/components/TableHeader.js +19 -23
  445. package/dist/esm/Components/Table/components/TableLoading.js +6 -3
  446. package/dist/esm/Components/Table/components/rowDetail.js +3 -2
  447. package/dist/esm/Components/Table/filters/ActiveFilters.js +8 -5
  448. package/dist/esm/Components/Table/filters/CompactSelect.js +2 -1
  449. package/dist/esm/Components/Table/filters/FilterDatePicker.js +20 -0
  450. package/dist/esm/Components/Table/filters/LeftFilterPane.js +14 -6
  451. package/dist/esm/Components/Table/hooks/useTable.js +11 -7
  452. package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
  453. package/dist/esm/Components/Table/settings/TableSettings.js +4 -4
  454. package/dist/esm/Components/Tabs/Tabs.js +1 -0
  455. package/dist/esm/Components/Tabs/components/TabList.js +1 -0
  456. package/dist/esm/Components/Tabs/components/TabPanel.js +1 -0
  457. package/dist/esm/Components/Tabs/tabStyles.js +5 -3
  458. package/dist/esm/Components/Tag/Tag.js +5 -4
  459. package/dist/esm/Components/Tag/Tag.styles.js +5 -4
  460. package/dist/esm/Components/Tag/tagDot.js +10 -3
  461. package/dist/esm/Components/TagInput/TagInput.js +8 -7
  462. package/dist/esm/Components/TagInput/tagEntries.js +16 -4
  463. package/dist/esm/Components/TimePicker/TimePicker.js +7 -3
  464. package/dist/esm/Components/Timeline/Timeline.js +14 -10
  465. package/dist/esm/Components/Toaster/Toaster.js +2 -1
  466. package/dist/esm/Components/Toggle/TableToggle.js +1 -1
  467. package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -2
  468. package/dist/esm/Components/UserDetails/UserDetails.js +5 -7
  469. package/dist/esm/Components/WishlistToggle/WishlistToggle.js +2 -1
  470. package/dist/esm/Components/WizardDialog/WizardDialog.js +15 -3
  471. package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +12 -2
  472. package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +7 -4
  473. package/dist/esm/Hooks/useOutsideMouseDown.js +26 -0
  474. package/dist/esm/Hooks/usePreferences.js +30 -12
  475. package/dist/esm/Hooks/useScrollableRegion.js +33 -0
  476. package/dist/esm/Theme/chakra/Menu.styles.js +6 -0
  477. package/dist/esm/Theme/chakra/componentStyles.js +1 -1
  478. package/dist/esm/Theme/chakra/focusRing.styles.js +3 -3
  479. package/dist/esm/Theme/chakra/paletteFromTheme.js +16 -3
  480. package/dist/esm/Theme/chakra/ringShadow.js +3 -0
  481. package/dist/esm/Theme/provider/ThemeSwitcher.js +1 -1
  482. package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +5 -5
  483. package/dist/esm/Theme/tokens/builders/filledSurface.js +3 -2
  484. package/dist/esm/Theme/tokens/builders/focusRing.js +4 -1
  485. package/dist/esm/Theme/tokens/builders/paletteScale.js +6 -0
  486. package/dist/esm/Utils/tabular.js +56 -0
  487. package/dist/esm/index.js +18 -25
  488. package/dist/index.d.ts +59 -5
  489. package/dist/index.js +36 -29
  490. package/package.json +3 -1
  491. package/dist/Components/Buttons/Buttons.d.ts +0 -3
  492. package/dist/Components/Buttons/Buttons.js +0 -9
  493. package/dist/Components/Buttons/ButtonsProps.d.ts +0 -12
  494. package/dist/Components/Common/ErrorComponent.d.ts +0 -7
  495. package/dist/Components/Common/ErrorComponent.js +0 -16
  496. package/dist/Components/Common/FormattedDescription.d.ts +0 -7
  497. package/dist/Components/Common/FormattedDescription.js +0 -62
  498. package/dist/Components/Common/Label.d.ts +0 -9
  499. package/dist/Components/Common/Label.js +0 -12
  500. package/dist/Components/Input/Input/Input.d.ts +0 -4
  501. package/dist/Components/Input/Input/Input.js +0 -75
  502. package/dist/Components/Input/Input/InputProps.d.ts +0 -24
  503. package/dist/Components/Input/Input/InputProps.js +0 -2
  504. package/dist/Components/ProductCard/productCardFixtures.d.ts +0 -7
  505. package/dist/Components/ProductCard/productCardFixtures.js +0 -61
  506. package/dist/esm/Components/Buttons/Buttons.js +0 -4
  507. package/dist/esm/Components/Common/ErrorComponent.js +0 -14
  508. package/dist/esm/Components/Common/FormattedDescription.js +0 -60
  509. package/dist/esm/Components/Common/Label.js +0 -10
  510. package/dist/esm/Components/Input/Input/Input.js +0 -37
  511. package/dist/esm/Components/Input/Input/InputProps.js +0 -1
  512. package/dist/esm/Components/ProductCard/productCardFixtures.js +0 -58
  513. package/dist/esm/services/feedback.js +0 -15
  514. package/dist/services/feedback.d.ts +0 -12
  515. package/dist/services/feedback.js +0 -18
  516. /package/dist/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
  517. /package/dist/esm/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
@@ -0,0 +1,136 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Flex } from "@chakra-ui/react";
3
+ import { ChevronLeft, ChevronRight } from "lucide-react";
4
+ import { useCallback, useEffect, useRef, useState, } from "react";
5
+ import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
6
+ import { reducedMotionSx, usePrefersReducedMotion, } from "../../Theme/chakra/motion.js";
7
+ import { AA_NON_TEXT, liftToContrast, } from "../../Theme/tokens/builders/outlineRung.js";
8
+ import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
9
+ import { raisedRule } from "../../Theme/tokens/builders/surfaceRaised.js";
10
+ import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
11
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
12
+ const EDGE = 36;
13
+ const MAX_COUNT = 99;
14
+ const STEPS = {
15
+ ArrowRight: 1,
16
+ ArrowDown: 1,
17
+ ArrowLeft: -1,
18
+ ArrowUp: -1,
19
+ };
20
+ const HIDDEN_SCROLLBAR = {
21
+ scrollbarWidth: "none",
22
+ "&::-webkit-scrollbar": { display: "none" },
23
+ };
24
+ const NO_EDGES = { start: false, end: false };
25
+ const fadeMask = ({ start, end }) => start || end
26
+ ? `linear-gradient(to right, ${start ? "transparent" : "black"}, black ${EDGE}px, black calc(100% - ${EDGE}px), ${end ? "transparent" : "black"})`
27
+ : "none";
28
+ function PageArrow({ side, onPage, }) {
29
+ const { colors } = useCustomTheme();
30
+ const Icon = side === "start" ? ChevronLeft : ChevronRight;
31
+ return (_jsx(Box, { as: "button", type: "button", tabIndex: -1, "aria-hidden": true, "data-testid": `launcher-scopes-${side}`, onMouseDown: (event) => event.preventDefault(), onClick: onPage, position: "absolute", top: "50%", left: side === "start" ? 0 : undefined, right: side === "end" ? 0 : undefined, transform: "translateY(-50%)", display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: "28px", borderRadius: "full", borderWidth: "1px", borderColor: raisedRule(colors), bg: colors.surfaceRaised, boxShadow: `0 1px 3px ${colors.boxShadow.default}`, color: colors.textMuted, cursor: "pointer", _hover: { color: colors.text[900] }, sx: { "@media (hover: none)": { display: "none" } }, children: _jsx(Icon, { size: 16, "aria-hidden": true }) }));
32
+ }
33
+ export function ScopeBar({ scopes, value, onChange, label, countLabel, }) {
34
+ const { colors } = useCustomTheme();
35
+ const stripRef = useRef(null);
36
+ const chipRefs = useRef([]);
37
+ const [edges, setEdges] = useState(NO_EDGES);
38
+ const reduced = usePrefersReducedMotion();
39
+ const selected = Math.max(0, scopes.findIndex((scope) => scope.id === value));
40
+ const layoutKey = scopes.map((s) => { var _a; return `${s.id}:${(_a = s.count) !== null && _a !== void 0 ? _a : ""}`; }).join("|");
41
+ const edge = liftToContrast(colors.primary[500], colors.surfaceRaised, AA_NON_TEXT);
42
+ const rule = raisedRule(colors);
43
+ const measure = useCallback(() => {
44
+ const strip = stripRef.current;
45
+ if (!strip)
46
+ return;
47
+ const start = strip.scrollLeft > 1;
48
+ const end = strip.scrollLeft + strip.clientWidth < strip.scrollWidth - 1;
49
+ setEdges((prev) => prev.start === start && prev.end === end ? prev : { start, end });
50
+ }, []);
51
+ useEffect(() => {
52
+ const strip = stripRef.current;
53
+ if (!strip || typeof ResizeObserver === "undefined")
54
+ return undefined;
55
+ const observer = new ResizeObserver(measure);
56
+ observer.observe(strip);
57
+ if (strip.firstElementChild)
58
+ observer.observe(strip.firstElementChild);
59
+ return () => observer.disconnect();
60
+ }, [measure]);
61
+ useEffect(() => {
62
+ const strip = stripRef.current;
63
+ const chip = chipRefs.current[selected];
64
+ if (strip && chip) {
65
+ const from = chip.offsetLeft - EDGE;
66
+ const to = chip.offsetLeft + chip.offsetWidth + EDGE - strip.clientWidth;
67
+ if (from < strip.scrollLeft)
68
+ strip.scrollLeft = Math.max(0, from);
69
+ else if (to > strip.scrollLeft)
70
+ strip.scrollLeft = to;
71
+ }
72
+ measure();
73
+ }, [selected, layoutKey, measure]);
74
+ const onKeyDown = (event) => {
75
+ var _a;
76
+ if (event.altKey || event.ctrlKey || event.metaKey)
77
+ return;
78
+ const step = STEPS[event.key];
79
+ const last = scopes.length - 1;
80
+ const next = step !== undefined
81
+ ? (selected + step + scopes.length) % scopes.length
82
+ : event.key === "Home"
83
+ ? 0
84
+ : event.key === "End"
85
+ ? last
86
+ : -1;
87
+ if (next < 0)
88
+ return;
89
+ event.preventDefault();
90
+ (_a = chipRefs.current[next]) === null || _a === void 0 ? void 0 : _a.focus();
91
+ onChange(scopes[next].id);
92
+ };
93
+ const onWheel = (event) => {
94
+ const strip = event.currentTarget;
95
+ if (Math.abs(event.deltaY) <= Math.abs(event.deltaX))
96
+ return;
97
+ if (strip.scrollWidth > strip.clientWidth)
98
+ strip.scrollLeft += event.deltaY;
99
+ };
100
+ const page = (direction) => {
101
+ const strip = stripRef.current;
102
+ if (!strip)
103
+ return;
104
+ const step = Math.max(strip.clientWidth - EDGE * 2, EDGE);
105
+ const max = Math.max(0, strip.scrollWidth - strip.clientWidth);
106
+ const left = Math.min(max, Math.max(0, strip.scrollLeft + direction * step));
107
+ if (reduced || typeof strip.scrollTo !== "function")
108
+ strip.scrollLeft = left;
109
+ else
110
+ strip.scrollTo({ left, behavior: "smooth" });
111
+ };
112
+ const mask = fadeMask(edges);
113
+ return (_jsxs(Box, { position: "relative", minW: 0, flexShrink: 1, children: [_jsx(Box, { ref: stripRef, "data-testid": "launcher-scopes", overflowX: "auto", overflowY: "hidden", onScroll: measure, onWheel: onWheel, sx: { ...HIDDEN_SCROLLBAR, maskImage: mask, WebkitMaskImage: mask }, children: _jsx(Flex, { role: "radiogroup", "aria-label": label, onKeyDown: onKeyDown, gap: "6px", w: "max-content", p: "5px", children: scopes.map((scope, index) => {
114
+ var _a, _b;
115
+ const isSelected = index === selected;
116
+ const hasCount = scope.count !== undefined;
117
+ return (_jsxs(Box, { as: "button", type: "button", ref: (node) => {
118
+ chipRefs.current[index] = node;
119
+ }, role: "radio", "aria-checked": isSelected, "aria-label": hasCount
120
+ ? countLabel(scope.label, (_a = scope.count) !== null && _a !== void 0 ? _a : 0)
121
+ : undefined, tabIndex: isSelected ? 0 : -1, onClick: () => onChange(scope.id), display: "inline-flex", alignItems: "center", gap: "6px", flexShrink: 0, h: "32px", pl: "12px", pr: hasCount ? "6px" : "12px", borderRadius: "full", borderWidth: "1px", borderColor: isSelected ? edge : rule, bg: isSelected ? colors.primary[50] : colors.surfaceRaised, color: isSelected ? colors.accentText : colors.textMuted, fontSize: "xs-plus", fontWeight: isSelected ? 600 : 500, whiteSpace: "nowrap", cursor: "pointer", transition: transitionFor([
122
+ "background-color",
123
+ "border-color",
124
+ "color",
125
+ ]), _hover: isSelected
126
+ ? undefined
127
+ : {
128
+ bg: listRowBackgrounds(colors).active,
129
+ color: colors.text[900],
130
+ }, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, children: [scope.label, hasCount ? (_jsx(Box, { as: "span", minW: "20px", h: "20px", px: "6px", borderRadius: "full", bg: isSelected
131
+ ? colors.surfaceRaised
132
+ : colors.backgroundColor.subtle, fontSize: "11.5px", fontWeight: 600, display: "inline-flex", alignItems: "center", justifyContent: "center", sx: { fontVariantNumeric: "tabular-nums" }, children: ((_b = scope.count) !== null && _b !== void 0 ? _b : 0) > MAX_COUNT
133
+ ? `${MAX_COUNT}+`
134
+ : scope.count })) : null] }, scope.id));
135
+ }) }) }), edges.start ? _jsx(PageArrow, { side: "start", onPage: () => page(-1) }) : null, edges.end ? _jsx(PageArrow, { side: "end", onPage: () => page(1) }) : null] }));
136
+ }
@@ -0,0 +1,37 @@
1
+ /** Damerau-Levenshtein (optimal string alignment) distance; returns `max + 1` once it exceeds `max`. */
2
+ export const editDistance = (a, b, max) => {
3
+ if (a === b)
4
+ return 0;
5
+ const la = a.length;
6
+ const lb = b.length;
7
+ if (Math.abs(la - lb) > max)
8
+ return max + 1;
9
+ if (la === 0 || lb === 0)
10
+ return Math.max(la, lb);
11
+ let before = new Int32Array(lb + 1);
12
+ let prev = new Int32Array(lb + 1);
13
+ let cur = new Int32Array(lb + 1);
14
+ for (let j = 0; j <= lb; j += 1)
15
+ prev[j] = j;
16
+ for (let i = 1; i <= la; i += 1) {
17
+ cur[0] = i;
18
+ let rowMin = i;
19
+ for (let j = 1; j <= lb; j += 1) {
20
+ const cost = a[i - 1] === b[j - 1] ? 0 : 1;
21
+ let value = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + cost);
22
+ if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
23
+ value = Math.min(value, before[j - 2] + 1);
24
+ }
25
+ cur[j] = value;
26
+ if (value < rowMin)
27
+ rowMin = value;
28
+ }
29
+ if (rowMin > max)
30
+ return max + 1;
31
+ const spare = before;
32
+ before = prev;
33
+ prev = cur;
34
+ cur = spare;
35
+ }
36
+ return Math.min(prev[lb], max + 1);
37
+ };
@@ -0,0 +1,459 @@
1
+ import { editDistance } from "./distance.js";
2
+ import { foldText, foldWithMap, hasMarks, letters, splitWords, tokenize, } from "./fold.js";
3
+ const KIND_SCORE = {
4
+ exact: 100,
5
+ prefix: 88,
6
+ word: 78,
7
+ "word-prefix": 68,
8
+ initialism: 60,
9
+ substring: 46,
10
+ fuzzy: 34,
11
+ subsequence: 16,
12
+ };
13
+ const COMPLETENESS = 6;
14
+ const SYNONYM_FACTOR = 0.92;
15
+ const STEM_PENALTY = 1;
16
+ const MAX_ALTERNATIVES = 12;
17
+ const UNBOUNDED_SLACK = 32;
18
+ // NOTE: code points, not a literal; see ANUSVARA in fold.ts.
19
+ const TAMIL_FINAL_MA = String.fromCodePoint(0x0bae, 0x0bcd);
20
+ const WORD_RE = /[\p{L}\p{N}\p{M}]+/gu;
21
+ const charBit = (code) => {
22
+ if (code >= 97 && code <= 122)
23
+ return 1 << (code - 97);
24
+ return code >= 48 && code <= 57 ? 1 << 26 : 1 << (27 + (code % 4));
25
+ };
26
+ const maskOf = (text) => {
27
+ let mask = 0;
28
+ for (let i = 0; i < text.length; i += 1)
29
+ mask |= charBit(text.charCodeAt(i));
30
+ return mask;
31
+ };
32
+ const missingChars = (token, field) => {
33
+ let rest = token & ~field;
34
+ let count = 0;
35
+ for (; rest; count += 1)
36
+ rest &= rest - 1;
37
+ return count;
38
+ };
39
+ const maxEdits = (size) => (size >= 8 ? 2 : 1);
40
+ const writtenSize = (text, marked) => marked ? letters(text).length : text.length;
41
+ const indexField = ({ name, text, weight = 1, }) => {
42
+ var _a;
43
+ const folded = foldText(text).trim();
44
+ const words = [];
45
+ const starts = [];
46
+ for (const match of folded.matchAll(WORD_RE)) {
47
+ words.push(match[0]);
48
+ starts.push((_a = match.index) !== null && _a !== void 0 ? _a : 0);
49
+ }
50
+ const letterWords = hasMarks(folded) ? words.map(letters) : null;
51
+ return {
52
+ name,
53
+ text,
54
+ weight,
55
+ folded,
56
+ compact: words.join(""),
57
+ words,
58
+ starts,
59
+ initials: (letterWords !== null && letterWords !== void 0 ? letterWords : words).map((w) => w[0]).join(""),
60
+ mask: maskOf(folded),
61
+ letterWords,
62
+ };
63
+ };
64
+ export const createSearchIndex = (documents) => {
65
+ const indexed = documents.map((doc, index) => {
66
+ const fields = doc.fields.filter((f) => f.text).map(indexField);
67
+ return {
68
+ id: doc.id,
69
+ index,
70
+ fields,
71
+ mask: fields.reduce((mask, f) => mask | f.mask, 0),
72
+ };
73
+ });
74
+ return { size: indexed.length, documents: indexed };
75
+ };
76
+ const startsLikely = (token, word) => word[0][0] === token[0][0] || (word[0] === token[1] && word[1] === token[0]);
77
+ const fuzzyScore = (token, words) => {
78
+ const max = maxEdits(token.length);
79
+ let best = 0;
80
+ for (let w = 0; w < words.length; w += 1) {
81
+ const word = words[w];
82
+ if (!startsLikely(token, word))
83
+ continue;
84
+ if (Math.abs(word.length - token.length) <= max) {
85
+ const d = editDistance(token, word, max);
86
+ if (d <= max)
87
+ best = Math.max(best, KIND_SCORE.fuzzy - 8 * (d - 1));
88
+ }
89
+ if (token.length < 5 || best >= KIND_SCORE.fuzzy)
90
+ continue;
91
+ for (let len = token.length - 1; len <= token.length + 1; len += 1) {
92
+ if (len >= word.length)
93
+ break;
94
+ const d = editDistance(token, word.slice(0, len), max);
95
+ if (d <= max)
96
+ best = Math.max(best, KIND_SCORE.fuzzy - 4 - 8 * (d - 1));
97
+ }
98
+ }
99
+ return best;
100
+ };
101
+ const subsequenceOf = (need, have) => {
102
+ if (have.length <= need.length || have[0] !== need[0])
103
+ return null;
104
+ const positions = [0];
105
+ for (let i = 1, at = 1; i < need.length; i += 1) {
106
+ const next = have.indexOf(need[i], at);
107
+ if (next < 0)
108
+ return null;
109
+ positions.push(next);
110
+ at = next + 1;
111
+ }
112
+ return positions;
113
+ };
114
+ const offsetIn = (have, index) => typeof have === "string" ? index : have.slice(0, index).join("").length;
115
+ const subsequenceAt = (token, words, starts, marked) => {
116
+ const need = marked ? letters(token) : token;
117
+ for (let k = 0; k < words.length; k += 1) {
118
+ const have = marked ? letters(words[k]) : words[k];
119
+ const positions = subsequenceOf(need, have);
120
+ if (positions)
121
+ return positions.map((p) => starts[k] + offsetIn(have, p));
122
+ }
123
+ return null;
124
+ };
125
+ const fuzzyOnly = (token, field, floor) => {
126
+ var _a, _b;
127
+ if (KIND_SCORE.fuzzy < floor)
128
+ return null;
129
+ const score = fuzzyScore((_a = token.letters) !== null && _a !== void 0 ? _a : token.text, (_b = field.letterWords) !== null && _b !== void 0 ? _b : field.words);
130
+ return score > 0 ? { kind: "fuzzy", base: score } : null;
131
+ };
132
+ const matchToken = (tokenInfo, field, floor) => {
133
+ var _a, _b;
134
+ const { text: token, mask, edits, slack } = tokenInfo;
135
+ const missing = missingChars(mask, field.mask);
136
+ if (missing > 0)
137
+ return missing <= slack ? fuzzyOnly(tokenInfo, field, floor) : null;
138
+ const ratio = (COMPLETENESS * token.length) / Math.max(field.folded.length, token.length);
139
+ if (field.folded === token)
140
+ return { kind: "exact", base: KIND_SCORE.exact + COMPLETENESS };
141
+ if (field.folded.startsWith(token))
142
+ return { kind: "prefix", base: KIND_SCORE.prefix + ratio };
143
+ if (KIND_SCORE.word + COMPLETENESS < floor)
144
+ return null;
145
+ let isWordPrefix = false;
146
+ const { words } = field;
147
+ for (let w = 0; w < words.length; w += 1) {
148
+ if (words[w] === token)
149
+ return { kind: "word", base: KIND_SCORE.word + ratio };
150
+ if (words[w].startsWith(token))
151
+ isWordPrefix = true;
152
+ }
153
+ if (isWordPrefix)
154
+ return { kind: "word-prefix", base: KIND_SCORE["word-prefix"] + ratio };
155
+ if (token.length < 2 || KIND_SCORE.initialism < floor)
156
+ return null;
157
+ if (field.words.length >= 2 && field.initials.startsWith(token)) {
158
+ return { kind: "initialism", base: KIND_SCORE.initialism };
159
+ }
160
+ if (field.folded.includes(token) || field.compact.includes(token)) {
161
+ return { kind: "substring", base: KIND_SCORE.substring };
162
+ }
163
+ if (tokenInfo.exact)
164
+ return null;
165
+ if (edits > 0) {
166
+ const match = fuzzyOnly(tokenInfo, field, floor);
167
+ if (match)
168
+ return match;
169
+ }
170
+ if (KIND_SCORE.subsequence < floor)
171
+ return null;
172
+ const need = (_a = tokenInfo.letters) !== null && _a !== void 0 ? _a : token;
173
+ const lists = (_b = field.letterWords) !== null && _b !== void 0 ? _b : field.words;
174
+ return lists.some((have) => subsequenceOf(need, have))
175
+ ? { kind: "subsequence", base: KIND_SCORE.subsequence }
176
+ : null;
177
+ };
178
+ const reachable = (token, doc) => missingChars(token.mask, doc.mask) <= token.slack ||
179
+ (token.stem !== null && missingChars(token.stem.mask, doc.mask) === 0);
180
+ const scoreTokens = (doc, alt) => {
181
+ const { tokens } = alt;
182
+ const { fields } = doc;
183
+ for (let t = 0; t < tokens.length; t += 1) {
184
+ if (!reachable(tokens[t], doc))
185
+ return null;
186
+ }
187
+ let total = 0;
188
+ const matches = [];
189
+ for (let t = 0; t < tokens.length; t += 1) {
190
+ const token = tokens[t];
191
+ let best = 0;
192
+ let found = null;
193
+ for (let f = 0; f < fields.length; f += 1) {
194
+ const field = fields[f];
195
+ for (let form = token, penalty = 0; form; form = form.stem, penalty = STEM_PENALTY) {
196
+ const match = matchToken(form, field, best / field.weight + penalty);
197
+ if (!match)
198
+ continue;
199
+ const score = (match.base - penalty) * field.weight;
200
+ if (score > best) {
201
+ best = score;
202
+ found = {
203
+ token: token.text,
204
+ field: field.name,
205
+ text: field.text,
206
+ kind: match.kind,
207
+ };
208
+ }
209
+ }
210
+ }
211
+ if (!found)
212
+ return null;
213
+ total += best;
214
+ matches.push(found);
215
+ }
216
+ let score = total / tokens.length;
217
+ if (tokens.length > 1) {
218
+ const { phrase } = alt;
219
+ for (let f = 0; f < fields.length; f += 1) {
220
+ const field = fields[f];
221
+ if (field.weight < 1)
222
+ continue;
223
+ if (field.folded === phrase)
224
+ score += 20;
225
+ else if (field.folded.startsWith(phrase))
226
+ score += 10;
227
+ else if (field.folded.includes(phrase))
228
+ score += 5;
229
+ }
230
+ }
231
+ return { score, matches };
232
+ };
233
+ const compiled = new WeakMap();
234
+ const synonymGroups = (synonyms) => {
235
+ const cached = compiled.get(synonyms);
236
+ if (cached)
237
+ return cached;
238
+ const groups = Object.entries(synonyms).map(([term, phrases]) => [term, ...phrases].map(tokenize).filter((tokens) => tokens.length > 0));
239
+ compiled.set(synonyms, groups);
240
+ return groups;
241
+ };
242
+ const findRun = (tokens, run) => {
243
+ for (let at = 0; at + run.length <= tokens.length; at += 1) {
244
+ if (run.every((t, i) => tokens[at + i] === t))
245
+ return at;
246
+ }
247
+ return -1;
248
+ };
249
+ const alternatives = (tokens, synonyms) => {
250
+ const out = [{ tokens }];
251
+ if (!synonyms || tokens.length === 0)
252
+ return out;
253
+ const seen = new Set([tokens.join(" ")]);
254
+ for (const group of synonymGroups(synonyms)) {
255
+ for (const member of group) {
256
+ const at = findRun(tokens, member);
257
+ if (at < 0)
258
+ continue;
259
+ for (const other of group) {
260
+ if (other === member)
261
+ continue;
262
+ const next = [
263
+ ...tokens.slice(0, at),
264
+ ...other,
265
+ ...tokens.slice(at + member.length),
266
+ ];
267
+ const key = next.join(" ");
268
+ if (seen.has(key))
269
+ continue;
270
+ seen.add(key);
271
+ out.push({ tokens: Array.from(new Set(next)), via: other.join(" ") });
272
+ if (out.length >= MAX_ALTERNATIVES)
273
+ return out;
274
+ }
275
+ }
276
+ }
277
+ return out;
278
+ };
279
+ const stemOf = (text) => text.endsWith(TAMIL_FINAL_MA) && letters(text).length > 2
280
+ ? text.slice(0, -TAMIL_FINAL_MA.length)
281
+ : null;
282
+ const toToken = (text, fuzzy) => {
283
+ const written = hasMarks(text) ? letters(text) : null;
284
+ const size = written ? written.length : text.length;
285
+ const edits = fuzzy && size >= 4 ? maxEdits(size) : 0;
286
+ const stem = stemOf(text);
287
+ return {
288
+ text,
289
+ mask: maskOf(text),
290
+ edits,
291
+ slack: written && edits > 0 ? UNBOUNDED_SLACK : edits,
292
+ letters: written,
293
+ exact: false,
294
+ stem: stem === null
295
+ ? null
296
+ : {
297
+ text: stem,
298
+ mask: maskOf(stem),
299
+ edits: 0,
300
+ slack: 0,
301
+ letters: null,
302
+ exact: true,
303
+ stem: null,
304
+ },
305
+ };
306
+ };
307
+ const compileQuery = (tokens, options) => alternatives(tokens, options.synonyms).map(({ tokens: words, via }) => ({
308
+ tokens: words.map((text) => toToken(text, options.fuzzy !== false)),
309
+ phrase: words.join(" "),
310
+ via,
311
+ }));
312
+ export const searchIndex = (index, query, options = {}) => {
313
+ var _a, _b, _c;
314
+ const tokens = tokenize(query);
315
+ if (tokens.length === 0)
316
+ return [];
317
+ const alts = compileQuery(tokens, options);
318
+ const hits = [];
319
+ const { documents } = index;
320
+ for (let d = 0; d < documents.length; d += 1) {
321
+ const doc = documents[d];
322
+ let best = null;
323
+ for (let a = 0; a < alts.length; a += 1) {
324
+ const alt = alts[a];
325
+ const result = scoreTokens(doc, alt);
326
+ if (!result)
327
+ continue;
328
+ const score = alt.via ? result.score * SYNONYM_FACTOR : result.score;
329
+ if (!best || score > best.score) {
330
+ best = {
331
+ id: doc.id,
332
+ index: doc.index,
333
+ score,
334
+ matches: result.matches,
335
+ synonym: alt.via,
336
+ };
337
+ }
338
+ }
339
+ if (!best)
340
+ continue;
341
+ best.score += (_b = (_a = options.boosts) === null || _a === void 0 ? void 0 : _a[doc.id]) !== null && _b !== void 0 ? _b : 0;
342
+ hits.push(best);
343
+ }
344
+ hits.sort((a, b) => b.score - a.score || a.index - b.index);
345
+ const floor = hits.length ? hits[0].score * ((_c = options.relativeCutoff) !== null && _c !== void 0 ? _c : 0) : 0;
346
+ const kept = floor > 0 ? hits.filter((hit) => hit.score >= floor) : hits;
347
+ return options.limit === undefined ? kept : kept.slice(0, options.limit);
348
+ };
349
+ export const searchDocuments = (documents, query, options) => searchIndex(createSearchIndex(documents), query, options);
350
+ /** Compiles `query` once; every query word must hit some text of the row. */
351
+ export const createMatcher = (query, options = {}) => {
352
+ const tokens = tokenize(query);
353
+ if (tokens.length === 0)
354
+ return () => true;
355
+ const alts = compileQuery(tokens, options);
356
+ return (...texts) => {
357
+ const fields = texts
358
+ .filter((text) => Boolean(text))
359
+ .map((text) => indexField({ name: "text", text }));
360
+ const doc = {
361
+ id: "",
362
+ index: 0,
363
+ fields,
364
+ mask: fields.reduce((mask, f) => mask | f.mask, 0),
365
+ };
366
+ return alts.some((alt) => scoreTokens(doc, alt) !== null);
367
+ };
368
+ };
369
+ /** One-off form of `createMatcher`: does `query` match the row made of `texts`? */
370
+ export const matchesQuery = (query, ...texts) => createMatcher(query)(...texts);
371
+ const markEnd = (text, end) => {
372
+ let at = end;
373
+ while (at < text.length && /\p{M}/u.test(text[at]))
374
+ at += 1;
375
+ return at;
376
+ };
377
+ const tokenRanges = (token, folded, words, starts, fuzzy) => {
378
+ var _a;
379
+ const ranges = [];
380
+ if (token.length >= 2) {
381
+ for (let at = folded.indexOf(token); at !== -1; at = folded.indexOf(token, at + token.length)) {
382
+ ranges.push([at, at + token.length]);
383
+ }
384
+ }
385
+ else {
386
+ words.forEach((word, i) => {
387
+ if (word.startsWith(token))
388
+ ranges.push([starts[i], starts[i] + 1]);
389
+ });
390
+ }
391
+ if (ranges.length || token.length < 2)
392
+ return ranges;
393
+ const marked = hasMarks(token) || hasMarks(folded);
394
+ const firsts = words.map((w) => (marked ? letters(w)[0] : w[0]));
395
+ if (words.length >= 2 && firsts.join("").startsWith(token)) {
396
+ return Array.from(marked ? letters(token) : token, (_, i) => [starts[i], starts[i] + firsts[i].length]);
397
+ }
398
+ if (fuzzy && writtenSize(token, marked) >= 4) {
399
+ words.forEach((word, i) => {
400
+ if (fuzzyScore(marked ? letters(token) : token, [
401
+ marked ? letters(word) : word,
402
+ ]) > 0)
403
+ ranges.push([starts[i], starts[i] + word.length]);
404
+ });
405
+ if (ranges.length)
406
+ return ranges;
407
+ }
408
+ return ((_a = subsequenceAt(token, words, starts, marked)) !== null && _a !== void 0 ? _a : []).map((p) => [p, p + 1]);
409
+ };
410
+ /** Character ranges of `text` a query matched, in original-text offsets, merged and sorted. */
411
+ export const highlightRanges = (text, query, options = {}) => {
412
+ var _a;
413
+ const tokens = Array.from(new Set(alternatives(tokenize(query), options.synonyms)
414
+ .flatMap((a) => a.tokens)
415
+ .flatMap((token) => {
416
+ const stem = stemOf(token);
417
+ return stem ? [token, stem] : [token];
418
+ })));
419
+ if (tokens.length === 0 || !text)
420
+ return [];
421
+ const { folded, map } = foldWithMap(text);
422
+ const words = [];
423
+ const starts = [];
424
+ for (const match of folded.matchAll(WORD_RE)) {
425
+ words.push(match[0]);
426
+ starts.push((_a = match.index) !== null && _a !== void 0 ? _a : 0);
427
+ }
428
+ const ranges = tokens
429
+ .flatMap((token) => tokenRanges(token, folded, words, starts, options.fuzzy !== false))
430
+ .sort((a, b) => a[0] - b[0]);
431
+ const merged = [];
432
+ for (const [start, end] of ranges) {
433
+ const last = merged[merged.length - 1];
434
+ if (last && start <= last[1])
435
+ last[1] = Math.max(last[1], end);
436
+ else
437
+ merged.push([start, end]);
438
+ }
439
+ return merged.map(([start, end]) => {
440
+ var _a;
441
+ const lastChar = map[end - 1];
442
+ const width = ((_a = text.codePointAt(lastChar)) !== null && _a !== void 0 ? _a : 0) > 0xffff ? 2 : 1;
443
+ return [map[start], markEnd(text, lastChar + width)];
444
+ });
445
+ };
446
+ /** Additive ranking points from usage: pinned flat, frequent and recent decaying by position. */
447
+ export const usageBoosts = (usage) => {
448
+ const out = {};
449
+ const add = (ids, weight, decays) => ids === null || ids === void 0 ? void 0 : ids.forEach((id, i) => {
450
+ var _a;
451
+ const factor = decays ? Math.max(0.25, 1 - i / ids.length) : 1;
452
+ out[id] = ((_a = out[id]) !== null && _a !== void 0 ? _a : 0) + weight * factor;
453
+ });
454
+ add(usage.pinnedIds, 3, false);
455
+ add(usage.frequentIds, 4, true);
456
+ add(usage.recentIds, 2, true);
457
+ return out;
458
+ };
459
+ export { editDistance, foldText, splitWords, tokenize };