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.
- package/CHANGELOG.md +520 -21
- package/COMPONENT-GOTCHAS.md +187 -95
- package/DESIGN-GUIDE.md +54 -10
- package/README.md +37 -3
- package/dist/Components/Accordion/Accordion.js +11 -8
- package/dist/Components/Accordion/AccordionProps.d.ts +4 -0
- package/dist/Components/Accordion/accordionColors.js +1 -2
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +2 -2
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -1
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +3 -1
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.d.ts +2 -0
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.js +13 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +3 -1
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/Components/AppSwitcher/pixelizeSuite.d.ts +24 -0
- package/dist/Components/AppSwitcher/pixelizeSuite.js +71 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.js +7 -6
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +1 -1
- package/dist/Components/Button/Button.styles.js +5 -2
- package/dist/Components/Button/ButtonProps.d.ts +2 -4
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/Components/CalendarGrid/CalendarGridProps.d.ts +1 -1
- package/dist/Components/Card/Card.d.ts +1 -0
- package/dist/Components/Card/Card.js +1 -0
- package/dist/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/Components/CheckoutKit/selectable.d.ts +3 -1
- package/dist/Components/CheckoutKit/selectable.js +10 -7
- package/dist/Components/CheckoutKit/tonalHover.d.ts +2 -0
- package/dist/Components/CheckoutKit/tonalHover.js +6 -0
- package/dist/Components/ChoiceCard/ChoiceCard.d.ts +1 -1
- package/dist/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +6 -0
- package/dist/Components/Common/FieldMessage.d.ts +1 -0
- package/dist/Components/Common/FormLabel.d.ts +1 -1
- package/dist/Components/Common/FormLabel.js +4 -3
- package/dist/Components/Common/HelperText.d.ts +2 -2
- package/dist/Components/Common/HelperText.js +1 -2
- package/dist/Components/Common/activationKey.d.ts +5 -0
- package/dist/Components/Common/activationKey.js +12 -0
- package/dist/Components/Common/dataAttributes.d.ts +4 -0
- package/dist/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/Components/Common/findSlot.d.ts +2 -0
- package/dist/Components/Common/findSlot.js +24 -0
- package/dist/Components/Common/surfaceFocusRing.d.ts +1 -0
- package/dist/Components/Common/surfaceFocusRing.js +7 -0
- package/dist/Components/ConfirmDialog/ConfirmDialog.js +17 -5
- package/dist/Components/ConfirmDialog/ConfirmDialogProps.d.ts +38 -10
- package/dist/Components/CopyButton/CopyButton.d.ts +4 -1
- package/dist/Components/CopyButton/CopyButton.js +5 -8
- package/dist/Components/CouponField/CouponField.js +5 -2
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/Components/DatePicker/CalendarPanel.d.ts +1 -0
- package/dist/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/Components/DatePicker/DatePicker.js +24 -26
- package/dist/Components/DatePicker/DatePickerProps.d.ts +8 -0
- package/dist/Components/DatePicker/PickerPortal.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +7 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/Components/DetailSections/DetailSections.js +2 -1
- package/dist/Components/Divider/Divider.d.ts +3 -3
- package/dist/Components/Divider/Divider.js +3 -3
- package/dist/Components/Drawer/Drawer.d.ts +3 -1
- package/dist/Components/Drawer/Drawer.js +28 -26
- package/dist/Components/Drawer/DrawerProps.d.ts +4 -0
- package/dist/Components/Dropdown/DropDown.js +6 -21
- package/dist/Components/Editor/Editor.js +6 -2
- package/dist/Components/Editor/EditorProps.d.ts +17 -1
- package/dist/Components/Editor/editorLabels.js +1 -0
- package/dist/Components/Editor/editorTokenStyles.d.ts +8 -0
- package/dist/Components/Editor/editorTokenStyles.js +9 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +9 -2
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +15 -1
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +21 -0
- package/dist/Components/EmptyState/FilteredEmptyState.d.ts +5 -0
- package/dist/Components/EmptyState/FilteredEmptyState.js +23 -0
- package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +1 -0
- package/dist/Components/FilePreview/FilePreview.js +7 -3
- package/dist/Components/FilePreview/FilePreviewProps.d.ts +2 -1
- package/dist/Components/FileUpload/FileUpload.js +8 -9
- package/dist/Components/FileUpload/FileUploadProps.d.ts +2 -2
- package/dist/Components/FileUploader/FileUploader.js +5 -6
- package/dist/Components/FilterSidebar/FilterSidebar.d.ts +7 -9
- package/dist/Components/FilterSidebar/FilterSidebar.js +90 -233
- package/dist/Components/FilterSidebar/OptionsSection.d.ts +14 -0
- package/dist/Components/FilterSidebar/OptionsSection.js +46 -0
- package/dist/Components/FilterSidebar/RangeSection.d.ts +17 -0
- package/dist/Components/FilterSidebar/RangeSection.js +80 -0
- package/dist/Components/FilterSidebar/SectionHeader.d.ts +13 -0
- package/dist/Components/FilterSidebar/SectionHeader.js +29 -0
- package/dist/Components/FilterSidebar/useStableCallback.d.ts +1 -0
- package/dist/Components/FilterSidebar/useStableCallback.js +12 -0
- package/dist/Components/Form/FormWrapper.d.ts +7 -7
- package/dist/Components/Form/FormWrapper.js +5 -3
- package/dist/Components/FormDrawer/FormDrawer.d.ts +1 -1
- package/dist/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/Components/FormDrawer/FormDrawerProps.d.ts +2 -0
- package/dist/Components/FormField/FormField.js +1 -1
- package/dist/Components/Header/Header.js +1 -1
- package/dist/Components/Header/HeaderActions.js +4 -2
- package/dist/Components/IconButton/IconButtonProps.d.ts +2 -1
- package/dist/Components/Input/TextInput.js +2 -2
- package/dist/Components/Input/TextInputProps.d.ts +3 -1
- package/dist/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/Components/LazyWrapper/LazyWrapper.d.ts +2 -1
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/MediaViewer/MediaViewer.js +4 -3
- package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/Components/MediaViewer/hooks/useFileViewer.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.js +5 -0
- package/dist/Components/Modal/Modal.d.ts +1 -0
- package/dist/Components/Modal/Modal.js +7 -25
- package/dist/Components/Modal/dialogNaming.d.ts +8 -0
- package/dist/Components/Modal/dialogNaming.js +21 -0
- package/dist/Components/Modal/warnDroppedSlotChildren.d.ts +1 -1
- package/dist/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
- package/dist/Components/NavLauncher/NavLauncher.js +288 -56
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +83 -5
- package/dist/Components/NavLauncher/ScopeBar.d.ts +14 -0
- package/dist/Components/NavLauncher/ScopeBar.js +139 -0
- package/dist/Components/NavLauncher/engine/distance.d.ts +4 -0
- package/dist/Components/NavLauncher/engine/distance.js +41 -0
- package/dist/Components/NavLauncher/engine/engine.d.ts +84 -0
- package/dist/Components/NavLauncher/engine/engine.js +472 -0
- package/dist/Components/NavLauncher/engine/fold.d.ts +15 -0
- package/dist/Components/NavLauncher/engine/fold.js +84 -0
- package/dist/Components/NavLauncher/engine/index.d.ts +21 -0
- package/dist/Components/NavLauncher/engine/index.js +17 -0
- package/dist/Components/NavLauncher/launcherParts.d.ts +14 -0
- package/dist/Components/NavLauncher/launcherParts.js +51 -13
- package/dist/Components/NavLauncher/match.d.ts +13 -2
- package/dist/Components/NavLauncher/match.js +26 -12
- package/dist/Components/NavLauncher/searchLayout.d.ts +61 -0
- package/dist/Components/NavLauncher/searchLayout.js +110 -0
- package/dist/Components/NavLauncher/spotlight.d.ts +39 -0
- package/dist/Components/NavLauncher/spotlight.js +202 -0
- package/dist/Components/NavLauncher/spotlightParts.d.ts +53 -0
- package/dist/Components/NavLauncher/spotlightParts.js +121 -0
- package/dist/Components/NavLauncher/useCopiedFlash.d.ts +6 -0
- package/dist/Components/NavLauncher/useCopiedFlash.js +21 -0
- package/dist/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +5 -3
- package/dist/Components/Notification/Notification.js +19 -21
- package/dist/Components/Notification/NotificationProps.d.ts +1 -1
- package/dist/Components/NotificationBell/notificationHelpers.d.ts +16 -1
- package/dist/Components/NotificationBell/notificationHelpers.js +13 -7
- package/dist/Components/OffersList/OffersList.js +4 -2
- package/dist/Components/OptionChip/OptionChip.js +3 -2
- package/dist/Components/OptionChip/optionInk.js +4 -2
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +13 -6
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +1 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -7
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +4 -2
- package/dist/Components/PdfViewer/PdfViewer.d.ts +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +1 -1
- package/dist/Components/PlanPill/PlanPill.js +4 -2
- package/dist/Components/PlanPill/PlanPillProps.d.ts +1 -1
- package/dist/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/Components/ProfileCard/ProfileCard.d.ts +1 -0
- package/dist/Components/ProfileCard/ProfileCard.js +12 -26
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/Components/QueryState/QueryStateBoundary.d.ts +1 -1
- package/dist/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/Components/QueryState/QueryStateProps.d.ts +6 -2
- package/dist/Components/RadioButton/RadioButton.js +2 -3
- package/dist/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts +1 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +4 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +10 -4
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +3 -3
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/Components/Select/Select.js +6 -0
- package/dist/Components/Select/SelectNative.d.ts +16 -0
- package/dist/Components/Select/SelectPopup.js +170 -63
- package/dist/Components/Select/SelectProps.d.ts +30 -2
- package/dist/Components/Select/groupedWindow.d.ts +21 -0
- package/dist/Components/Select/groupedWindow.js +50 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +48 -38
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +3 -3
- package/dist/Components/SelectV2/SelectV2.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2.js +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +3 -3
- package/dist/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/Components/SideBar/sidebarScale.d.ts +2 -2
- package/dist/Components/SideBar/sidebarScale.js +2 -2
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +7 -2
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +1 -1
- package/dist/Components/SignInActivityTable/scrollRegionRing.d.ts +10 -0
- package/dist/Components/SignInActivityTable/scrollRegionRing.js +14 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -1
- package/dist/Components/Slider/Slider.d.ts +2 -0
- package/dist/Components/Slider/Slider.js +5 -4
- package/dist/Components/StageProgress/StageItem.js +2 -1
- package/dist/Components/StageProgress/StageProgress.js +8 -2
- package/dist/Components/StageProgress/StageProgressProps.d.ts +2 -0
- package/dist/Components/StageProgress/StepperStage.js +2 -1
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/Components/Table/Table.js +5 -3
- package/dist/Components/Table/components/HeaderActions.js +5 -3
- package/dist/Components/Table/components/TableBody.js +13 -8
- package/dist/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/Components/Table/components/TableHeader.js +17 -21
- package/dist/Components/Table/components/TableLoading.js +8 -2
- package/dist/Components/Table/components/rowDetail.js +3 -2
- package/dist/Components/Table/filters/ActiveFilters.js +6 -3
- package/dist/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/Components/Table/filters/FilterDatePicker.d.ts +6 -0
- package/dist/Components/Table/filters/FilterDatePicker.js +61 -0
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +1 -0
- package/dist/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/Components/Table/hooks/useTable.js +11 -7
- package/dist/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/Components/Table/settings/TableSettings.js +4 -4
- package/dist/Components/Tabs/Tabs.d.ts +1 -0
- package/dist/Components/Tabs/Tabs.js +1 -0
- package/dist/Components/Tabs/components/CountBadge.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.js +1 -0
- package/dist/Components/Tabs/components/TabPanel.d.ts +1 -0
- package/dist/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/Components/Tabs/tabStyles.js +4 -2
- package/dist/Components/Tag/Tag.js +5 -4
- package/dist/Components/Tag/Tag.styles.js +5 -4
- package/dist/Components/Tag/TagProps.d.ts +4 -1
- package/dist/Components/Tag/tagDot.js +10 -3
- package/dist/Components/TagInput/TagInput.js +6 -5
- package/dist/Components/TagInput/TagInputProps.d.ts +15 -0
- package/dist/Components/TagInput/tagEntries.d.ts +7 -1
- package/dist/Components/TagInput/tagEntries.js +18 -5
- package/dist/Components/TimePicker/TimePicker.js +7 -3
- package/dist/Components/TimePicker/TimePickerProps.d.ts +2 -0
- package/dist/Components/Timeline/Timeline.js +13 -9
- package/dist/Components/Toaster/Toaster.js +2 -1
- package/dist/Components/Toggle/TableToggle.d.ts +1 -1
- package/dist/Components/Toggle/TableToggle.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +1 -1
- package/dist/Components/UserDetails/UserDetails.js +5 -7
- package/dist/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/Components/WizardDialog/WizardDialog.d.ts +1 -1
- package/dist/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +5 -3
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +11 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +6 -3
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +16 -15
- package/dist/Hooks/useOutsideMouseDown.d.ts +11 -0
- package/dist/Hooks/useOutsideMouseDown.js +30 -0
- package/dist/Hooks/usePreferences.js +30 -12
- package/dist/Hooks/useScrollableRegion.d.ts +17 -0
- package/dist/Hooks/useScrollableRegion.js +36 -0
- package/dist/Hooks/useSidebarPrefs.d.ts +1 -0
- package/dist/Theme/chakra/Menu.styles.d.ts +4 -0
- package/dist/Theme/chakra/Menu.styles.js +6 -0
- package/dist/Theme/chakra/componentStyles.d.ts +4 -0
- package/dist/Theme/chakra/componentStyles.js +1 -1
- package/dist/Theme/chakra/createBrandTheme.d.ts +1 -0
- package/dist/Theme/chakra/focusRing.styles.d.ts +1 -1
- package/dist/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/Theme/chakra/paletteFromTheme.d.ts +2 -1
- package/dist/Theme/chakra/paletteFromTheme.js +18 -4
- package/dist/Theme/chakra/ringShadow.d.ts +3 -0
- package/dist/Theme/chakra/ringShadow.js +7 -0
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/Theme/testing/testPalette.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/Theme/tokens/builders/paletteScale.d.ts +2 -0
- package/dist/Theme/tokens/builders/paletteScale.js +10 -0
- package/dist/Theme/tokens/types.d.ts +1 -0
- package/dist/Utils/accountHandoff.d.ts +3 -0
- package/dist/Utils/price.d.ts +1 -0
- package/dist/Utils/tabular.d.ts +30 -0
- package/dist/Utils/tabular.js +61 -0
- package/dist/esm/Components/Accordion/Accordion.js +11 -8
- package/dist/esm/Components/Accordion/accordionColors.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +2 -1
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/esm/Components/Apexcharts/ApexPieChart/pieImageTexture.js +10 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/esm/Components/AppSwitcher/pixelizeSuite.js +67 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/esm/Components/Avatar/avatarColorway.js +4 -4
- package/dist/esm/Components/Button/Button.styles.js +5 -2
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/esm/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/esm/Components/Card/Card.js +1 -0
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/esm/Components/CheckoutKit/selectable.js +10 -7
- package/dist/esm/Components/CheckoutKit/tonalHover.js +2 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/esm/Components/Common/FormLabel.js +4 -3
- package/dist/esm/Components/Common/HelperText.js +1 -2
- package/dist/esm/Components/Common/activationKey.js +7 -0
- package/dist/esm/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/esm/Components/Common/findSlot.js +17 -0
- package/dist/esm/Components/Common/surfaceFocusRing.js +3 -0
- package/dist/esm/Components/ConfirmDialog/ConfirmDialog.js +18 -6
- package/dist/esm/Components/CopyButton/CopyButton.js +5 -8
- package/dist/esm/Components/CouponField/CouponField.js +5 -2
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/esm/Components/DatePicker/DatePicker.js +25 -27
- package/dist/esm/Components/DatePicker/PickerPortal.js +2 -2
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/esm/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/esm/Components/DetailSections/DetailSections.js +2 -1
- package/dist/esm/Components/Divider/Divider.js +3 -3
- package/dist/esm/Components/Drawer/Drawer.js +24 -19
- package/dist/esm/Components/Dropdown/DropDown.js +7 -22
- package/dist/esm/Components/Editor/Editor.js +7 -3
- package/dist/esm/Components/Editor/editorLabels.js +1 -0
- package/dist/esm/Components/Editor/editorTokenStyles.js +7 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +8 -4
- package/dist/esm/Components/EmptyState/FilteredEmptyState.js +18 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +8 -4
- package/dist/esm/Components/FileUpload/FileUpload.js +8 -9
- package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +94 -237
- package/dist/esm/Components/FilterSidebar/OptionsSection.js +41 -0
- package/dist/esm/Components/FilterSidebar/RangeSection.js +78 -0
- package/dist/esm/Components/FilterSidebar/SectionHeader.js +23 -0
- package/dist/esm/Components/FilterSidebar/useStableCallback.js +8 -0
- package/dist/esm/Components/Form/FormWrapper.js +5 -3
- package/dist/esm/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/esm/Components/FormField/FormField.js +1 -1
- package/dist/esm/Components/Header/Header.js +1 -1
- package/dist/esm/Components/Header/HeaderActions.js +6 -4
- package/dist/esm/Components/Input/TextInput.js +2 -2
- package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/esm/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/MediaViewer/MediaViewer.js +5 -4
- package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/esm/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/esm/Components/MediaViewer/mediaItems.js +4 -0
- package/dist/esm/Components/Modal/Modal.js +2 -17
- package/dist/esm/Components/Modal/dialogNaming.js +18 -0
- package/dist/esm/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/esm/Components/NavLauncher/NavLauncher.js +291 -59
- package/dist/esm/Components/NavLauncher/ScopeBar.js +136 -0
- package/dist/esm/Components/NavLauncher/engine/distance.js +37 -0
- package/dist/esm/Components/NavLauncher/engine/engine.js +459 -0
- package/dist/esm/Components/NavLauncher/engine/fold.js +75 -0
- package/dist/esm/Components/NavLauncher/engine/index.js +14 -0
- package/dist/esm/Components/NavLauncher/launcherParts.js +46 -10
- package/dist/esm/Components/NavLauncher/match.js +25 -12
- package/dist/esm/Components/NavLauncher/searchLayout.js +101 -0
- package/dist/esm/Components/NavLauncher/spotlight.js +194 -0
- package/dist/esm/Components/NavLauncher/spotlightParts.js +108 -0
- package/dist/esm/Components/NavLauncher/useCopiedFlash.js +17 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/esm/Components/Notification/Notification.js +20 -22
- package/dist/esm/Components/NotificationBell/notificationHelpers.js +12 -6
- package/dist/esm/Components/OffersList/OffersList.js +4 -2
- package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
- package/dist/esm/Components/OptionChip/optionInk.js +4 -2
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -7
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -8
- package/dist/esm/Components/PlanPill/PlanPill.js +4 -2
- package/dist/esm/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/esm/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +6 -17
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/esm/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/esm/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +2 -3
- package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/esm/Components/Select/Select.js +6 -0
- package/dist/esm/Components/Select/SelectPopup.js +171 -64
- package/dist/esm/Components/Select/groupedWindow.js +44 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +49 -39
- package/dist/esm/Components/SelectV2/SelectV2.js +1 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/esm/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -2
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +8 -3
- package/dist/esm/Components/SignInActivityTable/scrollRegionRing.js +9 -0
- package/dist/esm/Components/Slider/Slider.js +6 -5
- package/dist/esm/Components/StageProgress/StageItem.js +2 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +8 -2
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/esm/Components/Table/Table.js +8 -6
- package/dist/esm/Components/Table/components/HeaderActions.js +7 -5
- package/dist/esm/Components/Table/components/TableBody.js +13 -8
- package/dist/esm/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/esm/Components/Table/components/TableHeader.js +19 -23
- package/dist/esm/Components/Table/components/TableLoading.js +6 -3
- package/dist/esm/Components/Table/components/rowDetail.js +3 -2
- package/dist/esm/Components/Table/filters/ActiveFilters.js +8 -5
- package/dist/esm/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/esm/Components/Table/filters/FilterDatePicker.js +20 -0
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/esm/Components/Table/hooks/useTable.js +11 -7
- package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/esm/Components/Table/settings/TableSettings.js +4 -4
- package/dist/esm/Components/Tabs/Tabs.js +1 -0
- package/dist/esm/Components/Tabs/components/TabList.js +1 -0
- package/dist/esm/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/esm/Components/Tabs/tabStyles.js +5 -3
- package/dist/esm/Components/Tag/Tag.js +5 -4
- package/dist/esm/Components/Tag/Tag.styles.js +5 -4
- package/dist/esm/Components/Tag/tagDot.js +10 -3
- package/dist/esm/Components/TagInput/TagInput.js +8 -7
- package/dist/esm/Components/TagInput/tagEntries.js +16 -4
- package/dist/esm/Components/TimePicker/TimePicker.js +7 -3
- package/dist/esm/Components/Timeline/Timeline.js +14 -10
- package/dist/esm/Components/Toaster/Toaster.js +2 -1
- package/dist/esm/Components/Toggle/TableToggle.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/esm/Components/UserDetails/UserDetails.js +5 -7
- package/dist/esm/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/esm/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +12 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +7 -4
- package/dist/esm/Hooks/useOutsideMouseDown.js +26 -0
- package/dist/esm/Hooks/usePreferences.js +30 -12
- package/dist/esm/Hooks/useScrollableRegion.js +33 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +6 -0
- package/dist/esm/Theme/chakra/componentStyles.js +1 -1
- package/dist/esm/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/esm/Theme/chakra/paletteFromTheme.js +16 -3
- package/dist/esm/Theme/chakra/ringShadow.js +3 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/esm/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/esm/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/esm/Theme/tokens/builders/paletteScale.js +6 -0
- package/dist/esm/Utils/tabular.js +56 -0
- package/dist/esm/index.js +18 -25
- package/dist/index.d.ts +59 -5
- package/dist/index.js +36 -29
- package/package.json +3 -1
- package/dist/Components/Buttons/Buttons.d.ts +0 -3
- package/dist/Components/Buttons/Buttons.js +0 -9
- package/dist/Components/Buttons/ButtonsProps.d.ts +0 -12
- package/dist/Components/Common/ErrorComponent.d.ts +0 -7
- package/dist/Components/Common/ErrorComponent.js +0 -16
- package/dist/Components/Common/FormattedDescription.d.ts +0 -7
- package/dist/Components/Common/FormattedDescription.js +0 -62
- package/dist/Components/Common/Label.d.ts +0 -9
- package/dist/Components/Common/Label.js +0 -12
- package/dist/Components/Input/Input/Input.d.ts +0 -4
- package/dist/Components/Input/Input/Input.js +0 -75
- package/dist/Components/Input/Input/InputProps.d.ts +0 -24
- package/dist/Components/Input/Input/InputProps.js +0 -2
- package/dist/Components/ProductCard/productCardFixtures.d.ts +0 -7
- package/dist/Components/ProductCard/productCardFixtures.js +0 -61
- package/dist/esm/Components/Buttons/Buttons.js +0 -4
- package/dist/esm/Components/Common/ErrorComponent.js +0 -14
- package/dist/esm/Components/Common/FormattedDescription.js +0 -60
- package/dist/esm/Components/Common/Label.js +0 -10
- package/dist/esm/Components/Input/Input/Input.js +0 -37
- package/dist/esm/Components/Input/Input/InputProps.js +0 -1
- package/dist/esm/Components/ProductCard/productCardFixtures.js +0 -58
- package/dist/esm/services/feedback.js +0 -15
- package/dist/services/feedback.d.ts +0 -12
- package/dist/services/feedback.js +0 -18
- /package/dist/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
- /package/dist/esm/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useRowHover = exports.stretchedLink = exports.useRowFocus = exports.titleInset = exports.activeRowSurface = exports.activeRowStyle = exports.ROW_CONTAINER = exports.WIDE_ROW = exports.isPlainClick = exports.useTouchDensity = exports.TouchDensity = exports.ITEM_SELECTOR = void 0;
|
|
6
|
+
exports.HighlightOptionsProvider = exports.useRowHover = exports.stretchedLink = exports.useRowFocus = exports.titleInset = exports.activeRowSurface = exports.activeRowStyle = exports.ROW_CONTAINER = exports.WIDE_ROW = exports.isPlainClick = exports.copyHint = exports.RulePlaneProvider = exports.useTouchDensity = exports.TouchDensity = exports.ITEM_SELECTOR = void 0;
|
|
7
|
+
exports.HintLabel = HintLabel;
|
|
7
8
|
exports.CountBadge = CountBadge;
|
|
8
9
|
exports.NewTag = NewTag;
|
|
9
10
|
exports.SectionHeader = SectionHeader;
|
|
@@ -21,10 +22,14 @@ const react_1 = require("@chakra-ui/react");
|
|
|
21
22
|
const lucide_react_1 = require("lucide-react");
|
|
22
23
|
const react_2 = require("react");
|
|
23
24
|
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
25
|
+
const motion_1 = require("../../Theme/chakra/motion");
|
|
26
|
+
const ringShadow_1 = require("../../Theme/chakra/ringShadow");
|
|
24
27
|
const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
|
|
25
28
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
29
|
+
const planeStep_1 = require("../../Theme/tokens/builders/planeStep");
|
|
30
|
+
const surfaceRaised_1 = require("../../Theme/tokens/builders/surfaceRaised");
|
|
26
31
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
27
|
-
const
|
|
32
|
+
const motion_2 = require("../../Theme/tokens/primitives/motion");
|
|
28
33
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
29
34
|
const OverflowToolTip_1 = __importDefault(require("../ToolTip/OverflowToolTip"));
|
|
30
35
|
const AppMark_1 = __importDefault(require("../AppSwitcher/AppMark"));
|
|
@@ -37,6 +42,35 @@ const TouchDensityContext = (0, react_2.createContext)(false);
|
|
|
37
42
|
exports.TouchDensity = TouchDensityContext.Provider;
|
|
38
43
|
const useTouchDensity = () => (0, react_2.useContext)(TouchDensityContext);
|
|
39
44
|
exports.useTouchDensity = useTouchDensity;
|
|
45
|
+
const RulePlaneContext = (0, react_2.createContext)("raised");
|
|
46
|
+
exports.RulePlaneProvider = RulePlaneContext.Provider;
|
|
47
|
+
const useSectionRule = () => {
|
|
48
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
49
|
+
const plane = (0, react_2.useContext)(RulePlaneContext);
|
|
50
|
+
return plane === "recess"
|
|
51
|
+
? (0, planeStep_1.ruleOn)(colors, colors.backgroundColor.subtle)
|
|
52
|
+
: (0, surfaceRaised_1.raisedRule)(colors);
|
|
53
|
+
};
|
|
54
|
+
const copyHint = (base, copied, isCopied) => ({
|
|
55
|
+
text: isCopied ? copied : base,
|
|
56
|
+
reserve: isCopied ? base : copied,
|
|
57
|
+
isAccent: isCopied,
|
|
58
|
+
});
|
|
59
|
+
exports.copyHint = copyHint;
|
|
60
|
+
function HintLabel({ text, reserve, isAccent = false, }) {
|
|
61
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "data-testid": "launcher-hint-label", "data-accent": isAccent || undefined, "data-reserve": reserve, display: "inline-flex", flexDirection: "column", color: isAccent ? colors.accentText : undefined, transition: (0, motion_2.transitionFor)(["color"]), sx: {
|
|
63
|
+
// NOTE: ::after reserves the widest label (one per line), so swapping text never shifts the row.
|
|
64
|
+
"&::after": {
|
|
65
|
+
content: "attr(data-reserve)",
|
|
66
|
+
whiteSpace: "pre",
|
|
67
|
+
height: "0px",
|
|
68
|
+
overflow: "hidden",
|
|
69
|
+
visibility: "hidden",
|
|
70
|
+
},
|
|
71
|
+
...(0, motion_1.reducedMotionSx)(),
|
|
72
|
+
}, children: text }));
|
|
73
|
+
}
|
|
40
74
|
const isPlainClick = (event) => event.button === 0 &&
|
|
41
75
|
!event.metaKey &&
|
|
42
76
|
!event.ctrlKey &&
|
|
@@ -62,7 +96,7 @@ const activeRowSurface = (colors) => {
|
|
|
62
96
|
const { edge, fill } = (0, exports.activeRowStyle)(colors);
|
|
63
97
|
return {
|
|
64
98
|
backgroundColor: fill,
|
|
65
|
-
boxShadow:
|
|
99
|
+
boxShadow: (0, ringShadow_1.insetRingShadow)(edge),
|
|
66
100
|
outline: "2px solid transparent",
|
|
67
101
|
outlineOffset: "-2px",
|
|
68
102
|
};
|
|
@@ -128,17 +162,21 @@ function NewTag({ label }) {
|
|
|
128
162
|
}
|
|
129
163
|
function SectionHeader({ label, meta, isDecorative = false, isRail = false, hasCount = true, }) {
|
|
130
164
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
131
|
-
|
|
165
|
+
const rule = useSectionRule();
|
|
166
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "baseline", gap: "6px", px: isRail ? "4px" : "8px", pb: "5px", mb: hasCount ? 0 : "2px", borderBottomWidth: "1px", borderColor: rule, "aria-hidden": isDecorative || undefined, children: [(0, jsx_runtime_1.jsx)(react_1.Heading, { as: isDecorative ? "div" : "h2", m: 0, fontSize: "xs-plus", fontWeight: 600, letterSpacing: "-0.003em", color: colors.text[900], children: label }), meta ? ((0, jsx_runtime_1.jsx)(react_1.Text, { as: "span", fontSize: "xs-minus", color: colors.textMuted, sx: { fontVariantNumeric: "tabular-nums" }, children: meta })) : null] }));
|
|
132
167
|
}
|
|
133
168
|
function RowIcon({ icon: Icon, size, stroke = 1.75, mt }) {
|
|
134
169
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
135
170
|
if (!Icon)
|
|
136
171
|
return null;
|
|
137
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", color: colors.textMuted, display: "inline-flex", flexShrink: 0, mt: mt, transition: (0,
|
|
172
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", color: colors.textMuted, display: "inline-flex", flexShrink: 0, mt: mt, transition: (0, motion_2.transitionFor)(["color"]), _groupHover: { color: colors.accentText }, _groupFocusWithin: { color: colors.accentText }, sx: { "[data-reveal=true] &": { color: colors.accentText } }, children: (0, jsx_runtime_1.jsx)(Icon, { size: size, strokeWidth: stroke, "aria-hidden": true }) }));
|
|
138
173
|
}
|
|
174
|
+
const HighlightOptionsContext = (0, react_2.createContext)(undefined);
|
|
175
|
+
exports.HighlightOptionsProvider = HighlightOptionsContext.Provider;
|
|
139
176
|
function Highlight({ text, query }) {
|
|
140
177
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
141
|
-
|
|
178
|
+
const options = (0, react_2.useContext)(HighlightOptionsContext);
|
|
179
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, match_1.highlightSegments)(text, query, options).map((segment, i) => segment.isMatch ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "mark", bg: "transparent", color: "inherit", fontWeight: 650, textDecoration: "underline", textDecorationColor: colors.primary.opacity[48], textDecorationThickness: "1.5px", textUnderlineOffset: "2px", children: segment.text }, i)) : ((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: segment.text }, i))) }));
|
|
142
180
|
}
|
|
143
181
|
function RowActions({ children }) {
|
|
144
182
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -148,14 +186,14 @@ function RowActions({ children }) {
|
|
|
148
186
|
[NARROW_ROW]: {
|
|
149
187
|
[revealed]: {
|
|
150
188
|
backgroundColor: (0, exports.activeRowStyle)(colors).fill,
|
|
151
|
-
borderRadius: "
|
|
189
|
+
borderRadius: "md",
|
|
152
190
|
},
|
|
153
191
|
},
|
|
154
192
|
}, position: "absolute", top: isTouch ? "12px" : "7px", right: "4px", h: "19px", align: "center", gap: "2px", zIndex: 1, children: children }));
|
|
155
193
|
}
|
|
156
194
|
function RowTip({ text }) {
|
|
157
195
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
158
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { role: "tooltip", position: "absolute", right: "20px", top: "-26px", zIndex: 2, px: "8px", py: "3px", borderRadius: "
|
|
196
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { role: "tooltip", position: "absolute", right: "20px", top: "-26px", zIndex: 2, px: "8px", py: "3px", borderRadius: "md", fontSize: "xs-minus", fontWeight: 600, whiteSpace: "nowrap", bg: colors.text[900], color: colors.surfaceRaised, visibility: "hidden", pointerEvents: "none", _groupHover: { visibility: "visible" }, children: text }));
|
|
159
197
|
}
|
|
160
198
|
function ModuleRow({ module, keyScreens, isPinned, onTogglePin, pinId, labels, link, }) {
|
|
161
199
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -165,7 +203,7 @@ function ModuleRow({ module, keyScreens, isPinned, onTogglePin, pinId, labels, l
|
|
|
165
203
|
const isTouch = (0, exports.useTouchDensity)();
|
|
166
204
|
const base = typeof module.badge === "number" || module.badge ? 24 : 0;
|
|
167
205
|
const open = base + (onTogglePin ? 46 : 24);
|
|
168
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "flex-start", gap: "10px", minH: isTouch ? "44px" : "34px", pl: "8px", pr: "4px", pt: isTouch ? "12px" : "7px", pb: isTouch ? "8px" : "5px", borderRadius: "
|
|
206
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "flex-start", gap: "10px", minH: isTouch ? "44px" : "34px", pl: "8px", pr: "4px", pt: isTouch ? "12px" : "7px", pb: isTouch ? "8px" : "5px", borderRadius: "lg", transition: (0, motion_2.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, sx: { ...focus.sx, ...exports.ROW_CONTAINER }, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: module.icon, size: 16, mt: "2px" }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "6px", h: "19px", minW: 0, sx: (0, exports.titleInset)(base, open), children: [(0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: module.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: module.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": onTogglePin ? pinId : undefined, onClick: link.onPlainClick, minW: 0, fontSize: "13.5px", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("lg"), children: module.label }) }), module.isNew ? (0, jsx_runtime_1.jsx)(NewTag, { label: labels.newBadge }) : null] }), keyScreens.length ? ((0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: keyScreens.map((screen) => screen.label).join(" · "), placement: "bottom-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { role: "group", "aria-label": `${module.label} ${labels.screens}`, position: "relative", zIndex: 1, w: "fit-content", maxW: "100%", fontSize: "xs-minus", lineHeight: "15px", color: colors.textMuted, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: keyScreens.map((screen, i) => ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [i > 0 ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": true, mx: "5px", opacity: 0.7, children: "\u00B7" })) : null, (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, onClick: link.onPlainClick, color: "inherit", borderRadius: "sm", position: "relative", zIndex: 1, _hover: {
|
|
169
207
|
textDecoration: "underline",
|
|
170
208
|
textUnderlineOffset: "2px",
|
|
171
209
|
}, sx: ring, children: screen.label })] }, screen.id))) }) })) : null] }), (0, jsx_runtime_1.jsxs)(RowActions, { children: [(0, jsx_runtime_1.jsx)(CountBadge, { value: module.badge }), onTogglePin ? ((0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: isPinned, label: isPinned ? labels.unpin(module.label) : labels.pin(module.label), title: "", onToggle: onTogglePin })) : null, (0, jsx_runtime_1.jsx)(NewTabLink_1.default, { href: module.href, label: labels.openInNewTab(module.label), tip: labels.newTabTip, linkAs: link.linkAs })] }), onTogglePin ? ((0, jsx_runtime_1.jsx)(RowTip, { text: isPinned ? labels.unpinTip : labels.pinTip })) : null] }));
|
|
@@ -176,11 +214,11 @@ function RailRow({ screen, module, link, isStrong = false, trailing, pinId, }) {
|
|
|
176
214
|
const hover = (0, exports.useRowHover)();
|
|
177
215
|
const focus = (0, exports.useRowFocus)();
|
|
178
216
|
const isTouch = (0, exports.useTouchDensity)();
|
|
179
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, position: "relative", align: "center", gap: "10px", h: isTouch ? "44px" : "32px", pl: "8px", pr: "4px", borderRadius: "
|
|
217
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, position: "relative", align: "center", gap: "10px", h: isTouch ? "44px" : "32px", pl: "8px", pr: "4px", borderRadius: "lg", transition: (0, motion_2.transitionFor)(["background-color"]), _hover: hover._hover, _focusWithin: hover._focusWithin, sx: focus.sx, children: [(0, jsx_runtime_1.jsx)(RowIcon, { icon: (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon, size: 15 }), (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: screen.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": pinId, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "xs-plus", fontWeight: isStrong ? 500 : 400, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("lg"), children: screen.label }) }), (0, jsx_runtime_1.jsx)(react_1.Flex, { position: "relative", zIndex: 1, align: "center", gap: "2px", children: trailing })] }));
|
|
180
218
|
}
|
|
181
219
|
function PinTextButton({ label, text, onToggle }) {
|
|
182
220
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
183
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { as: "button", type: "button", "aria-label": label, flexShrink: 0, h: "22px", px: "7px", display: "inline-flex", alignItems: "center", gap: "4px", borderRadius: "
|
|
221
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { as: "button", type: "button", "aria-label": label, flexShrink: 0, h: "22px", px: "7px", display: "inline-flex", alignItems: "center", gap: "4px", borderRadius: "md", borderWidth: "1px", borderColor: (0, surfaceRaised_1.raisedRule)(colors), bg: colors.surfaceRaised, color: colors.text[700], fontSize: "xs-minus", fontWeight: 600, cursor: "pointer", opacity: 0, transition: (0, motion_2.transitionFor)(["opacity", "background-color"]), sx: { ...(0, revealStyles_1.revealStyles)(colors), "@media (hover: none)": { opacity: 1 } }, onClick: (event) => {
|
|
184
222
|
event.preventDefault();
|
|
185
223
|
event.stopPropagation();
|
|
186
224
|
onToggle();
|
|
@@ -192,7 +230,7 @@ function PinnedTile({ screen, module, link, labels, onTogglePin, }) {
|
|
|
192
230
|
const Icon = (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon;
|
|
193
231
|
const focus = (0, exports.useRowFocus)(true);
|
|
194
232
|
const isTouch = (0, exports.useTouchDensity)();
|
|
195
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "center", gap: "8px", h: isTouch ? "44px" : "36px", pl: "9px", pr: "4px", borderRadius: "9px", borderWidth: "1px", borderColor: colors
|
|
233
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "data-group": true, "data-nav-cell": true, position: "relative", align: "center", gap: "8px", h: isTouch ? "44px" : "36px", pl: "9px", pr: "4px", borderRadius: "9px", borderWidth: "1px", borderColor: (0, surfaceRaised_1.raisedRule)(colors), bg: colors.surfaceRaised, transition: (0, motion_2.transitionFor)(["border-color", "background-color"]), _hover: { borderColor: colors.gray[300] }, sx: focus.sx, children: [Icon ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", display: "inline-flex", flexShrink: 0, color: colors.accentText, children: (0, jsx_runtime_1.jsx)(Icon, { size: 15, strokeWidth: 1.8, "aria-hidden": true }) })) : null, (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: screen.label, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: screen.href, "data-launcher-item": true, ...focus.primary, "data-pin-id": onTogglePin ? screen.id : undefined, onClick: link.onPlainClick, flex: 1, minW: 0, fontSize: "xs-plus", fontWeight: 500, color: colors.text[900], noOfLines: 1, borderRadius: "sm", sx: (0, exports.stretchedLink)("9px"), children: screen.label }) }), (0, jsx_runtime_1.jsx)(CountBadge, { value: screen.badge, size: "tile" }), onTogglePin ? ((0, jsx_runtime_1.jsx)(react_1.Box, { position: "relative", zIndex: 1, flexShrink: 0, w: "0", overflow: "hidden", transition: (0, motion_2.transitionFor)(["width"]), _groupHover: { w: "22px" }, _groupFocusWithin: { w: "22px" }, children: (0, jsx_runtime_1.jsx)(PinToggle_1.default, { isPinned: true, size: 12, label: labels.unpin(screen.label), title: labels.unpinTip, onToggle: onTogglePin }) })) : null] }));
|
|
196
234
|
}
|
|
197
235
|
function AppsSection({ apps, hues, currentAppId, heading, hideHeading = false, onSelect, }) {
|
|
198
236
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -212,7 +250,7 @@ function AppsSection({ apps, hues, currentAppId, heading, hideHeading = false, o
|
|
|
212
250
|
}
|
|
213
251
|
: {}), "aria-current": isCurrent ? "true" : undefined, title: app.locked
|
|
214
252
|
? ((_a = app.lockedReason) !== null && _a !== void 0 ? _a : `${app.name} is not available on your plan`)
|
|
215
|
-
: undefined, "data-app-locked": app.locked ? "true" : undefined, "aria-disabled": app.locked ? "true" : undefined, align: "center", gap: 3, minH: "44px", px: 2, py: 1, borderRadius: "
|
|
253
|
+
: undefined, "data-app-locked": app.locked ? "true" : undefined, "aria-disabled": app.locked ? "true" : undefined, align: "center", gap: 3, minH: "44px", px: 2, py: 1, borderRadius: "lg", textDecoration: "none", cursor: interactive ? "pointer" : "default", bg: isCurrent ? rows.selected : "transparent", transition: (0, motion_2.transitionFor)(["background-color"]), _hover: interactive ? { bg: rows.active } : undefined, sx: {
|
|
216
254
|
_focusVisible: rowRing,
|
|
217
255
|
[focusRing_styles_1.FOCUS_VISIBLE_OVER_STATE]: rowRing,
|
|
218
256
|
}, children: [(0, jsx_runtime_1.jsx)(AppMark_1.default, { app: app, hue: hues[index], boxSize: "28px", iconSize: 15, muted: app.locked }), (0, jsx_runtime_1.jsx)(OverflowToolTip_1.default, { label: app.name, placement: "top-start", children: (0, jsx_runtime_1.jsx)(react_1.Text, { flex: 1, minW: 0, fontSize: "sm", fontWeight: "medium", noOfLines: 1, color: app.locked ? colors.textMuted : colors.text[900], children: app.name }) }), app.locked ? ((0, jsx_runtime_1.jsx)(react_1.Box, { as: lucide_react_1.Lock, size: 14, color: colors.textMuted, flexShrink: 0, "aria-hidden": true })) : null] }) }, app.id || app.name));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type LauncherSynonyms } from "./engine/engine";
|
|
2
|
+
import type { LauncherAnswer, LauncherFact, LauncherIcon, LauncherResultGroup, LauncherSearchItem, LauncherSection } from "./NavLauncherProps";
|
|
2
3
|
export type LauncherResult = {
|
|
3
4
|
id: string;
|
|
4
5
|
label: string;
|
|
@@ -14,13 +15,18 @@ export type LauncherResult = {
|
|
|
14
15
|
/** Keyword that matched a module or screen whose own name did not. */
|
|
15
16
|
keywordHint?: string;
|
|
16
17
|
isNew?: boolean;
|
|
18
|
+
facts?: readonly LauncherFact[];
|
|
19
|
+
answer?: LauncherAnswer;
|
|
20
|
+
score?: number;
|
|
17
21
|
};
|
|
18
22
|
export type LauncherResultView = {
|
|
19
23
|
id: string;
|
|
20
24
|
label: string;
|
|
21
25
|
items: LauncherResult[];
|
|
22
26
|
};
|
|
27
|
+
export declare function filterItems(items: readonly LauncherSearchItem[], query: string): LauncherSearchItem[];
|
|
23
28
|
export declare function flattenScreens(sections: readonly LauncherSection[]): LauncherResult[];
|
|
29
|
+
/** @deprecated Legacy flat search; NavLauncher uses searchLauncherSections (classic) or the spotlight engine. */
|
|
24
30
|
export declare function searchLauncher(input: {
|
|
25
31
|
query: string;
|
|
26
32
|
sections: readonly LauncherSection[];
|
|
@@ -49,5 +55,10 @@ export type HighlightSegment = {
|
|
|
49
55
|
text: string;
|
|
50
56
|
isMatch: boolean;
|
|
51
57
|
};
|
|
58
|
+
/** Highlight options; `fuzzy` also marks prefix, typo, initial and accent-folded matches. */
|
|
59
|
+
export type HighlightOptions = {
|
|
60
|
+
fuzzy?: boolean;
|
|
61
|
+
synonyms?: LauncherSynonyms;
|
|
62
|
+
};
|
|
52
63
|
/** Splits `text` so every case-insensitive occurrence of a query token is its own matched segment. */
|
|
53
|
-
export declare function highlightSegments(text: string, query: string): HighlightSegment[];
|
|
64
|
+
export declare function highlightSegments(text: string, query: string, options?: HighlightOptions): HighlightSegment[];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterItems = filterItems;
|
|
3
4
|
exports.flattenScreens = flattenScreens;
|
|
4
5
|
exports.searchLauncher = searchLauncher;
|
|
5
6
|
exports.searchLauncherSections = searchLauncherSections;
|
|
6
7
|
exports.highlightSegments = highlightSegments;
|
|
8
|
+
const engine_1 = require("./engine/engine");
|
|
7
9
|
const normalize = (text) => text.toLocaleLowerCase().normalize("NFKD");
|
|
8
10
|
function score(label, haystack, tokens) {
|
|
9
11
|
if (!tokens.every((t) => haystack.includes(t)))
|
|
@@ -29,6 +31,12 @@ function rank(rows, text, tokens) {
|
|
|
29
31
|
.sort((a, b) => a.s - b.s || a.index - b.index)
|
|
30
32
|
.map((r) => r.row);
|
|
31
33
|
}
|
|
34
|
+
function filterItems(items, query) {
|
|
35
|
+
const tokens = normalize(query).split(/\s+/).filter(Boolean);
|
|
36
|
+
if (tokens.length === 0)
|
|
37
|
+
return [];
|
|
38
|
+
return rank([...items], (a) => { var _a, _b; return `${a.label} ${(_a = a.context) !== null && _a !== void 0 ? _a : ""} ${(_b = a.keywords) !== null && _b !== void 0 ? _b : ""}`; }, tokens);
|
|
39
|
+
}
|
|
32
40
|
function flattenScreens(sections) {
|
|
33
41
|
var _a, _b, _c;
|
|
34
42
|
const seen = new Set();
|
|
@@ -54,6 +62,7 @@ function flattenScreens(sections) {
|
|
|
54
62
|
}
|
|
55
63
|
return out;
|
|
56
64
|
}
|
|
65
|
+
/** @deprecated Legacy flat search; NavLauncher uses searchLauncherSections (classic) or the spotlight engine. */
|
|
57
66
|
function searchLauncher(input) {
|
|
58
67
|
var _a, _b;
|
|
59
68
|
const tokens = normalize(input.query).split(/\s+/).filter(Boolean);
|
|
@@ -143,8 +152,23 @@ function searchLauncherSections(input) {
|
|
|
143
152
|
].filter((g) => g.items.length > 0);
|
|
144
153
|
return { sections, groups };
|
|
145
154
|
}
|
|
155
|
+
const toSegments = (text, ranges) => {
|
|
156
|
+
const out = [];
|
|
157
|
+
let cursor = 0;
|
|
158
|
+
for (const [start, end] of ranges) {
|
|
159
|
+
if (start > cursor)
|
|
160
|
+
out.push({ text: text.slice(cursor, start), isMatch: false });
|
|
161
|
+
out.push({ text: text.slice(start, end), isMatch: true });
|
|
162
|
+
cursor = end;
|
|
163
|
+
}
|
|
164
|
+
if (cursor < text.length)
|
|
165
|
+
out.push({ text: text.slice(cursor), isMatch: false });
|
|
166
|
+
return out.length ? out : [{ text, isMatch: false }];
|
|
167
|
+
};
|
|
146
168
|
/** Splits `text` so every case-insensitive occurrence of a query token is its own matched segment. */
|
|
147
|
-
function highlightSegments(text, query) {
|
|
169
|
+
function highlightSegments(text, query, options) {
|
|
170
|
+
if (options === null || options === void 0 ? void 0 : options.fuzzy)
|
|
171
|
+
return toSegments(text, (0, engine_1.highlightRanges)(text, query, { synonyms: options.synonyms }));
|
|
148
172
|
const lower = text.toLocaleLowerCase();
|
|
149
173
|
const tokens = query.toLocaleLowerCase().split(/\s+/).filter(Boolean);
|
|
150
174
|
if (tokens.length === 0 || lower.length !== text.length)
|
|
@@ -164,15 +188,5 @@ function highlightSegments(text, query) {
|
|
|
164
188
|
else
|
|
165
189
|
merged.push([...range]);
|
|
166
190
|
}
|
|
167
|
-
|
|
168
|
-
let cursor = 0;
|
|
169
|
-
for (const [start, end] of merged) {
|
|
170
|
-
if (start > cursor)
|
|
171
|
-
out.push({ text: text.slice(cursor, start), isMatch: false });
|
|
172
|
-
out.push({ text: text.slice(start, end), isMatch: true });
|
|
173
|
-
cursor = end;
|
|
174
|
-
}
|
|
175
|
-
if (cursor < text.length)
|
|
176
|
-
out.push({ text: text.slice(cursor), isMatch: false });
|
|
177
|
-
return out.length ? out : [{ text, isMatch: false }];
|
|
191
|
+
return toSegments(text, merged);
|
|
178
192
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { LauncherResult } from "./match";
|
|
2
|
+
import type { LauncherResultGroup, LauncherSearchItem } from "./NavLauncherProps";
|
|
3
|
+
import { type SearchGroup } from "./spotlight";
|
|
4
|
+
export type SearchEntry = {
|
|
5
|
+
type: "answer" | "top";
|
|
6
|
+
item: LauncherResult;
|
|
7
|
+
} | {
|
|
8
|
+
type: "row";
|
|
9
|
+
item: LauncherResult;
|
|
10
|
+
groupId: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "more";
|
|
13
|
+
groupId: string;
|
|
14
|
+
count: number;
|
|
15
|
+
};
|
|
16
|
+
export type SearchBlock = {
|
|
17
|
+
type: "answers";
|
|
18
|
+
start: number;
|
|
19
|
+
items: LauncherResult[];
|
|
20
|
+
} | {
|
|
21
|
+
type: "top";
|
|
22
|
+
start: number;
|
|
23
|
+
item: LauncherResult;
|
|
24
|
+
} | {
|
|
25
|
+
type: "group";
|
|
26
|
+
group: SearchGroup;
|
|
27
|
+
start: number;
|
|
28
|
+
visible: LauncherResult[];
|
|
29
|
+
more?: {
|
|
30
|
+
index: number;
|
|
31
|
+
count: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type SearchLayout = {
|
|
35
|
+
blocks: SearchBlock[];
|
|
36
|
+
entries: SearchEntry[];
|
|
37
|
+
sizes: number[];
|
|
38
|
+
total: number;
|
|
39
|
+
};
|
|
40
|
+
export declare const copiesOnEnter: (entry?: SearchEntry) => boolean;
|
|
41
|
+
export declare const inScope: (groups: SearchGroup[], scope: string) => SearchGroup[];
|
|
42
|
+
/** A scope's items as passed, unranked, for browsing before typing. */
|
|
43
|
+
export declare const scopeGroups: (input: {
|
|
44
|
+
scope: string;
|
|
45
|
+
actions?: readonly LauncherSearchItem[];
|
|
46
|
+
extraResults?: readonly LauncherResultGroup[];
|
|
47
|
+
actionsLabel: string;
|
|
48
|
+
}) => SearchGroup[];
|
|
49
|
+
export declare const countByScope: (groups: SearchGroup[], answers: number) => Map<string, number>;
|
|
50
|
+
export declare const takeTopHit: (groups: SearchGroup[]) => {
|
|
51
|
+
topHit?: LauncherResult;
|
|
52
|
+
groups: SearchGroup[];
|
|
53
|
+
};
|
|
54
|
+
/** Flat option order for keyboard and ARIA plus per-row group sizes for `moveResult`. */
|
|
55
|
+
export declare const layoutSearch: (input: {
|
|
56
|
+
answers: LauncherResult[];
|
|
57
|
+
topHit?: LauncherResult;
|
|
58
|
+
groups: SearchGroup[];
|
|
59
|
+
limit?: number;
|
|
60
|
+
expanded: ReadonlySet<string>;
|
|
61
|
+
}) => SearchLayout;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.layoutSearch = exports.takeTopHit = exports.countByScope = exports.scopeGroups = exports.inScope = exports.copiesOnEnter = void 0;
|
|
4
|
+
const spotlight_1 = require("./spotlight");
|
|
5
|
+
const copiesOnEnter = (entry) => (entry === null || entry === void 0 ? void 0 : entry.type) === "answer" && !entry.item.run && !entry.item.href;
|
|
6
|
+
exports.copiesOnEnter = copiesOnEnter;
|
|
7
|
+
const inScope = (groups, scope) => scope === spotlight_1.SCOPE_ALL ? groups : groups.filter((g) => g.scope === scope);
|
|
8
|
+
exports.inScope = inScope;
|
|
9
|
+
/** A scope's items as passed, unranked, for browsing before typing. */
|
|
10
|
+
const scopeGroups = (input) => {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const groups = [];
|
|
13
|
+
if (input.scope === spotlight_1.SCOPE_ACTIONS && ((_a = input.actions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
14
|
+
groups.push({
|
|
15
|
+
id: spotlight_1.SCOPE_ACTIONS,
|
|
16
|
+
label: input.actionsLabel,
|
|
17
|
+
scope: spotlight_1.SCOPE_ACTIONS,
|
|
18
|
+
isSection: false,
|
|
19
|
+
items: input.actions.map((action) => ({ ...action, id: `action:${action.id}` })),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
for (const group of (_b = input.extraResults) !== null && _b !== void 0 ? _b : []) {
|
|
23
|
+
const scope = (_c = group.scope) !== null && _c !== void 0 ? _c : group.id;
|
|
24
|
+
if (scope !== input.scope || group.items.length === 0)
|
|
25
|
+
continue;
|
|
26
|
+
groups.push({
|
|
27
|
+
id: group.id,
|
|
28
|
+
label: group.label,
|
|
29
|
+
scope,
|
|
30
|
+
isSection: false,
|
|
31
|
+
items: group.items.map((item) => ({ ...item, id: `${group.id}:${item.id}` })),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return groups;
|
|
35
|
+
};
|
|
36
|
+
exports.scopeGroups = scopeGroups;
|
|
37
|
+
const countByScope = (groups, answers) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const counts = new Map();
|
|
40
|
+
let all = answers;
|
|
41
|
+
for (const group of groups) {
|
|
42
|
+
counts.set(group.scope, ((_a = counts.get(group.scope)) !== null && _a !== void 0 ? _a : 0) + group.items.length);
|
|
43
|
+
all += group.items.length;
|
|
44
|
+
}
|
|
45
|
+
counts.set(spotlight_1.SCOPE_ALL, all);
|
|
46
|
+
return counts;
|
|
47
|
+
};
|
|
48
|
+
exports.countByScope = countByScope;
|
|
49
|
+
const takeTopHit = (groups) => {
|
|
50
|
+
let at = -1;
|
|
51
|
+
let index = -1;
|
|
52
|
+
let bestScore = 0;
|
|
53
|
+
for (let g = 0; g < groups.length; g += 1) {
|
|
54
|
+
groups[g].items.forEach((item, i) => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if (((_a = item.score) !== null && _a !== void 0 ? _a : 0) <= bestScore)
|
|
57
|
+
return;
|
|
58
|
+
bestScore = (_b = item.score) !== null && _b !== void 0 ? _b : 0;
|
|
59
|
+
at = g;
|
|
60
|
+
index = i;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (at < 0)
|
|
64
|
+
return { groups };
|
|
65
|
+
return {
|
|
66
|
+
topHit: groups[at].items[index],
|
|
67
|
+
groups: groups
|
|
68
|
+
.map((group, g) => (g === at ? { ...group, items: group.items.filter((_, i) => i !== index) } : group))
|
|
69
|
+
.filter((group) => group.items.length > 0),
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
exports.takeTopHit = takeTopHit;
|
|
73
|
+
/** Flat option order for keyboard and ARIA plus per-row group sizes for `moveResult`. */
|
|
74
|
+
const layoutSearch = (input) => {
|
|
75
|
+
const blocks = [];
|
|
76
|
+
const entries = [];
|
|
77
|
+
const sizes = [];
|
|
78
|
+
if (input.answers.length) {
|
|
79
|
+
blocks.push({ type: "answers", start: 0, items: input.answers });
|
|
80
|
+
for (const item of input.answers) {
|
|
81
|
+
entries.push({ type: "answer", item });
|
|
82
|
+
sizes.push(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (input.topHit) {
|
|
86
|
+
blocks.push({ type: "top", start: entries.length, item: input.topHit });
|
|
87
|
+
entries.push({ type: "top", item: input.topHit });
|
|
88
|
+
sizes.push(1);
|
|
89
|
+
}
|
|
90
|
+
let total = entries.length;
|
|
91
|
+
for (const group of input.groups) {
|
|
92
|
+
const cap = input.limit !== undefined && !input.expanded.has(group.id) ? Math.max(1, input.limit) : Infinity;
|
|
93
|
+
const visible = group.items.slice(0, cap);
|
|
94
|
+
const hidden = group.items.length - visible.length;
|
|
95
|
+
const start = entries.length;
|
|
96
|
+
for (const item of visible)
|
|
97
|
+
entries.push({ type: "row", item, groupId: group.id });
|
|
98
|
+
sizes.push(visible.length);
|
|
99
|
+
total += group.items.length;
|
|
100
|
+
let more;
|
|
101
|
+
if (hidden > 0) {
|
|
102
|
+
more = { index: entries.length, count: hidden };
|
|
103
|
+
entries.push({ type: "more", groupId: group.id, count: hidden });
|
|
104
|
+
sizes.push(1);
|
|
105
|
+
}
|
|
106
|
+
blocks.push({ type: "group", group, start, visible, more });
|
|
107
|
+
}
|
|
108
|
+
return { blocks, entries, sizes, total };
|
|
109
|
+
};
|
|
110
|
+
exports.layoutSearch = layoutSearch;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type LauncherSearchField, type LauncherSearchIndex, type LauncherSynonyms } from "./engine/engine";
|
|
2
|
+
import type { LauncherResult } from "./match";
|
|
3
|
+
import type { LauncherResultGroup, LauncherSearchItem, LauncherSection } from "./NavLauncherProps";
|
|
4
|
+
export declare const SCOPE_ALL = "all";
|
|
5
|
+
export declare const SCOPE_SCREENS = "screens";
|
|
6
|
+
export declare const SCOPE_ACTIONS = "actions";
|
|
7
|
+
export type SearchGroup = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
scope: string;
|
|
11
|
+
isSection: boolean;
|
|
12
|
+
items: LauncherResult[];
|
|
13
|
+
};
|
|
14
|
+
type Entry = {
|
|
15
|
+
groupId: string;
|
|
16
|
+
usageId?: string;
|
|
17
|
+
result: LauncherResult;
|
|
18
|
+
};
|
|
19
|
+
export type SpotlightIndex = {
|
|
20
|
+
index: LauncherSearchIndex;
|
|
21
|
+
entries: Entry[];
|
|
22
|
+
groups: Array<Omit<SearchGroup, "items">>;
|
|
23
|
+
};
|
|
24
|
+
export declare const itemFields: (item: LauncherSearchItem) => LauncherSearchField[];
|
|
25
|
+
export declare function createSpotlightIndex(sections: readonly LauncherSection[], actions: readonly LauncherSearchItem[] | undefined, actionsLabel: string): SpotlightIndex;
|
|
26
|
+
export declare function spotlightBoosts(spot: SpotlightIndex, usage: {
|
|
27
|
+
pinnedIds?: readonly string[];
|
|
28
|
+
frequentIds?: readonly string[];
|
|
29
|
+
recentIds?: readonly string[];
|
|
30
|
+
}): Record<string, number>;
|
|
31
|
+
/** Ranked groups; local rows under 25% of the best score are dropped. */
|
|
32
|
+
export declare function searchSpotlight(spot: SpotlightIndex, input: {
|
|
33
|
+
query: string;
|
|
34
|
+
extraResults?: readonly LauncherResultGroup[];
|
|
35
|
+
synonyms?: LauncherSynonyms;
|
|
36
|
+
boosts?: Readonly<Record<string, number>>;
|
|
37
|
+
}): SearchGroup[];
|
|
38
|
+
export declare function matchAnswers(answers: readonly LauncherSearchItem[] | undefined, query: string, synonyms?: LauncherSynonyms): LauncherResult[];
|
|
39
|
+
export {};
|