pixelize-design-library 2.4.2-beta.65 → 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 +437 -13
- package/COMPONENT-GOTCHAS.md +150 -91
- package/DESIGN-GUIDE.md +47 -7
- 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 +1 -0
- package/dist/Components/CopyButton/CopyButton.js +3 -6
- 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 +2 -0
- package/dist/Components/Drawer/Drawer.js +23 -25
- 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/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/warnDroppedSlotChildren.d.ts +1 -1
- package/dist/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/Components/NavLauncher/LauncherTabs.js +2 -1
- package/dist/Components/NavLauncher/NavLauncher.js +44 -22
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +6 -4
- package/dist/Components/NavLauncher/ScopeBar.js +4 -2
- package/dist/Components/NavLauncher/engine/engine.js +2 -1
- package/dist/Components/NavLauncher/engine/fold.js +2 -1
- package/dist/Components/NavLauncher/launcherParts.d.ts +12 -0
- package/dist/Components/NavLauncher/launcherParts.js +45 -11
- package/dist/Components/NavLauncher/searchLayout.d.ts +1 -0
- package/dist/Components/NavLauncher/searchLayout.js +3 -1
- package/dist/Components/NavLauncher/spotlightParts.d.ts +6 -2
- package/dist/Components/NavLauncher/spotlightParts.js +22 -9
- 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 +14 -20
- 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/WorkspaceWindow/WorkspaceTrayPreview.js +11 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +3 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +14 -7
- 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/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 +1 -0
- 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 +3 -6
- 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 +19 -18
- 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/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/warnDroppedSlotChildren.js +7 -3
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +2 -1
- package/dist/esm/Components/NavLauncher/NavLauncher.js +47 -25
- package/dist/esm/Components/NavLauncher/ScopeBar.js +4 -2
- package/dist/esm/Components/NavLauncher/engine/engine.js +2 -1
- package/dist/esm/Components/NavLauncher/engine/fold.js +2 -1
- package/dist/esm/Components/NavLauncher/launcherParts.js +40 -8
- package/dist/esm/Components/NavLauncher/searchLayout.js +1 -0
- package/dist/esm/Components/NavLauncher/spotlightParts.js +23 -10
- 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 +15 -21
- 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/WorkspaceWindow/WorkspaceTrayPreview.js +12 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +3 -1
- 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/provider/ThemeSwitcher.js +1 -1
- 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 +16 -24
- package/dist/index.d.ts +54 -2
- package/dist/index.js +33 -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.HighlightOptionsProvider = 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,11 +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");
|
|
24
26
|
const ringShadow_1 = require("../../Theme/chakra/ringShadow");
|
|
25
27
|
const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
|
|
26
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");
|
|
27
31
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
28
|
-
const
|
|
32
|
+
const motion_2 = require("../../Theme/tokens/primitives/motion");
|
|
29
33
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
30
34
|
const OverflowToolTip_1 = __importDefault(require("../ToolTip/OverflowToolTip"));
|
|
31
35
|
const AppMark_1 = __importDefault(require("../AppSwitcher/AppMark"));
|
|
@@ -38,6 +42,35 @@ const TouchDensityContext = (0, react_2.createContext)(false);
|
|
|
38
42
|
exports.TouchDensity = TouchDensityContext.Provider;
|
|
39
43
|
const useTouchDensity = () => (0, react_2.useContext)(TouchDensityContext);
|
|
40
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
|
+
}
|
|
41
74
|
const isPlainClick = (event) => event.button === 0 &&
|
|
42
75
|
!event.metaKey &&
|
|
43
76
|
!event.ctrlKey &&
|
|
@@ -129,13 +162,14 @@ function NewTag({ label }) {
|
|
|
129
162
|
}
|
|
130
163
|
function SectionHeader({ label, meta, isDecorative = false, isRail = false, hasCount = true, }) {
|
|
131
164
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
132
|
-
|
|
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] }));
|
|
133
167
|
}
|
|
134
168
|
function RowIcon({ icon: Icon, size, stroke = 1.75, mt }) {
|
|
135
169
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
136
170
|
if (!Icon)
|
|
137
171
|
return null;
|
|
138
|
-
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 }) }));
|
|
139
173
|
}
|
|
140
174
|
const HighlightOptionsContext = (0, react_2.createContext)(undefined);
|
|
141
175
|
exports.HighlightOptionsProvider = HighlightOptionsContext.Provider;
|
|
@@ -152,14 +186,14 @@ function RowActions({ children }) {
|
|
|
152
186
|
[NARROW_ROW]: {
|
|
153
187
|
[revealed]: {
|
|
154
188
|
backgroundColor: (0, exports.activeRowStyle)(colors).fill,
|
|
155
|
-
borderRadius: "
|
|
189
|
+
borderRadius: "md",
|
|
156
190
|
},
|
|
157
191
|
},
|
|
158
192
|
}, position: "absolute", top: isTouch ? "12px" : "7px", right: "4px", h: "19px", align: "center", gap: "2px", zIndex: 1, children: children }));
|
|
159
193
|
}
|
|
160
194
|
function RowTip({ text }) {
|
|
161
195
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
162
|
-
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 }));
|
|
163
197
|
}
|
|
164
198
|
function ModuleRow({ module, keyScreens, isPinned, onTogglePin, pinId, labels, link, }) {
|
|
165
199
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -169,7 +203,7 @@ function ModuleRow({ module, keyScreens, isPinned, onTogglePin, pinId, labels, l
|
|
|
169
203
|
const isTouch = (0, exports.useTouchDensity)();
|
|
170
204
|
const base = typeof module.badge === "number" || module.badge ? 24 : 0;
|
|
171
205
|
const open = base + (onTogglePin ? 46 : 24);
|
|
172
|
-
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: {
|
|
173
207
|
textDecoration: "underline",
|
|
174
208
|
textUnderlineOffset: "2px",
|
|
175
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] }));
|
|
@@ -180,11 +214,11 @@ function RailRow({ screen, module, link, isStrong = false, trailing, pinId, }) {
|
|
|
180
214
|
const hover = (0, exports.useRowHover)();
|
|
181
215
|
const focus = (0, exports.useRowFocus)();
|
|
182
216
|
const isTouch = (0, exports.useTouchDensity)();
|
|
183
|
-
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 })] }));
|
|
184
218
|
}
|
|
185
219
|
function PinTextButton({ label, text, onToggle }) {
|
|
186
220
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
187
|
-
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) => {
|
|
188
222
|
event.preventDefault();
|
|
189
223
|
event.stopPropagation();
|
|
190
224
|
onToggle();
|
|
@@ -196,7 +230,7 @@ function PinnedTile({ screen, module, link, labels, onTogglePin, }) {
|
|
|
196
230
|
const Icon = (_a = screen.icon) !== null && _a !== void 0 ? _a : module.icon;
|
|
197
231
|
const focus = (0, exports.useRowFocus)(true);
|
|
198
232
|
const isTouch = (0, exports.useTouchDensity)();
|
|
199
|
-
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] }));
|
|
200
234
|
}
|
|
201
235
|
function AppsSection({ apps, hues, currentAppId, heading, hideHeading = false, onSelect, }) {
|
|
202
236
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -216,7 +250,7 @@ function AppsSection({ apps, hues, currentAppId, heading, hideHeading = false, o
|
|
|
216
250
|
}
|
|
217
251
|
: {}), "aria-current": isCurrent ? "true" : undefined, title: app.locked
|
|
218
252
|
? ((_a = app.lockedReason) !== null && _a !== void 0 ? _a : `${app.name} is not available on your plan`)
|
|
219
|
-
: 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: {
|
|
220
254
|
_focusVisible: rowRing,
|
|
221
255
|
[focusRing_styles_1.FOCUS_VISIBLE_OVER_STATE]: rowRing,
|
|
222
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));
|
|
@@ -37,6 +37,7 @@ export type SearchLayout = {
|
|
|
37
37
|
sizes: number[];
|
|
38
38
|
total: number;
|
|
39
39
|
};
|
|
40
|
+
export declare const copiesOnEnter: (entry?: SearchEntry) => boolean;
|
|
40
41
|
export declare const inScope: (groups: SearchGroup[], scope: string) => SearchGroup[];
|
|
41
42
|
/** A scope's items as passed, unranked, for browsing before typing. */
|
|
42
43
|
export declare const scopeGroups: (input: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.layoutSearch = exports.takeTopHit = exports.countByScope = exports.scopeGroups = exports.inScope = void 0;
|
|
3
|
+
exports.layoutSearch = exports.takeTopHit = exports.countByScope = exports.scopeGroups = exports.inScope = exports.copiesOnEnter = void 0;
|
|
4
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;
|
|
5
7
|
const inScope = (groups, scope) => scope === spotlight_1.SCOPE_ALL ? groups : groups.filter((g) => g.scope === scope);
|
|
6
8
|
exports.inScope = inScope;
|
|
7
9
|
/** A scope's items as passed, unranked, for browsing before typing. */
|
|
@@ -21,7 +21,9 @@ type OptionCardProps = {
|
|
|
21
21
|
describedBy?: string;
|
|
22
22
|
};
|
|
23
23
|
export declare function TopHitCard({ item, query, isActive, optionId, link, labels, onOpen, onHover, describedBy, }: OptionCardProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export declare function AnswerCard({ item, isActive, optionId, link, labels, onOpen, onHover, describedBy, }: Omit<OptionCardProps, "query">
|
|
24
|
+
export declare function AnswerCard({ item, isActive, isCopied, optionId, link, labels, onOpen, onHover, describedBy, }: Omit<OptionCardProps, "query"> & {
|
|
25
|
+
isCopied: boolean;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export declare function ShowMoreOption({ count, isActive, optionId, label, onExpand, onHover, }: {
|
|
26
28
|
count: number;
|
|
27
29
|
isActive: boolean;
|
|
@@ -38,10 +40,12 @@ export declare function FactList({ facts, labels, layout, onCopied, onCopyBlocke
|
|
|
38
40
|
onCopied: () => void;
|
|
39
41
|
onCopyBlocked: (node: HTMLElement | null) => void;
|
|
40
42
|
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export declare function PreviewPane({ item, placement, width, labels, onCopied, onCopyBlocked, }: {
|
|
43
|
+
export declare function PreviewPane({ item, placement, width, enterCopies, isCopied, labels, onCopied, onCopyBlocked, }: {
|
|
42
44
|
item?: LauncherResult;
|
|
43
45
|
placement: "side" | "dock";
|
|
44
46
|
width?: string;
|
|
47
|
+
enterCopies: boolean;
|
|
48
|
+
isCopied: boolean;
|
|
45
49
|
labels: ResolvedLabels;
|
|
46
50
|
onCopied: () => void;
|
|
47
51
|
onCopyBlocked: (node: HTMLElement | null) => void;
|
|
@@ -16,6 +16,7 @@ const lucide_react_1 = require("lucide-react");
|
|
|
16
16
|
const react_2 = require("react");
|
|
17
17
|
const motion_1 = require("../../Theme/chakra/motion");
|
|
18
18
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
19
|
+
const surfaceRaised_1 = require("../../Theme/tokens/builders/surfaceRaised");
|
|
19
20
|
const motion_2 = require("../../Theme/tokens/primitives/motion");
|
|
20
21
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
21
22
|
const Button_1 = __importDefault(require("../Button/Button"));
|
|
@@ -24,6 +25,17 @@ const Kbd_1 = require("../Kbd/Kbd");
|
|
|
24
25
|
const launcherParts_1 = require("./launcherParts");
|
|
25
26
|
exports.QUICK_ACTION_LIMIT = 5;
|
|
26
27
|
const HIDE_ON_TOUCH = { "@media (hover: none)": { display: "none" } };
|
|
28
|
+
const COPIED_ON_TOUCH = (backgroundColor) => ({
|
|
29
|
+
"@media (hover: none)": {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
top: "50%",
|
|
32
|
+
right: "10px",
|
|
33
|
+
transform: "translateY(-50%)",
|
|
34
|
+
padding: "2px 8px",
|
|
35
|
+
borderRadius: "md",
|
|
36
|
+
backgroundColor,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
27
39
|
function QuickActionsRow({ items, label, link, onRun, }) {
|
|
28
40
|
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { role: "group", "aria-label": label, "data-testid": "launcher-quick-actions", gap: "6px", minW: 0, flexWrap: "wrap", px: "4px", children: items.slice(0, exports.QUICK_ACTION_LIMIT).map((item) => {
|
|
29
41
|
const Icon = item.icon;
|
|
@@ -46,7 +58,7 @@ const useCardSurface = (isActive) => {
|
|
|
46
58
|
position: "relative",
|
|
47
59
|
borderRadius: "xl",
|
|
48
60
|
borderWidth: "1px",
|
|
49
|
-
borderColor: isActive ? edge : colors
|
|
61
|
+
borderColor: isActive ? edge : (0, surfaceRaised_1.raisedRule)(colors),
|
|
50
62
|
bg: isActive ? fill : colors.surfaceRaised,
|
|
51
63
|
transition: (0, motion_2.transitionFor)(["background-color", "border-color"]),
|
|
52
64
|
sx: (0, motion_1.reducedMotionSx)(),
|
|
@@ -69,9 +81,9 @@ function TopHitCard({ item, query, isActive, optionId, link, labels, onOpen, onH
|
|
|
69
81
|
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { role: "presentation", "data-group": true, "data-reveal": isActive, direction: "column", gap: "10px", p: "12px", onMouseMove: onHover, ...surface, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "aria-describedby": describedBy, "data-active": isActive, align: "center", gap: "12px", minW: 0, cursor: "pointer", onClick: () => {
|
|
70
82
|
if (!item.href)
|
|
71
83
|
onOpen();
|
|
72
|
-
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 40 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "2px", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", lineHeight: "22px", fontWeight: 600, color: colors.text[900], noOfLines: 1, children: (0, jsx_runtime_1.jsx)(launcherParts_1.Highlight, { text: item.label, query: query }) }), meta ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "
|
|
84
|
+
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 40 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "2px", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", lineHeight: "22px", fontWeight: 600, color: colors.text[900], noOfLines: 1, children: (0, jsx_runtime_1.jsx)(launcherParts_1.Highlight, { text: item.label, query: query }) }), meta ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs-plus", color: colors.textMuted, noOfLines: 1, children: meta })) : null, item.keywordHint ? ((0, jsx_runtime_1.jsxs)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: [`${labels.matchedOn} “`, (0, jsx_runtime_1.jsx)(launcherParts_1.Highlight, { text: item.keywordHint, query: query }), "\u201D"] })) : null] }), (0, jsx_runtime_1.jsx)(launcherParts_1.CountBadge, { value: item.badge }), (0, jsx_runtime_1.jsx)(react_1.Box, { "aria-hidden": true, flexShrink: 0, visibility: isActive ? "visible" : "hidden", sx: HIDE_ON_TOUCH, children: (0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "sm" }) })] }), (0, jsx_runtime_1.jsx)(CardAnchor, { item: item, link: link })] }));
|
|
73
85
|
}
|
|
74
|
-
function AnswerCard({ item, isActive, optionId, link, labels, onOpen, onHover, describedBy, }) {
|
|
86
|
+
function AnswerCard({ item, isActive, isCopied, optionId, link, labels, onOpen, onHover, describedBy, }) {
|
|
75
87
|
var _a, _b;
|
|
76
88
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
77
89
|
const surface = useCardSurface(isActive);
|
|
@@ -80,15 +92,16 @@ function AnswerCard({ item, isActive, optionId, link, labels, onOpen, onHover, d
|
|
|
80
92
|
value: item.label,
|
|
81
93
|
};
|
|
82
94
|
const acts = Boolean(item.href || item.run);
|
|
95
|
+
const hint = acts ? labels.hintOpen : labels.hintCopy;
|
|
83
96
|
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { role: "presentation", "data-group": true, p: "12px 14px", onMouseMove: onHover, ...surface, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "aria-describedby": describedBy, "data-active": isActive, align: "center", gap: "12px", flex: 1, minW: 0, cursor: "pointer", onClick: () => {
|
|
84
97
|
if (!item.href)
|
|
85
98
|
onOpen();
|
|
86
|
-
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 36 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "1px", children: [answer.label ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs-minus", fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", color: colors.textMuted, noOfLines: 1, children: answer.label })) : null, (0, jsx_runtime_1.jsx)(react_1.Text, { id: `${optionId}-value`, fontSize: "lg", lineHeight: "24px", fontWeight: 600, color: colors.text[900], noOfLines: 2, children: answer.value }), answer.hint ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: answer.hint })) : null] }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: "6px", flexShrink: 0, fontSize: "
|
|
99
|
+
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 36 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "1px", children: [answer.label ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs-minus", fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", color: colors.textMuted, noOfLines: 1, children: answer.label })) : null, (0, jsx_runtime_1.jsx)(react_1.Text, { id: `${optionId}-value`, fontSize: "lg", lineHeight: "24px", fontWeight: 600, color: colors.text[900], noOfLines: 2, children: answer.value }), answer.hint ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: answer.hint })) : null] }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: "6px", flexShrink: 0, fontSize: "xs-minus", color: colors.textMuted, visibility: isActive || isCopied ? "visible" : "hidden", sx: isCopied ? COPIED_ON_TOUCH(surface.bg) : HIDE_ON_TOUCH, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { display: "contents", sx: HIDE_ON_TOUCH, children: (0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "xs" }) }), (0, jsx_runtime_1.jsx)(launcherParts_1.HintLabel, { ...(0, launcherParts_1.copyHint)(hint, labels.copied, isCopied) })] })] }), (0, jsx_runtime_1.jsx)(CardAnchor, { item: item, link: link })] }));
|
|
87
100
|
}
|
|
88
101
|
function ShowMoreOption({ count, isActive, optionId, label, onExpand, onHover, }) {
|
|
89
102
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
90
103
|
const isTouch = (0, launcherParts_1.useTouchDensity)();
|
|
91
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "data-active": isActive, align: "center", gap: "6px", minH: isTouch ? "44px" : "30px", px: "8px", mt: "2px", borderRadius: "lg", cursor: "pointer", fontSize: "
|
|
104
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "data-active": isActive, align: "center", gap: "6px", minH: isTouch ? "44px" : "30px", px: "8px", mt: "2px", borderRadius: "lg", cursor: "pointer", fontSize: "xs-plus", fontWeight: 500, color: colors.accentText, onClick: onExpand, onMouseMove: onHover, _hover: { bg: (0, rowStates_1.listRowBackgrounds)(colors).active }, sx: isActive ? (0, launcherParts_1.activeRowSurface)(colors) : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, strokeWidth: 2, "aria-hidden": true }), label(count)] }));
|
|
92
105
|
}
|
|
93
106
|
const describeFacts = (facts) => facts.map((f) => `${f.label}: ${f.value}`).join("; ");
|
|
94
107
|
exports.describeFacts = describeFacts;
|
|
@@ -96,13 +109,13 @@ function FactList({ facts, labels, layout, onCopied, onCopyBlocked, }) {
|
|
|
96
109
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
97
110
|
const values = (0, react_2.useRef)([]);
|
|
98
111
|
const isPane = layout === "pane";
|
|
99
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "dl", m: 0, display: "grid", gridTemplateColumns: isPane ? "minmax(0, 1fr)" : "repeat(auto-fill, minmax(11rem, 1fr))", gap: isPane ? "12px" : "6px 16px", children: facts.map((fact, i) => ((0, jsx_runtime_1.jsxs)(react_1.Box, { minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { as: "dt", fontSize: "
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "dl", m: 0, display: "grid", gridTemplateColumns: isPane ? "minmax(0, 1fr)" : "repeat(auto-fill, minmax(11rem, 1fr))", gap: isPane ? "12px" : "6px 16px", children: facts.map((fact, i) => ((0, jsx_runtime_1.jsxs)(react_1.Box, { minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { as: "dt", fontSize: "xs-minus", lineHeight: "16px", color: colors.textMuted, children: fact.label }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "dd", m: 0, align: "center", gap: "2px", minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { ref: (node) => {
|
|
100
113
|
values.current[i] = node;
|
|
101
|
-
}, fontSize: isPane ? "13.5px" : "
|
|
114
|
+
}, fontSize: isPane ? "13.5px" : "xs-plus", lineHeight: "20px", color: colors.text[900], wordBreak: "break-word", minW: 0, children: fact.value }), fact.copyable ? ((0, jsx_runtime_1.jsx)(CopyButton_1.default, { value: fact.value, tooltip: labels.copy(fact.label), copiedLabel: labels.copied, size: isPane ? "xs" : "sm", iconSize: 14, onCopy: onCopied, onCopyError: () => onCopyBlocked(values.current[i]) })) : null] })] }, `${fact.label}-${i}`))) }));
|
|
102
115
|
}
|
|
103
|
-
function PreviewPane({ item, placement, width, labels, onCopied, onCopyBlocked, }) {
|
|
116
|
+
function PreviewPane({ item, placement, width, enterCopies, isCopied, labels, onCopied, onCopyBlocked, }) {
|
|
104
117
|
var _a, _b, _c, _d, _e;
|
|
105
118
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
106
119
|
const isDock = placement === "dock";
|
|
107
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { as: "aside", "aria-label": labels.preview, "data-testid": "launcher-preview", "data-scroll-region": true, direction: "column", gap: isDock ? "10px" : "16px", w: isDock ? "100%" : width, maxH: isDock ? "min(45vh, 20rem)" : undefined, flexShrink: 0, px: "18px", pt: isDock ? "12px" : "16px", pb: isDock ? "12px" : "16px", bg: colors.backgroundColor.subtle, ...(isDock ? { borderTopWidth: "1px" } : { borderLeftWidth: "1px" }), borderColor: colors
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { as: "aside", "aria-label": labels.preview, "data-testid": "launcher-preview", "data-scroll-region": true, direction: "column", gap: isDock ? "10px" : "16px", w: isDock ? "100%" : width, maxH: isDock ? "min(45vh, 20rem)" : undefined, flexShrink: 0, px: "18px", pt: isDock ? "12px" : "16px", pb: isDock ? "12px" : "16px", bg: colors.backgroundColor.subtle, ...(isDock ? { borderTopWidth: "1px" } : { borderLeftWidth: "1px" }), borderColor: (0, surfaceRaised_1.raisedRule)(colors), overflowY: "auto", children: item ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "10px", minW: 0, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: isDock ? 28 : 36 }), (0, jsx_runtime_1.jsxs)(react_1.Box, { minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: isDock ? "14px" : "15px", fontWeight: 600, color: colors.text[900], noOfLines: isDock ? 1 : 2, children: (_b = (_a = item.answer) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : item.label }), item.context || item.answer ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: (_d = (_c = item.answer) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : item.context })) : null] })] }), ((_e = item.facts) === null || _e === void 0 ? void 0 : _e.length) ? ((0, jsx_runtime_1.jsx)(FactList, { facts: item.facts, labels: labels, layout: isDock ? "inline" : "pane", onCopied: onCopied, onCopyBlocked: onCopyBlocked }, item.id)) : ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: "6px", fontSize: "xs", color: colors.textMuted, children: [(0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "xs" }), (0, jsx_runtime_1.jsx)(launcherParts_1.HintLabel, { ...(0, launcherParts_1.copyHint)(enterCopies ? labels.hintCopy : labels.hintOpen, labels.copied, isCopied) })] }))] })) : null }));
|
|
108
121
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COPIED_FLASH_MS = void 0;
|
|
4
|
+
exports.useCopiedFlash = useCopiedFlash;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.COPIED_FLASH_MS = 1500;
|
|
7
|
+
function useCopiedFlash() {
|
|
8
|
+
const [copiedId, setCopiedId] = (0, react_1.useState)(null);
|
|
9
|
+
const timer = (0, react_1.useRef)();
|
|
10
|
+
(0, react_1.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
11
|
+
const clear = (0, react_1.useCallback)(() => {
|
|
12
|
+
clearTimeout(timer.current);
|
|
13
|
+
setCopiedId(null);
|
|
14
|
+
}, []);
|
|
15
|
+
const flash = (0, react_1.useCallback)((id) => {
|
|
16
|
+
clearTimeout(timer.current);
|
|
17
|
+
setCopiedId(id);
|
|
18
|
+
timer.current = setTimeout(() => setCopiedId(null), exports.COPIED_FLASH_MS);
|
|
19
|
+
}, []);
|
|
20
|
+
return { copiedId, flash, clear };
|
|
21
|
+
}
|
|
@@ -8,7 +8,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@chakra-ui/react");
|
|
9
9
|
const Avatar_1 = __importDefault(require("../Avatar/Avatar"));
|
|
10
10
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
|
-
const surfaceRaised_1 = require("../../Theme/tokens/builders/surfaceRaised");
|
|
12
11
|
const planeStep_1 = require("../../Theme/tokens/builders/planeStep");
|
|
13
12
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
14
13
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
@@ -17,6 +16,8 @@ const statusTone_1 = require("../../Theme/tokens/builders/statusTone");
|
|
|
17
16
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
18
17
|
const PersonChip_1 = __importDefault(require("../PersonChip/PersonChip"));
|
|
19
18
|
const lucide_react_1 = require("lucide-react");
|
|
19
|
+
const motion_1 = require("../../Theme/tokens/primitives/motion");
|
|
20
|
+
const BACKGROUND_TRANSITION = (0, motion_1.transitionFor)(["background"]);
|
|
20
21
|
// Roomy enough to hover without aiming: the glyph is only 1.25rem.
|
|
21
22
|
const SIDEBAR_TOGGLE_HIT = "2.5rem";
|
|
22
23
|
function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText, sideBarToggole, onSideBarToggole, forceSideBarToggle = false, onSideBarPeek, leading, }) {
|
|
@@ -35,7 +36,7 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
35
36
|
cursor: "pointer",
|
|
36
37
|
border: "none",
|
|
37
38
|
bg: "transparent",
|
|
38
|
-
transition:
|
|
39
|
+
transition: BACKGROUND_TRANSITION,
|
|
39
40
|
_hover: { bg: barHoverBg },
|
|
40
41
|
};
|
|
41
42
|
const menuItemStyle = {
|
|
@@ -50,7 +51,7 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
50
51
|
fontSize: "xs-plus",
|
|
51
52
|
color: theme.colors.text[900],
|
|
52
53
|
gap: theme.space["2"],
|
|
53
|
-
transition:
|
|
54
|
+
transition: BACKGROUND_TRANSITION,
|
|
54
55
|
_hover: { bg: menuHoverBg },
|
|
55
56
|
_focus: { bg: menuHoverBg },
|
|
56
57
|
_active: { bg: rowBackgrounds.selectedActive },
|
|
@@ -59,10 +60,10 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
59
60
|
// Without a cap one long title stretches the whole dropdown; titles truncate instead.
|
|
60
61
|
maxW: "18rem", bg: theme.colors.surfaceRaised,
|
|
61
62
|
// NOTE: Chakra's MenuItem inherits --menu-bg hardcoded to #fff via dead _dark — set it or items stay white.
|
|
62
|
-
sx: { "--menu-bg": theme.colors.backgroundColor.light }, borderRadius: "xl", boxShadow: "lg", color: theme.colors.text[900], overflow: "hidden", children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", maxH: "90vh", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { pt: 4, pb: 2, px: 4, children: (0, jsx_runtime_1.jsx)(PersonChip_1.default, { name: userName, imageUrl: userAvathar, secondary: userRole, orientation: "vertical", size: "xl", maxW: "100%" }) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, {
|
|
63
|
+
sx: { "--menu-bg": theme.colors.backgroundColor.light }, borderRadius: "xl", boxShadow: "lg", color: theme.colors.text[900], overflow: "hidden", children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", maxH: "90vh", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { pt: 4, pb: 2, px: 4, children: (0, jsx_runtime_1.jsx)(PersonChip_1.default, { name: userName, imageUrl: userAvathar, secondary: userRole, orientation: "vertical", size: "xl", maxW: "100%" }) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, {}), (0, jsx_runtime_1.jsx)(react_1.Box, { flex: 1, overflowY: "auto", overflowX: "hidden", children: navMenu === null || navMenu === void 0 ? void 0 : navMenu.map((menu, idx) => {
|
|
63
64
|
var _a, _b, _c, _d;
|
|
64
65
|
return ((0, jsx_runtime_1.jsxs)(react_1.MenuItem, { onClick: () => handleNavOnClick(menu.url), sx: menuItemStyle, children: [menu.icon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", flexShrink: 0, sx: { "& svg": { width: "16px", height: "16px" } }, children: menu === null || menu === void 0 ? void 0 : menu.icon })), (0, jsx_runtime_1.jsx)(react_1.Box, { minW: 0, isTruncated: true, title: String((_a = menu.title) !== null && _a !== void 0 ? _a : ""), children: menu.title })] }, `${String((_d = (_c = (_b = menu.id) !== null && _b !== void 0 ? _b : menu.url) !== null && _c !== void 0 ? _c : menu.title) !== null && _d !== void 0 ? _d : idx)}-${idx}`));
|
|
65
|
-
}) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, {
|
|
66
|
+
}) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, {}), (0, jsx_runtime_1.jsxs)(react_1.MenuItem, { onClick: handleLogout, sx: {
|
|
66
67
|
...menuItemStyle,
|
|
67
68
|
color: theme.colors.semanticText.error,
|
|
68
69
|
_hover: { bg: dangerTone.bg, color: dangerTone.fg },
|
|
@@ -6,16 +6,13 @@ const react_2 = require("@chakra-ui/react");
|
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
8
|
const placeholderInk_1 = require("../../Theme/tokens/builders/placeholderInk");
|
|
9
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
9
10
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
11
|
+
const planeStep_1 = require("../../Theme/tokens/builders/planeStep");
|
|
10
12
|
const fieldStyles_1 = require("../Common/fieldStyles");
|
|
13
|
+
const activationKey_1 = require("../Common/activationKey");
|
|
11
14
|
const motion_1 = require("../../Theme/tokens/primitives/motion");
|
|
12
15
|
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
13
|
-
const onActivationKey = (activate) => (e) => {
|
|
14
|
-
if (e.key !== "Enter" && e.key !== " ")
|
|
15
|
-
return;
|
|
16
|
-
e.preventDefault();
|
|
17
|
-
activate();
|
|
18
|
-
};
|
|
19
16
|
const countWords = (text = "") => {
|
|
20
17
|
const t = text.trim();
|
|
21
18
|
if (!t)
|
|
@@ -35,13 +32,6 @@ const NoteTextArea = (0, react_1.forwardRef)(function NoteTextArea({ width = "10
|
|
|
35
32
|
const [titleShow, setTitleShow] = (0, react_1.useState)(false);
|
|
36
33
|
const [files, setFiles] = (0, react_1.useState)([]);
|
|
37
34
|
const [fileError, setFileError] = (0, react_1.useState)("");
|
|
38
|
-
const [isSaveDisabled, setIsSaveDisabled] = (0, react_1.useState)(false);
|
|
39
|
-
(0, react_1.useEffect)(() => {
|
|
40
|
-
setIsSaveDisabled(countWords(titleValue) > maxNoteWordCount);
|
|
41
|
-
}, [titleValue, maxNoteWordCount]);
|
|
42
|
-
(0, react_1.useEffect)(() => {
|
|
43
|
-
setIsSaveDisabled(countWords(noteValue) > maxNoteWordCount);
|
|
44
|
-
}, [noteValue, maxNoteWordCount]);
|
|
45
35
|
(0, react_1.useEffect)(() => {
|
|
46
36
|
if (isEditable) {
|
|
47
37
|
setIsActive(true);
|
|
@@ -131,14 +121,19 @@ const NoteTextArea = (0, react_1.forwardRef)(function NoteTextArea({ width = "10
|
|
|
131
121
|
};
|
|
132
122
|
const noteWordCount = countWords(noteValue);
|
|
133
123
|
const isOverLimit = noteWordCount > maxNoteWordCount;
|
|
124
|
+
const isSaveDisabled = isOverLimit || countWords(titleValue) > maxNoteWordCount;
|
|
125
|
+
const activeBandBg = (0, planeStep_1.bandOn)(theme.colors.gray[50], theme.colors.background[50]);
|
|
134
126
|
const collapsedHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[50], theme.colors.background[50]);
|
|
135
|
-
const activeControlHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[100],
|
|
127
|
+
const activeControlHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[100], activeBandBg);
|
|
128
|
+
const chipBg = (0, planeStep_1.bandOn)(theme.colors.gray[100], activeBandBg);
|
|
129
|
+
const chipInk = (0, outlineRung_1.liftToContrast)(theme.colors.textMuted, chipBg, accentText_1.AA_NORMAL_TEXT);
|
|
130
|
+
const chipRemoveHoverBg = (0, planeStep_1.bandOn)(theme.colors.gray[200], chipBg);
|
|
136
131
|
// NOTE: drawn inset because the rounded shell clips overflow.
|
|
137
132
|
const placeholderFocusRing = {
|
|
138
133
|
outline: "2px solid transparent",
|
|
139
134
|
boxShadow: (0, focusRing_styles_1.insetFocusRingShadow)(theme.colors),
|
|
140
135
|
};
|
|
141
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: width, borderRadius: fieldStyles_1.FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ?
|
|
136
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: width, borderRadius: fieldStyles_1.FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ? activeBandBg : theme.colors.background[50], transition: (0, motion_1.transitionFor)(["border-color"]), children: [!isActive && ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 3, gap: 2, align: "center", cursor: "text", role: "button", tabIndex: 0, onClick: handleTextArea, onKeyDown: (0, activationKey_1.onActivationKey)(handleTextArea), _focusVisible: placeholderFocusRing, bg: theme.colors.background[50], borderRadius: fieldStyles_1.FIELD_RADIUS, minH: "2.5rem", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: { bg: collapsedHoverBg }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color: theme.colors.textMuted }), (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", children: customPlaceholder })] })), isActive && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], children: [titleShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { value: titleValue, onChange: (e) => {
|
|
142
137
|
if (e.target.value.length === 0)
|
|
143
138
|
setTitleShow(false);
|
|
144
139
|
setTitleValue(e.target.value);
|
|
@@ -146,7 +141,7 @@ const NoteTextArea = (0, react_1.forwardRef)(function NoteTextArea({ width = "10
|
|
|
146
141
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
147
142
|
} }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: (0, jsx_runtime_1.jsx)(react_2.Textarea, { ref: mergedNoteRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, "aria-label": noteAriaLabel, variant: "unstyled", resize: "none", minH: "76px", fontSize: "xs", color: theme.colors.text[700], _placeholder: {
|
|
148
143
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
149
|
-
}, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", role: "button", tabIndex: 0, "aria-label": "Attach files", onClick: openFilePicker, onKeyDown: onActivationKey(openFilePicker), _focusVisible: (0, focusRing_styles_1.focusVisibleRing)(theme.colors), cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: (0, motion_1.transitionFor)(["background-color"]), _hover: { bg: activeControlHoverBg }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(react_2.Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: { bg: activeControlHoverBg }, children: "+ Add a title" })) : ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), (0, jsx_runtime_1.jsxs)(react_2.Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), (0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, id: fileInputId, type: "file", style: { display: "none" }, onChange: (e) => {
|
|
144
|
+
}, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", role: "button", tabIndex: 0, "aria-label": "Attach files", onClick: openFilePicker, onKeyDown: (0, activationKey_1.onActivationKey)(openFilePicker), _focusVisible: (0, focusRing_styles_1.focusVisibleRing)(theme.colors), cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: (0, motion_1.transitionFor)(["background-color"]), _hover: { bg: activeControlHoverBg }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(react_2.Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: (0, motion_1.transitionFor)(["background-color"]), _hover: { bg: activeControlHoverBg }, children: "+ Add a title" })) : ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), (0, jsx_runtime_1.jsxs)(react_2.Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), (0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, id: fileInputId, type: "file", style: { display: "none" }, onChange: (e) => {
|
|
150
145
|
const newFiles = Array.from(e.target.files || []);
|
|
151
146
|
const validFiles = newFiles.filter((f) => f.size <= maxFileSize);
|
|
152
147
|
const invalidFiles = newFiles.filter((f) => f.size > maxFileSize);
|
|
@@ -159,7 +154,7 @@ const NoteTextArea = (0, react_1.forwardRef)(function NoteTextArea({ width = "10
|
|
|
159
154
|
if (validFiles.length > 0) {
|
|
160
155
|
setFiles((prev) => [...prev, ...validFiles]);
|
|
161
156
|
}
|
|
162
|
-
}, multiple: true }), fileError && ((0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.semanticText.error, mt: 2, fontSize: "xs", children: fileError })), files.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Flex, { mt: 3, gap: 2, wrap: "wrap", children: files.map((f, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, pl: 2.5, pr: 1.5, py: 1, borderRadius: "full", bg:
|
|
157
|
+
}, multiple: true }), fileError && ((0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.semanticText.error, mt: 2, fontSize: "xs", children: fileError })), files.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Flex, { mt: 3, gap: 2, wrap: "wrap", children: files.map((f, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, pl: 2.5, pr: 1.5, py: 1, borderRadius: "full", bg: chipBg, maxW: "100%", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.File, { size: 13, color: chipInk }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "xs", color: theme.colors.text[700], isTruncated: true, maxW: "160px", children: shortenFileName(f.name) }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "xs", color: chipInk, whiteSpace: "nowrap", children: formatBytes(f.size) }), (0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-label": `Remove ${f.name}`, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "full", p: 0.5, color: chipInk, transition: (0, motion_1.transitionFor)(["background-color", "color"]), _hover: { bg: chipRemoveHoverBg, color: theme.colors.semanticText.error }, onClick: () => setFiles((prev) => prev.filter((fileItem) => fileItem !== f)), children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 13 }) })] }, idx))) }))] })] }))] }));
|
|
163
158
|
});
|
|
164
159
|
NoteTextArea.displayName = "NoteTextArea";
|
|
165
160
|
exports.default = NoteTextArea;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
export type NoteTextAreaProps = {
|
|
3
3
|
width?: number | string;
|
|
4
4
|
/** Save click with note, title and files; `resetState` is never passed. */
|
|
5
|
-
handleSubmit: (noteValue: string, titleValue: string, file: File[],
|
|
5
|
+
handleSubmit: (noteValue: string, titleValue: string, file: File[],
|
|
6
|
+
/** @deprecated Never passed; remove it from your handler. */
|
|
7
|
+
resetState: void) => void;
|
|
6
8
|
/** Seeds the note only while isEditable is true; not a controlled value. */
|
|
7
9
|
value?: string;
|
|
8
10
|
/** Seeds and reveals the title input only while isEditable is true. */
|
|
@@ -11,8 +13,8 @@ export type NoteTextAreaProps = {
|
|
|
11
13
|
file?: File[];
|
|
12
14
|
/** Edit mode: opens expanded, seeds value/title/file, and keeps them after saving. */
|
|
13
15
|
isEditable?: boolean;
|
|
14
|
-
/** Fires on Cancel
|
|
15
|
-
handleCancel?: (isActive: boolean) => void;
|
|
16
|
+
/** Fires on Cancel. */
|
|
17
|
+
handleCancel?: (/** @deprecated Always false; do not read it. */ isActive: boolean) => void;
|
|
16
18
|
/** Any transition to false while isEditable is not true clears the note, title and files — including after a failed save, not just success. */
|
|
17
19
|
saveButtonLoading?: boolean;
|
|
18
20
|
/** Per-file byte limit, default 1 MB; larger files are skipped with an error line. */
|