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
|
@@ -77,7 +77,7 @@ const Badge = {
|
|
|
77
77
|
size: "sm",
|
|
78
78
|
},
|
|
79
79
|
};
|
|
80
|
-
// NOTE: fixes Chakra's FormErrorMessage/Icon hardcoding red.500
|
|
80
|
+
// NOTE: fixes Chakra's FormErrorMessage/Icon hardcoding red.500, which misses AA on the canvas.
|
|
81
81
|
const FormError = {
|
|
82
82
|
baseStyle: ({ theme }) => {
|
|
83
83
|
const palette = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PaletteProps, ResolvedColorMode } from "../tokens/types";
|
|
2
2
|
import { type ReducedMotionScope } from "./motion";
|
|
3
|
+
/** Colour mode and reduced-motion scope for a built brand theme. */
|
|
3
4
|
export interface CreateBrandThemeOptions {
|
|
4
5
|
/** Which palette this theme represents. Defaults to `light`. */
|
|
5
6
|
colorMode?: ResolvedColorMode;
|
|
@@ -10,7 +10,7 @@ type WithBrandGlow = {
|
|
|
10
10
|
primary: BrandScale;
|
|
11
11
|
};
|
|
12
12
|
export declare const focusRingShadow: (colors: WithFocusRing) => string;
|
|
13
|
-
/** For controls whose
|
|
13
|
+
/** For controls whose shell clips overflow: ring on the edge, halo inside, so an opaque child leaves the ring. */
|
|
14
14
|
export declare const insetFocusRingShadow: (colors: WithFocusRing) => string;
|
|
15
15
|
export declare const FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
16
16
|
export declare const focusVisibleRing: (colors: WithFocusRing) => {
|
|
@@ -10,9 +10,9 @@ exports.FOCUS_RING_WIDTH = 4;
|
|
|
10
10
|
const focusRingShadow = (colors) => `0 0 0 ${exports.FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
11
11
|
`0 0 0 ${exports.FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
12
12
|
exports.focusRingShadow = focusRingShadow;
|
|
13
|
-
/** For controls whose
|
|
14
|
-
const insetFocusRingShadow = (colors) => `inset 0 0 0 ${exports.FOCUS_HALO_WIDTH}px ${colors.focusRing.
|
|
15
|
-
`inset 0 0 0 ${exports.FOCUS_RING_WIDTH}px ${colors.focusRing.
|
|
13
|
+
/** For controls whose shell clips overflow: ring on the edge, halo inside, so an opaque child leaves the ring. */
|
|
14
|
+
const insetFocusRingShadow = (colors) => `inset 0 0 0 ${exports.FOCUS_RING_WIDTH - exports.FOCUS_HALO_WIDTH}px ${colors.focusRing.ring}, ` +
|
|
15
|
+
`inset 0 0 0 ${exports.FOCUS_RING_WIDTH}px ${colors.focusRing.halo}`;
|
|
16
16
|
exports.insetFocusRingShadow = insetFocusRingShadow;
|
|
17
17
|
// NOTE: stacked pseudo-classes raise specificity above Chakra's _hover, so a hovered+focused button keeps its ring.
|
|
18
18
|
exports.FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
@@ -3,4 +3,5 @@ import type { ColorScale, PaletteProps } from "../tokens/types";
|
|
|
3
3
|
export declare const paletteOf: (theme: {
|
|
4
4
|
colors?: unknown;
|
|
5
5
|
}) => PaletteProps;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const warnUnknownColorScheme: (colorScheme: string) => void;
|
|
7
|
+
export declare const scaleFor: (palette: PaletteProps, colorScheme: string, fallback?: ColorScale) => ColorScale;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scaleFor = exports.paletteOf = void 0;
|
|
3
|
+
exports.scaleFor = exports.warnUnknownColorScheme = exports.paletteOf = void 0;
|
|
4
4
|
const assertPalette_1 = require("../assertPalette");
|
|
5
|
+
const paletteScale_1 = require("../tokens/builders/paletteScale");
|
|
5
6
|
/** Chakra hands style functions an untyped theme; this is the boundary that makes it typed. */
|
|
6
7
|
const paletteOf = (theme) => (0, assertPalette_1.assertPixelizePalette)(theme);
|
|
7
8
|
exports.paletteOf = paletteOf;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const warned = new Set();
|
|
10
|
+
const warnUnknownColorScheme = (colorScheme) => {
|
|
11
|
+
if (process.env.NODE_ENV === "production" || warned.has(colorScheme))
|
|
12
|
+
return;
|
|
13
|
+
warned.add(colorScheme);
|
|
14
|
+
console.warn(`[pixelize-design-library] colorScheme "${colorScheme}" is not a themed colour scale; using the fallback scale.`);
|
|
15
|
+
};
|
|
16
|
+
exports.warnUnknownColorScheme = warnUnknownColorScheme;
|
|
17
|
+
// NOTE: colorScheme is consumer-supplied and can name a built-in we never themed — unknowns use the fallback.
|
|
18
|
+
const scaleFor = (palette, colorScheme, fallback = palette.gray) => {
|
|
19
|
+
const scale = (0, paletteScale_1.scaleNamed)(palette, colorScheme);
|
|
20
|
+
if (scale)
|
|
21
|
+
return scale;
|
|
22
|
+
(0, exports.warnUnknownColorScheme)(colorScheme);
|
|
23
|
+
return fallback;
|
|
24
|
+
};
|
|
11
25
|
exports.scaleFor = scaleFor;
|
|
@@ -9,6 +9,7 @@ export type ThemeModeContextValue = {
|
|
|
9
9
|
brand: ThemeName;
|
|
10
10
|
setBrand: (brand: ThemeName) => void;
|
|
11
11
|
};
|
|
12
|
+
/** Brand and mode state, persisted to localStorage unless `disablePersistence` is set. */
|
|
12
13
|
export type PixelizeThemeProviderProps = {
|
|
13
14
|
children: React.ReactNode;
|
|
14
15
|
brand?: ThemeName;
|
|
@@ -81,7 +81,7 @@ const SegmentedVariant = ({ size, label, showBrandPicker, }) => {
|
|
|
81
81
|
const isSelected = mode === value;
|
|
82
82
|
return ((0, jsx_runtime_1.jsx)(react_2.Button, { ref: (node) => {
|
|
83
83
|
optionRefs.current[index] = node;
|
|
84
|
-
}, role: "radio", "aria-checked": isSelected, "aria-label": optionLabel, onClick: () => setMode(value), onKeyDown: (event) => handleKeyDown(event, index), size: SIZES[size].control, variant: "ghost", borderRadius: "full", bg: isSelected ? activeBg : "transparent", color: isSelected ? activeColor : mutedColor, boxShadow: isSelected ? "sm" : "none", _hover: { color: activeColor }, _focusVisible: { outline: "2px solid transparent", outlineOffset: "2px" }, children: (0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }) }, value));
|
|
84
|
+
}, role: "radio", "aria-checked": isSelected, "aria-label": optionLabel, tabIndex: isSelected ? 0 : -1, onClick: () => setMode(value), onKeyDown: (event) => handleKeyDown(event, index), size: SIZES[size].control, variant: "ghost", borderRadius: "full", bg: isSelected ? activeBg : "transparent", color: isSelected ? activeColor : mutedColor, boxShadow: isSelected ? "sm" : "none", _hover: { color: activeColor }, _focusVisible: { outline: "2px solid transparent", outlineOffset: "2px" }, children: (0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }) }, value));
|
|
85
85
|
}), showBrandPicker && (0, jsx_runtime_1.jsx)(BrandMenu, { size: size })] }));
|
|
86
86
|
};
|
|
87
87
|
const MenuVariant = ({ size, label, showBrandPicker, }) => {
|
|
@@ -4,6 +4,7 @@ export type DeepPartial<T> = T extends string ? T : {
|
|
|
4
4
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
5
5
|
};
|
|
6
6
|
export type PaletteOverrides = DeepPartial<PaletteProps>;
|
|
7
|
+
/** Brand, mode and group overrides for a test palette. */
|
|
7
8
|
export type TestPaletteOptions = {
|
|
8
9
|
brand?: ThemeName;
|
|
9
10
|
mode?: ResolvedColorMode;
|
|
@@ -8,6 +8,7 @@ export declare const accentLightnessDelta: (accent500: string, white: string) =>
|
|
|
8
8
|
export declare const liftScale: (scale: ColorScale, delta: number) => ColorScale;
|
|
9
9
|
/** `lifted`: the card sits a CARD_LIFT step above the canvas. `flat`: the card is the canvas. */
|
|
10
10
|
export type DarkPlanes = "lifted" | "flat";
|
|
11
|
+
/** Card plane choice; defaults to `lifted`. */
|
|
11
12
|
export interface DarkPaletteOptions {
|
|
12
13
|
planes?: DarkPlanes;
|
|
13
14
|
}
|
|
@@ -41,8 +41,9 @@ const solidFillRung = (scale, white, canvas) => {
|
|
|
41
41
|
};
|
|
42
42
|
exports.solidFillRung = solidFillRung;
|
|
43
43
|
const steppedRung = (base, canvas, step) => {
|
|
44
|
-
const dir = (0, accentText_1.isDarkCanvas)(canvas) ? -
|
|
45
|
-
|
|
44
|
+
const dir = (0, accentText_1.isDarkCanvas)(canvas) ? -1 : 1;
|
|
45
|
+
const index = RUNGS.indexOf(base) + dir * step;
|
|
46
|
+
return RUNGS[Math.min(RUNGS.length - 1, Math.max(0, index))];
|
|
46
47
|
};
|
|
47
48
|
const steppedTowardBase = (from, base) => RUNGS[RUNGS.indexOf(from) + (from > base ? -1 : 1)];
|
|
48
49
|
/**
|
|
@@ -4,6 +4,7 @@ exports.withFocusRing = exports.buildFocusRing = exports.focusRingBackdrops = vo
|
|
|
4
4
|
exports.settleBetween = settleBetween;
|
|
5
5
|
const color_1 = require("./color");
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
|
+
const planeStep_1 = require("./planeStep");
|
|
7
8
|
/** Same lightness granularity `buildDarkPalette` walks its accents at. */
|
|
8
9
|
const LIGHTNESS_STEP = 0.5;
|
|
9
10
|
// NOTE: not settleAcross — a ring squeezed between a light canvas and a dark fill needs the closest color that clears both, not a per-surface lift.
|
|
@@ -25,10 +26,12 @@ function settleBetween(hex, backdrops, target = outlineRung_1.AA_NON_TEXT) {
|
|
|
25
26
|
const worst = (candidate) => Math.min(...backdrops.map((backdrop) => (0, color_1.contrastRatio)(candidate, backdrop)));
|
|
26
27
|
return worst(ends[0]) >= worst(ends[1]) ? ends[0] : ends[1];
|
|
27
28
|
}
|
|
28
|
-
// NOTE:
|
|
29
|
+
// NOTE: canvas, card and the table header band — including the fill or every named surface leaves no solvable hue.
|
|
29
30
|
const focusRingBackdrops = (source) => [
|
|
30
31
|
source.backgroundColor.main,
|
|
31
32
|
source.background[50],
|
|
33
|
+
source.backgroundColor.tableHeader,
|
|
34
|
+
(0, planeStep_1.bandOn)(source.backgroundColor.tableHeader, source.background[50]),
|
|
32
35
|
];
|
|
33
36
|
exports.focusRingBackdrops = focusRingBackdrops;
|
|
34
37
|
// NOTE: replaces Chakra's stock ring (a fixed blue that measured under 2:1 on every brand).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scaleNamed = void 0;
|
|
4
|
+
const isColorScale = (value) => typeof value === "object" && value !== null && "500" in value;
|
|
5
|
+
const scaleNamed = (colors, name) => {
|
|
6
|
+
const entries = colors;
|
|
7
|
+
const value = entries[name];
|
|
8
|
+
return isColorScale(value) ? value : undefined;
|
|
9
|
+
};
|
|
10
|
+
exports.scaleNamed = scaleNamed;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function isAllowedReturnUrl(url: string): boolean;
|
|
2
|
+
/** Fallback origin used when the return URL param is missing or disallowed. */
|
|
2
3
|
export type ResolveReturnUrlOptions = {
|
|
3
4
|
/** App-specific fallback (e.g. its own origin) used when the param is missing/disallowed. */
|
|
4
5
|
defaultReturnUrl?: string;
|
|
@@ -17,12 +18,14 @@ export type AccountHandoffConfig = {
|
|
|
17
18
|
/** Where Account returns the user to. Defaults to this app's own origin. */
|
|
18
19
|
buildReturnUrl?: (orgId?: number | string | null) => string;
|
|
19
20
|
};
|
|
21
|
+
/** Query values carried to Account: source app, return URL, org and token. */
|
|
20
22
|
export type AccountHandoffLinkOptions = {
|
|
21
23
|
sourceApp?: string;
|
|
22
24
|
returnUrl?: string;
|
|
23
25
|
orgId?: number | string | null;
|
|
24
26
|
token?: string | null;
|
|
25
27
|
};
|
|
28
|
+
/** Link options plus the user to open on the Account users page. */
|
|
26
29
|
export type AccountHandoffUsersOptions = AccountHandoffLinkOptions & {
|
|
27
30
|
userId?: number | string | null;
|
|
28
31
|
};
|
package/dist/Utils/price.d.ts
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One spreadsheet cell; `null` and `undefined` write an empty cell. */
|
|
2
|
+
export type TabularCell = string | number | boolean | null | undefined;
|
|
3
|
+
interface TabularColumnBase<Row, K extends keyof Row> {
|
|
4
|
+
/** Row field the cell reads, the same `key` a table column uses. */
|
|
5
|
+
readonly key: K;
|
|
6
|
+
/** Text of the header line. */
|
|
7
|
+
readonly header: string;
|
|
8
|
+
/** Turns the field into a cell; required when the field is not a scalar. */
|
|
9
|
+
readonly format?: (value: Row[K], row: Row) => TabularCell;
|
|
10
|
+
/** Default true: formula-like text gets a leading `'` so it is shown, not run. */
|
|
11
|
+
readonly escapeFormulas?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** One exported column; `format` is required when the field is not a scalar. */
|
|
14
|
+
export type TabularColumn<Row> = {
|
|
15
|
+
[K in keyof Row & string]: Row[K] extends TabularCell ? TabularColumnBase<Row, K> : TabularColumnBase<Row, K> & {
|
|
16
|
+
readonly format: (value: Row[K], row: Row) => TabularCell;
|
|
17
|
+
};
|
|
18
|
+
}[keyof Row & string];
|
|
19
|
+
/** Options for `toCsv`. */
|
|
20
|
+
export interface ToCsvOptions {
|
|
21
|
+
/** Prepends a UTF-8 byte-order mark so Excel reads non-ASCII. Default false. */
|
|
22
|
+
readonly bom?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** RFC 4180 CSV: header line, then one CRLF-separated line per row. */
|
|
25
|
+
export declare function toCsv<Row extends object>(rows: readonly Row[], columns: readonly TabularColumn<Row>[], { bom }?: ToCsvOptions): string;
|
|
26
|
+
/** Replaces path and reserved characters with `-`; caps at 80 characters, keeping the extension. */
|
|
27
|
+
export declare function safeFileName(fileName: string): string;
|
|
28
|
+
/** Saves `blob` as `safeFileName(fileName)`, then revokes its object URL. */
|
|
29
|
+
export declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCsv = toCsv;
|
|
4
|
+
exports.safeFileName = safeFileName;
|
|
5
|
+
exports.downloadBlob = downloadBlob;
|
|
6
|
+
const NEEDS_QUOTES = /[",\r\n]/;
|
|
7
|
+
const FORMULA_TRIGGER = /^[=+\-@\t\r]/;
|
|
8
|
+
const PLAIN_NUMBER = /^[+-]?(?:\d[\d,]*(?:\.\d*)?|\.\d+)%?$/;
|
|
9
|
+
const BOM = "";
|
|
10
|
+
const RESERVED_FILE_CHARS = /[\\/:*?"<>|\p{Cc}]/gu;
|
|
11
|
+
const MAX_FILE_NAME = 80;
|
|
12
|
+
const REVOKE_DELAY_MS = 1000;
|
|
13
|
+
const quote = (text) => (NEEDS_QUOTES.test(text) ? `"${text.replace(/"/g, '""')}"` : text);
|
|
14
|
+
const looksLikeFormula = (text) => FORMULA_TRIGGER.test(text) && !PLAIN_NUMBER.test(text);
|
|
15
|
+
function cellText(value, escapeFormulas) {
|
|
16
|
+
if (value === null || value === undefined)
|
|
17
|
+
return "";
|
|
18
|
+
if (typeof value === "number")
|
|
19
|
+
return Number.isFinite(value) ? String(value) : "";
|
|
20
|
+
const text = String(value);
|
|
21
|
+
if (typeof value !== "string" || !escapeFormulas)
|
|
22
|
+
return text;
|
|
23
|
+
return looksLikeFormula(text) ? `'${text}` : text;
|
|
24
|
+
}
|
|
25
|
+
function readCell(row, column) {
|
|
26
|
+
const field = row[column.key];
|
|
27
|
+
const format = column.format;
|
|
28
|
+
return format === undefined ? field : format(field, row);
|
|
29
|
+
}
|
|
30
|
+
/** RFC 4180 CSV: header line, then one CRLF-separated line per row. */
|
|
31
|
+
function toCsv(rows, columns, { bom = false } = {}) {
|
|
32
|
+
if (columns.length === 0)
|
|
33
|
+
return "";
|
|
34
|
+
const lines = [columns.map((column) => quote(column.header)).join(",")];
|
|
35
|
+
for (const row of rows) {
|
|
36
|
+
lines.push(columns.map((column) => quote(cellText(readCell(row, column), column.escapeFormulas !== false))).join(","));
|
|
37
|
+
}
|
|
38
|
+
return (bom ? BOM : "") + lines.join("\r\n");
|
|
39
|
+
}
|
|
40
|
+
/** Replaces path and reserved characters with `-`; caps at 80 characters, keeping the extension. */
|
|
41
|
+
function safeFileName(fileName) {
|
|
42
|
+
const cleaned = fileName.replace(RESERVED_FILE_CHARS, "-").trim().replace(/^[.\s]+/, "");
|
|
43
|
+
if (cleaned === "")
|
|
44
|
+
return "export";
|
|
45
|
+
if (cleaned.length <= MAX_FILE_NAME)
|
|
46
|
+
return cleaned;
|
|
47
|
+
const dot = cleaned.lastIndexOf(".");
|
|
48
|
+
const extension = dot > 0 && cleaned.length - dot <= 8 ? cleaned.slice(dot) : "";
|
|
49
|
+
return cleaned.slice(0, MAX_FILE_NAME - extension.length).replace(/[\uD800-\uDBFF]$/, "") + extension;
|
|
50
|
+
}
|
|
51
|
+
/** Saves `blob` as `safeFileName(fileName)`, then revokes its object URL. */
|
|
52
|
+
function downloadBlob(blob, fileName) {
|
|
53
|
+
const url = URL.createObjectURL(blob);
|
|
54
|
+
const link = document.createElement("a");
|
|
55
|
+
link.href = url;
|
|
56
|
+
link.download = safeFileName(fileName);
|
|
57
|
+
document.body.appendChild(link);
|
|
58
|
+
link.click();
|
|
59
|
+
link.remove();
|
|
60
|
+
setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY_MS);
|
|
61
|
+
}
|
|
@@ -7,6 +7,7 @@ import { isDarkCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
|
7
7
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
8
8
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
9
9
|
import { accordionFocusRing, getAccordionHoverColors } from "./accordionColors.js";
|
|
10
|
+
const HEADER_ACTION_RIGHT = "3.25rem";
|
|
10
11
|
/** Chakra Accordion wrapper for header/content pairs; FilterSidebar composes this directly for its collapsible filter sections. */
|
|
11
12
|
const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
|
|
12
13
|
const { colors } = useCustomTheme();
|
|
@@ -19,14 +20,16 @@ const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion,
|
|
|
19
20
|
return (_jsx(ChakraAccordian, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
|
|
20
21
|
var _a;
|
|
21
22
|
return (_jsx(AccordionItem, { border: "1px solid", borderColor: border, borderRadius: "xl", bg: colors.background[50], boxShadow: "none", mb: 3, overflow: "hidden", _last: { mb: 0 }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
|
|
22
|
-
var _a, _b, _c;
|
|
23
|
-
return (_jsxs(_Fragment, { children: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...(_b = item.customStyles) === null || _b === void 0 ? void 0 : _b.
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
var _a, _b, _c, _d, _e;
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { as: "h2", position: item.headerAction ? "relative" : undefined, sx: item.headerAction
|
|
25
|
+
? { "&:hover > button": { background: isExpanded ? expandedBg : softHover, ...(_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.hoverbuttonStyle } }
|
|
26
|
+
: undefined, children: [_jsxs(AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "sm", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: transitionFor(["background-color"]), _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: focusRing, ...item.buttonProps, sx: {
|
|
27
|
+
...reducedMotionSx(),
|
|
28
|
+
...(_b = item.customStyles) === null || _b === void 0 ? void 0 : _b.buttonStyle,
|
|
29
|
+
"&:hover": {
|
|
30
|
+
...(_c = item.customStyles) === null || _c === void 0 ? void 0 : _c.hoverbuttonStyle,
|
|
31
|
+
},
|
|
32
|
+
}, children: [_jsx(Box, { as: "span", flex: "1", textAlign: "left", children: item.header }), _jsx(Flex, { align: "center", justify: "center", boxSize: "1.5rem", flexShrink: 0, borderRadius: "lg", color: isExpanded ? colors.accentText : colors.textMuted, bg: isExpanded ? colors.primary.opacity[16] : "transparent", transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)", transition: transitionFor(["transform", "color", "background-color"], "base"), sx: reducedMotionSx(), children: _jsx(ChevronDown, { size: 16 }) })] }), item.headerAction && (_jsx(Flex, { position: "absolute", top: "50%", right: HEADER_ACTION_RIGHT, transform: "translateY(-50%)", align: "center", sx: (_d = item.customStyles) === null || _d === void 0 ? void 0 : _d.headerActionStyle, children: item.headerAction }))] }), _jsx(AccordionPanel, { px: 4, pt: 1, pb: 4, fontSize: "sm", lineHeight: "1.5", color: bodyColor, ...item.panelProps, sx: (_e = item.customStyles) === null || _e === void 0 ? void 0 : _e.panelStyle, children: item.content })] }));
|
|
30
33
|
} }, idx));
|
|
31
34
|
}) }));
|
|
32
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compositeOver } from "../../Theme/tokens/builders/color.js";
|
|
2
2
|
import { liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
3
|
-
import {
|
|
3
|
+
import { insetFocusRingShadow } from "../../Theme/chakra/focusRing.styles.js";
|
|
4
4
|
// NOTE: light softHover measured 1.04-1.11 (invisible) unresolved — both modes now resolve against the rest surface.
|
|
5
5
|
const MIN_HOVER_STEP = 1.15;
|
|
6
6
|
export const getAccordionHoverColors = (colors, isDark) => {
|
|
@@ -21,6 +21,5 @@ export const getAccordionHoverColors = (colors, isDark) => {
|
|
|
21
21
|
export const accordionFocusRing = (colors) => ({
|
|
22
22
|
outline: "2px solid transparent",
|
|
23
23
|
outlineOffset: "-2px",
|
|
24
|
-
boxShadow:
|
|
25
|
-
`inset 0 0 0 ${FOCUS_RING_WIDTH}px ${colors.focusRing.halo}`,
|
|
24
|
+
boxShadow: insetFocusRingShadow(colors),
|
|
26
25
|
});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Suspense, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useTheme } from "@chakra-ui/react";
|
|
4
4
|
import ToolTip from "../../ToolTip/ToolTip.js";
|
|
5
|
-
import { getDefaultSeriesColors, mergeChartTitleStyle, } from "../../../Theme/tokens/builders/chartColorsFromTheme.js";
|
|
5
|
+
import { chartMode, getDefaultSeriesColors, mergeChartTitleStyle, } from "../../../Theme/tokens/builders/chartColorsFromTheme.js";
|
|
6
6
|
import { baseAxisLabels, baseChart, baseGrid, baseTooltip } from "../chartBase.js";
|
|
7
7
|
import LazyReactApexChart from "../LazyReactApexChart.js";
|
|
8
8
|
import ApexChartFallback from "../ApexChartFallback.js";
|
|
@@ -92,6 +92,7 @@ const ApexLineChart = ({ data, labels, title, height, width, lineColors, titlePo
|
|
|
92
92
|
zoom: { enabled: !isSmall },
|
|
93
93
|
toolbar: { show: showToolbar },
|
|
94
94
|
}),
|
|
95
|
+
theme: { mode: chartMode(palette) },
|
|
95
96
|
stroke: { curve: "smooth", width: 2, lineCap: "round" },
|
|
96
97
|
colors: resolvedLineColors,
|
|
97
98
|
xaxis: {
|
|
@@ -5,6 +5,7 @@ import { chartInk, chartMode, getDefaultSeriesColors, labelOnSeries, mergeChartT
|
|
|
5
5
|
import { baseChart, baseLegend, baseTooltip } from "../chartBase.js";
|
|
6
6
|
import LazyReactApexChart from "../LazyReactApexChart.js";
|
|
7
7
|
import ApexChartFallback from "../ApexChartFallback.js";
|
|
8
|
+
import { pieImageTexture } from "./pieImageTexture.js";
|
|
8
9
|
const getValidLegendPosition = (position) => {
|
|
9
10
|
const validPositions = ["left", "right", "top", "bottom"];
|
|
10
11
|
if (validPositions.includes(position)) {
|
|
@@ -14,7 +15,7 @@ const getValidLegendPosition = (position) => {
|
|
|
14
15
|
return "bottom";
|
|
15
16
|
};
|
|
16
17
|
/** Pie/donut chart wrapper around react-apexcharts, themed via chartColorsFromTheme + chartBase. */
|
|
17
|
-
const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutColors, chartColor, titlePosition = "center", titleStyle, legendPosition = "bottom", legendStyle, variant = "pie", showDataLabels = true, minLabelPercent = 8, surfaceColor, donutSize = "68%", totalLabel = "Total", labelPlacement = "auto", }) => {
|
|
18
|
+
const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutColors, chartColor, titlePosition = "center", titleStyle, legendPosition = "bottom", legendStyle, variant = "pie", showDataLabels = true, minLabelPercent = 8, surfaceColor, donutSize = "68%", totalLabel = "Total", labelPlacement = "auto", images, }) => {
|
|
18
19
|
var _a;
|
|
19
20
|
const { colors: palette } = useCustomTheme();
|
|
20
21
|
const ink = chartInk(palette);
|
|
@@ -31,6 +32,7 @@ const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutCol
|
|
|
31
32
|
? "outside"
|
|
32
33
|
: "none"
|
|
33
34
|
: labelPlacement;
|
|
35
|
+
const sliceCount = data.length;
|
|
34
36
|
const labelsOn = showDataLabels && placement !== "none";
|
|
35
37
|
const outside = placement === "outside";
|
|
36
38
|
const validLegendPosition = getValidLegendPosition(legendPosition);
|
|
@@ -87,10 +89,7 @@ const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutCol
|
|
|
87
89
|
fill: {
|
|
88
90
|
type: "image",
|
|
89
91
|
image: {
|
|
90
|
-
src: [
|
|
91
|
-
"https://i.imgur.com/UM3mrju.jpg",
|
|
92
|
-
"https://i.imgur.com/NpPOqQq.jpg",
|
|
93
|
-
],
|
|
92
|
+
src: images !== null && images !== void 0 ? images : Array.from({ length: sliceCount }, (_, i) => pieImageTexture(seriesColors[i % seriesColors.length], gap)),
|
|
94
93
|
},
|
|
95
94
|
},
|
|
96
95
|
};
|
|
@@ -180,6 +179,8 @@ const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutCol
|
|
|
180
179
|
totalLabel,
|
|
181
180
|
ink.muted,
|
|
182
181
|
ink.text,
|
|
182
|
+
images,
|
|
183
|
+
sliceCount,
|
|
183
184
|
]);
|
|
184
185
|
return (_jsx("div", { children: _jsx(Suspense, { fallback: _jsx(ApexChartFallback, { height: height, width: width }), children: _jsx(LazyReactApexChart, { options: options, series: data, type: (_a = options.chart) === null || _a === void 0 ? void 0 : _a.type, height: height, width: width }) }) }));
|
|
185
186
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const SIZE = 400;
|
|
2
|
+
/** A diagonal-stripe SVG data URI: `color` ground with translucent `stripe` bands, no network. */
|
|
3
|
+
export function pieImageTexture(color, stripe) {
|
|
4
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${SIZE}" height="${SIZE}" viewBox="0 0 ${SIZE} ${SIZE}">` +
|
|
5
|
+
`<defs><pattern id="s" width="24" height="24" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">` +
|
|
6
|
+
`<rect width="10" height="24" fill="${stripe}" fill-opacity="0.28"/></pattern></defs>` +
|
|
7
|
+
`<rect width="${SIZE}" height="${SIZE}" fill="${color}"/>` +
|
|
8
|
+
`<rect width="${SIZE}" height="${SIZE}" fill="url(#s)"/></svg>`;
|
|
9
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|
|
10
|
+
}
|
|
@@ -12,6 +12,9 @@ import Kbd from "../Kbd/Kbd.js";
|
|
|
12
12
|
import AppMark, { assignAppHues } from "./AppMark.js";
|
|
13
13
|
import { filterApps, formatShortcut, } from "./AppSwitcherProps.js";
|
|
14
14
|
import { useAppSwitcherShortcut } from "./useAppSwitcherShortcut.js";
|
|
15
|
+
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
16
|
+
const BACKGROUND_BORDER_COLOR_TRANSITION = transitionFor(["background", "border-color"]);
|
|
17
|
+
const BACKGROUND_TRANSITION = transitionFor(["background"]);
|
|
15
18
|
const COLUMNS = 2;
|
|
16
19
|
const HEADING = "Your apps";
|
|
17
20
|
const s = { trigger: "36px", mark: "32px", icon: 17, name: "0.875rem", sub: "0.75rem", row: "52px" };
|
|
@@ -182,7 +185,7 @@ const AppSwitcher = ({ apps, currentAppId, onSelect, onOpenChange, isSearchable,
|
|
|
182
185
|
const currentSub = liftToContrast(theme.colors.textMuted, currentBg, AA_NORMAL_TEXT);
|
|
183
186
|
const width = panelWidth !== null && panelWidth !== void 0 ? panelWidth : "28rem";
|
|
184
187
|
const hint = shortcut && showShortcutHint ? formatShortcut(shortcut) : null;
|
|
185
|
-
return (_jsxs(Popover, { isOpen: isOpen, onOpen: () => setOpen(true), onClose: () => { setOpen(false); setQuery(""); }, placement: "bottom-end", initialFocusRef: showSearch ? searchRef : undefined, isLazy: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { ref: triggerRef, as: "button", type: "button", "aria-label": ariaLabel, align: "center", justify: "center", boxSize: s.trigger, borderRadius: "lg", border: "1px solid", borderColor: isOpen ? theme.colors.boxborder[500] : theme.colors.boxborder[200], bg: isOpen ? theme.colors.backgroundColor.tertiary : "transparent", color: isOpen ? theme.colors.text[900] : theme.colors.textMuted, cursor: "pointer", transition:
|
|
188
|
+
return (_jsxs(Popover, { isOpen: isOpen, onOpen: () => setOpen(true), onClose: () => { setOpen(false); setQuery(""); }, placement: "bottom-end", initialFocusRef: showSearch ? searchRef : undefined, isLazy: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { ref: triggerRef, as: "button", type: "button", "aria-label": ariaLabel, align: "center", justify: "center", boxSize: s.trigger, borderRadius: "lg", border: "1px solid", borderColor: isOpen ? theme.colors.boxborder[500] : theme.colors.boxborder[200], bg: isOpen ? theme.colors.backgroundColor.tertiary : "transparent", color: isOpen ? theme.colors.text[900] : theme.colors.textMuted, cursor: "pointer", transition: BACKGROUND_BORDER_COLOR_TRANSITION, _hover: { bg: rowHoverBg, color: theme.colors.text[900] }, onKeyDown: (e) => {
|
|
186
189
|
if (!isOpen) {
|
|
187
190
|
if (e.key === "ArrowDown") {
|
|
188
191
|
e.preventDefault();
|
|
@@ -191,7 +194,7 @@ const AppSwitcher = ({ apps, currentAppId, onSelect, onOpenChange, isSearchable,
|
|
|
191
194
|
return;
|
|
192
195
|
}
|
|
193
196
|
handlePanelKeyDown(e);
|
|
194
|
-
}, children: _jsx(Grip, { size: s.icon + 1 }) }) }), _jsx(PopoverContent, { w: width, maxW: "calc(100vw - 1.5rem)", textAlign: "start", onKeyDown: handlePanelKeyDown, bg: theme.colors.surfaceRaised, borderRadius: "xl", overflow: "hidden", boxShadow:
|
|
197
|
+
}, children: _jsx(Grip, { size: s.icon + 1 }) }) }), _jsx(PopoverContent, { w: width, maxW: "calc(100vw - 1.5rem)", textAlign: "start", onKeyDown: handlePanelKeyDown, bg: theme.colors.surfaceRaised, borderRadius: "xl", overflow: "hidden", boxShadow: "float", _focus: { outline: "none", boxShadow: "float" }, children: _jsxs(PopoverBody, { p: 0, children: [_jsxs(Flex, { align: "center", gap: 2, px: 3, pt: 3, pb: showSearch ? 2 : 1, children: [_jsx(Text, { fontSize: "xs-minus", fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: theme.colors.textMuted, children: HEADING }), _jsx(Box, { flex: "1" }), hint && _jsx(Kbd, { size: "xs", children: hint })] }), showSearch && (_jsx(Box, { px: 3, pb: 2, children: _jsxs(InputGroup, { size: "sm", children: [_jsx(InputLeftElement, { pointerEvents: "none", children: _jsx(Search, { size: 15, color: theme.colors.textMuted }) }), _jsx(Input, { ref: searchRef, value: query, onChange: (e) => setQuery(e.target.value), placeholder: "Search apps", borderRadius: "lg", "aria-label": "Search apps", onKeyDown: (e) => {
|
|
195
198
|
if (e.key === "ArrowDown" && visible.length > 0) {
|
|
196
199
|
e.preventDefault();
|
|
197
200
|
focusItem(0);
|
|
@@ -229,7 +232,7 @@ const AppSwitcher = ({ apps, currentAppId, onSelect, onOpenChange, isSearchable,
|
|
|
229
232
|
borderEndStartRadius: "lg",
|
|
230
233
|
bg: currentBar,
|
|
231
234
|
}
|
|
232
|
-
: undefined, transition:
|
|
235
|
+
: undefined, transition: BACKGROUND_TRANSITION, _hover: interactive ? { bg: rowHoverBg } : undefined, onClick: (e) => handleSelect(app, e), onKeyDown: (e) => handleItemKeyDown(e, app), children: [_jsx(AppMark, { app: app, hue: hues[apps.indexOf(app)], boxSize: s.mark, iconSize: s.icon, muted: app.locked }), _jsxs(Box, { flex: "1", minW: 0, children: [_jsxs(Flex, { align: "center", gap: 1.5, children: [_jsx(Text, { fontSize: s.name, fontWeight: 600, color: app.locked
|
|
233
236
|
? theme.colors.textMuted
|
|
234
237
|
: isCurrent
|
|
235
238
|
? currentName
|
|
@@ -50,30 +50,37 @@ export const shortcutKeys = (shortcut, isApple = isAppleNow()) => {
|
|
|
50
50
|
return parts.map((p, i) => { var _a; return (i === parts.length - 1 ? p.toUpperCase() : ((_a = table[p]) !== null && _a !== void 0 ? _a : p.toUpperCase())); });
|
|
51
51
|
};
|
|
52
52
|
export const formatShortcut = (shortcut, isApple = isAppleNow()) => shortcutKeys(shortcut, isApple).join(isApple ? "" : "+");
|
|
53
|
-
|
|
54
|
-
* Derives every app's origin from the host the consumer is already served on, so one deployment
|
|
55
|
-
* variable keeps dev, test and prod in step. An app may still carry its own `url`, which wins.
|
|
56
|
-
*/
|
|
57
|
-
export const buildSuiteApps = (apps, { baseUrl, baseSubdomain }) => {
|
|
58
|
-
let base;
|
|
53
|
+
const parseAbsolute = (option, raw) => {
|
|
59
54
|
try {
|
|
60
|
-
|
|
55
|
+
return new URL(raw.trim());
|
|
61
56
|
}
|
|
62
57
|
catch {
|
|
63
|
-
throw new Error(`[AppSwitcher] buildSuiteApps:
|
|
58
|
+
throw new Error(`[AppSwitcher] buildSuiteApps: ${option} ${JSON.stringify(raw)} is not an absolute URL.`);
|
|
64
59
|
}
|
|
65
|
-
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Derives every app's origin from the host the consumer is already served on, so one deployment
|
|
63
|
+
* variable keeps dev, test and prod in step. An app may still carry its own `url`, which wins.
|
|
64
|
+
*/
|
|
65
|
+
export const buildSuiteApps = (apps, { baseUrl, baseSubdomain, devFallbackBaseUrl }) => {
|
|
66
|
+
const base = parseAbsolute("baseUrl", baseUrl);
|
|
67
|
+
const hostHasLabel = base.hostname.split(".").includes(baseSubdomain);
|
|
68
|
+
const useFallback = !hostHasLabel && devFallbackBaseUrl !== undefined;
|
|
69
|
+
const source = useFallback ? parseAbsolute("devFallbackBaseUrl", devFallbackBaseUrl) : base;
|
|
70
|
+
const labels = source.hostname.split(".");
|
|
66
71
|
const at = labels.indexOf(baseSubdomain);
|
|
67
72
|
return apps.map(({ subdomain, url, ...app }) => {
|
|
68
73
|
if (url)
|
|
69
74
|
return { ...app, url: url.trim() };
|
|
75
|
+
if (useFallback && subdomain === baseSubdomain)
|
|
76
|
+
return { ...app, url: base.origin };
|
|
70
77
|
// Without the label there is nothing to swap, and every app would silently share one origin.
|
|
71
78
|
if (at === -1) {
|
|
72
79
|
throw new Error(`[AppSwitcher] buildSuiteApps: ${JSON.stringify(baseSubdomain)} is not a label in ` +
|
|
73
|
-
`"${
|
|
80
|
+
`"${source.hostname}", so ${JSON.stringify(app.name)} has no derivable url. ` +
|
|
74
81
|
`Give that app an explicit url, or pass a baseUrl that contains the label.`);
|
|
75
82
|
}
|
|
76
|
-
const next = new URL(
|
|
83
|
+
const next = new URL(source.toString());
|
|
77
84
|
next.hostname = labels.map((l, i) => (i === at ? subdomain : l)).join(".");
|
|
78
85
|
return { ...app, url: next.origin };
|
|
79
86
|
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Building2, Headphones, LayoutGrid, Megaphone, Receipt, Users } from "lucide-react";
|
|
2
|
+
import { buildSuiteApps } from "./AppSwitcherProps.js";
|
|
3
|
+
/** The default Pixelize app list; `resolveSuiteApps` `overrides` change a single app without forking it. */
|
|
4
|
+
export const PIXELIZE_SUITE = [
|
|
5
|
+
{
|
|
6
|
+
id: "crm",
|
|
7
|
+
subdomain: "crm",
|
|
8
|
+
name: "CRM",
|
|
9
|
+
description: "Leads, deals and pipeline",
|
|
10
|
+
icon: LayoutGrid,
|
|
11
|
+
keywords: ["leads", "deals", "pipeline", "contacts", "sales"],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "account",
|
|
15
|
+
subdomain: "account",
|
|
16
|
+
name: "Account",
|
|
17
|
+
description: "Organization and members",
|
|
18
|
+
icon: Building2,
|
|
19
|
+
keywords: ["organization", "members", "roles", "settings", "profile"],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "tickets",
|
|
23
|
+
subdomain: "tickets",
|
|
24
|
+
name: "Tickets",
|
|
25
|
+
description: "Support requests and queues",
|
|
26
|
+
icon: Headphones,
|
|
27
|
+
keywords: ["support", "helpdesk", "issues", "sla"],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "billing",
|
|
31
|
+
subdomain: "billing",
|
|
32
|
+
name: "Billing",
|
|
33
|
+
description: "Invoices and plans",
|
|
34
|
+
icon: Receipt,
|
|
35
|
+
keywords: ["invoices", "plans", "payments", "subscription"],
|
|
36
|
+
preRelease: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "hrms",
|
|
40
|
+
subdomain: "hrms",
|
|
41
|
+
name: "HRMS",
|
|
42
|
+
description: "People, leave and payroll",
|
|
43
|
+
icon: Users,
|
|
44
|
+
keywords: ["people", "employees", "leave", "attendance", "payroll"],
|
|
45
|
+
preRelease: true,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "social",
|
|
49
|
+
subdomain: "social",
|
|
50
|
+
name: "Social",
|
|
51
|
+
description: "Campaigns and inbox",
|
|
52
|
+
icon: Megaphone,
|
|
53
|
+
keywords: ["campaigns", "posts", "inbox", "marketing"],
|
|
54
|
+
preRelease: true,
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
/** The catalogue as a ready `AppSwitcher` list: pre-release filtering, per-app `urls` and `overrides`, then `buildSuiteApps`. */
|
|
58
|
+
export const resolveSuiteApps = ({ currentAppId, isProduction, urls, overrides, ...urlOptions }) => {
|
|
59
|
+
const sources = PIXELIZE_SUITE.flatMap((entry) => {
|
|
60
|
+
const { preRelease, ...app } = { ...entry, ...overrides === null || overrides === void 0 ? void 0 : overrides[entry.id] };
|
|
61
|
+
if (isProduction && preRelease && app.id !== currentAppId)
|
|
62
|
+
return [];
|
|
63
|
+
const url = urls === null || urls === void 0 ? void 0 : urls[app.id];
|
|
64
|
+
return [url ? { ...app, url } : app];
|
|
65
|
+
});
|
|
66
|
+
return buildSuiteApps(sources, urlOptions);
|
|
67
|
+
};
|