pixelize-design-library 2.4.2-beta.64 → 2.4.2-beta.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +520 -21
- package/COMPONENT-GOTCHAS.md +187 -95
- package/DESIGN-GUIDE.md +54 -10
- package/README.md +37 -3
- package/dist/Components/Accordion/Accordion.js +11 -8
- package/dist/Components/Accordion/AccordionProps.d.ts +4 -0
- package/dist/Components/Accordion/accordionColors.js +1 -2
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +2 -2
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -1
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +3 -1
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.d.ts +2 -0
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.js +13 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +3 -1
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/Components/AppSwitcher/pixelizeSuite.d.ts +24 -0
- package/dist/Components/AppSwitcher/pixelizeSuite.js +71 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.js +7 -6
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +1 -1
- package/dist/Components/Button/Button.styles.js +5 -2
- package/dist/Components/Button/ButtonProps.d.ts +2 -4
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/Components/CalendarGrid/CalendarGridProps.d.ts +1 -1
- package/dist/Components/Card/Card.d.ts +1 -0
- package/dist/Components/Card/Card.js +1 -0
- package/dist/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/Components/CheckoutKit/selectable.d.ts +3 -1
- package/dist/Components/CheckoutKit/selectable.js +10 -7
- package/dist/Components/CheckoutKit/tonalHover.d.ts +2 -0
- package/dist/Components/CheckoutKit/tonalHover.js +6 -0
- package/dist/Components/ChoiceCard/ChoiceCard.d.ts +1 -1
- package/dist/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +6 -0
- package/dist/Components/Common/FieldMessage.d.ts +1 -0
- package/dist/Components/Common/FormLabel.d.ts +1 -1
- package/dist/Components/Common/FormLabel.js +4 -3
- package/dist/Components/Common/HelperText.d.ts +2 -2
- package/dist/Components/Common/HelperText.js +1 -2
- package/dist/Components/Common/activationKey.d.ts +5 -0
- package/dist/Components/Common/activationKey.js +12 -0
- package/dist/Components/Common/dataAttributes.d.ts +4 -0
- package/dist/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/Components/Common/findSlot.d.ts +2 -0
- package/dist/Components/Common/findSlot.js +24 -0
- package/dist/Components/Common/surfaceFocusRing.d.ts +1 -0
- package/dist/Components/Common/surfaceFocusRing.js +7 -0
- package/dist/Components/ConfirmDialog/ConfirmDialog.js +17 -5
- package/dist/Components/ConfirmDialog/ConfirmDialogProps.d.ts +38 -10
- package/dist/Components/CopyButton/CopyButton.d.ts +4 -1
- package/dist/Components/CopyButton/CopyButton.js +5 -8
- package/dist/Components/CouponField/CouponField.js +5 -2
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/Components/DatePicker/CalendarPanel.d.ts +1 -0
- package/dist/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/Components/DatePicker/DatePicker.js +24 -26
- package/dist/Components/DatePicker/DatePickerProps.d.ts +8 -0
- package/dist/Components/DatePicker/PickerPortal.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +7 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/Components/DetailSections/DetailSections.js +2 -1
- package/dist/Components/Divider/Divider.d.ts +3 -3
- package/dist/Components/Divider/Divider.js +3 -3
- package/dist/Components/Drawer/Drawer.d.ts +3 -1
- package/dist/Components/Drawer/Drawer.js +28 -26
- package/dist/Components/Drawer/DrawerProps.d.ts +4 -0
- package/dist/Components/Dropdown/DropDown.js +6 -21
- package/dist/Components/Editor/Editor.js +6 -2
- package/dist/Components/Editor/EditorProps.d.ts +17 -1
- package/dist/Components/Editor/editorLabels.js +1 -0
- package/dist/Components/Editor/editorTokenStyles.d.ts +8 -0
- package/dist/Components/Editor/editorTokenStyles.js +9 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +9 -2
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +15 -1
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +21 -0
- package/dist/Components/EmptyState/FilteredEmptyState.d.ts +5 -0
- package/dist/Components/EmptyState/FilteredEmptyState.js +23 -0
- package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +1 -0
- package/dist/Components/FilePreview/FilePreview.js +7 -3
- package/dist/Components/FilePreview/FilePreviewProps.d.ts +2 -1
- package/dist/Components/FileUpload/FileUpload.js +8 -9
- package/dist/Components/FileUpload/FileUploadProps.d.ts +2 -2
- package/dist/Components/FileUploader/FileUploader.js +5 -6
- package/dist/Components/FilterSidebar/FilterSidebar.d.ts +7 -9
- package/dist/Components/FilterSidebar/FilterSidebar.js +90 -233
- package/dist/Components/FilterSidebar/OptionsSection.d.ts +14 -0
- package/dist/Components/FilterSidebar/OptionsSection.js +46 -0
- package/dist/Components/FilterSidebar/RangeSection.d.ts +17 -0
- package/dist/Components/FilterSidebar/RangeSection.js +80 -0
- package/dist/Components/FilterSidebar/SectionHeader.d.ts +13 -0
- package/dist/Components/FilterSidebar/SectionHeader.js +29 -0
- package/dist/Components/FilterSidebar/useStableCallback.d.ts +1 -0
- package/dist/Components/FilterSidebar/useStableCallback.js +12 -0
- package/dist/Components/Form/FormWrapper.d.ts +7 -7
- package/dist/Components/Form/FormWrapper.js +5 -3
- package/dist/Components/FormDrawer/FormDrawer.d.ts +1 -1
- package/dist/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/Components/FormDrawer/FormDrawerProps.d.ts +2 -0
- package/dist/Components/FormField/FormField.js +1 -1
- package/dist/Components/Header/Header.js +1 -1
- package/dist/Components/Header/HeaderActions.js +4 -2
- package/dist/Components/IconButton/IconButtonProps.d.ts +2 -1
- package/dist/Components/Input/TextInput.js +2 -2
- package/dist/Components/Input/TextInputProps.d.ts +3 -1
- package/dist/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/Components/LazyWrapper/LazyWrapper.d.ts +2 -1
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/MediaViewer/MediaViewer.js +4 -3
- package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/Components/MediaViewer/hooks/useFileViewer.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.js +5 -0
- package/dist/Components/Modal/Modal.d.ts +1 -0
- package/dist/Components/Modal/Modal.js +7 -25
- package/dist/Components/Modal/dialogNaming.d.ts +8 -0
- package/dist/Components/Modal/dialogNaming.js +21 -0
- package/dist/Components/Modal/warnDroppedSlotChildren.d.ts +1 -1
- package/dist/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
- package/dist/Components/NavLauncher/NavLauncher.js +288 -56
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +83 -5
- package/dist/Components/NavLauncher/ScopeBar.d.ts +14 -0
- package/dist/Components/NavLauncher/ScopeBar.js +139 -0
- package/dist/Components/NavLauncher/engine/distance.d.ts +4 -0
- package/dist/Components/NavLauncher/engine/distance.js +41 -0
- package/dist/Components/NavLauncher/engine/engine.d.ts +84 -0
- package/dist/Components/NavLauncher/engine/engine.js +472 -0
- package/dist/Components/NavLauncher/engine/fold.d.ts +15 -0
- package/dist/Components/NavLauncher/engine/fold.js +84 -0
- package/dist/Components/NavLauncher/engine/index.d.ts +21 -0
- package/dist/Components/NavLauncher/engine/index.js +17 -0
- package/dist/Components/NavLauncher/launcherParts.d.ts +14 -0
- package/dist/Components/NavLauncher/launcherParts.js +51 -13
- package/dist/Components/NavLauncher/match.d.ts +13 -2
- package/dist/Components/NavLauncher/match.js +26 -12
- package/dist/Components/NavLauncher/searchLayout.d.ts +61 -0
- package/dist/Components/NavLauncher/searchLayout.js +110 -0
- package/dist/Components/NavLauncher/spotlight.d.ts +39 -0
- package/dist/Components/NavLauncher/spotlight.js +202 -0
- package/dist/Components/NavLauncher/spotlightParts.d.ts +53 -0
- package/dist/Components/NavLauncher/spotlightParts.js +121 -0
- package/dist/Components/NavLauncher/useCopiedFlash.d.ts +6 -0
- package/dist/Components/NavLauncher/useCopiedFlash.js +21 -0
- package/dist/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +5 -3
- package/dist/Components/Notification/Notification.js +19 -21
- package/dist/Components/Notification/NotificationProps.d.ts +1 -1
- package/dist/Components/NotificationBell/notificationHelpers.d.ts +16 -1
- package/dist/Components/NotificationBell/notificationHelpers.js +13 -7
- package/dist/Components/OffersList/OffersList.js +4 -2
- package/dist/Components/OptionChip/OptionChip.js +3 -2
- package/dist/Components/OptionChip/optionInk.js +4 -2
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +13 -6
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +1 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -7
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +4 -2
- package/dist/Components/PdfViewer/PdfViewer.d.ts +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +1 -1
- package/dist/Components/PlanPill/PlanPill.js +4 -2
- package/dist/Components/PlanPill/PlanPillProps.d.ts +1 -1
- package/dist/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/Components/ProfileCard/ProfileCard.d.ts +1 -0
- package/dist/Components/ProfileCard/ProfileCard.js +12 -26
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/Components/QueryState/QueryStateBoundary.d.ts +1 -1
- package/dist/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/Components/QueryState/QueryStateProps.d.ts +6 -2
- package/dist/Components/RadioButton/RadioButton.js +2 -3
- package/dist/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts +1 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +4 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +10 -4
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +3 -3
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/Components/Select/Select.js +6 -0
- package/dist/Components/Select/SelectNative.d.ts +16 -0
- package/dist/Components/Select/SelectPopup.js +170 -63
- package/dist/Components/Select/SelectProps.d.ts +30 -2
- package/dist/Components/Select/groupedWindow.d.ts +21 -0
- package/dist/Components/Select/groupedWindow.js +50 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +48 -38
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +3 -3
- package/dist/Components/SelectV2/SelectV2.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2.js +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +3 -3
- package/dist/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/Components/SideBar/sidebarScale.d.ts +2 -2
- package/dist/Components/SideBar/sidebarScale.js +2 -2
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +7 -2
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +1 -1
- package/dist/Components/SignInActivityTable/scrollRegionRing.d.ts +10 -0
- package/dist/Components/SignInActivityTable/scrollRegionRing.js +14 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -1
- package/dist/Components/Slider/Slider.d.ts +2 -0
- package/dist/Components/Slider/Slider.js +5 -4
- package/dist/Components/StageProgress/StageItem.js +2 -1
- package/dist/Components/StageProgress/StageProgress.js +8 -2
- package/dist/Components/StageProgress/StageProgressProps.d.ts +2 -0
- package/dist/Components/StageProgress/StepperStage.js +2 -1
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/Components/Table/Table.js +5 -3
- package/dist/Components/Table/components/HeaderActions.js +5 -3
- package/dist/Components/Table/components/TableBody.js +13 -8
- package/dist/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/Components/Table/components/TableHeader.js +17 -21
- package/dist/Components/Table/components/TableLoading.js +8 -2
- package/dist/Components/Table/components/rowDetail.js +3 -2
- package/dist/Components/Table/filters/ActiveFilters.js +6 -3
- package/dist/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/Components/Table/filters/FilterDatePicker.d.ts +6 -0
- package/dist/Components/Table/filters/FilterDatePicker.js +61 -0
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +1 -0
- package/dist/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/Components/Table/hooks/useTable.js +11 -7
- package/dist/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/Components/Table/settings/TableSettings.js +4 -4
- package/dist/Components/Tabs/Tabs.d.ts +1 -0
- package/dist/Components/Tabs/Tabs.js +1 -0
- package/dist/Components/Tabs/components/CountBadge.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.js +1 -0
- package/dist/Components/Tabs/components/TabPanel.d.ts +1 -0
- package/dist/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/Components/Tabs/tabStyles.js +4 -2
- package/dist/Components/Tag/Tag.js +5 -4
- package/dist/Components/Tag/Tag.styles.js +5 -4
- package/dist/Components/Tag/TagProps.d.ts +4 -1
- package/dist/Components/Tag/tagDot.js +10 -3
- package/dist/Components/TagInput/TagInput.js +6 -5
- package/dist/Components/TagInput/TagInputProps.d.ts +15 -0
- package/dist/Components/TagInput/tagEntries.d.ts +7 -1
- package/dist/Components/TagInput/tagEntries.js +18 -5
- package/dist/Components/TimePicker/TimePicker.js +7 -3
- package/dist/Components/TimePicker/TimePickerProps.d.ts +2 -0
- package/dist/Components/Timeline/Timeline.js +13 -9
- package/dist/Components/Toaster/Toaster.js +2 -1
- package/dist/Components/Toggle/TableToggle.d.ts +1 -1
- package/dist/Components/Toggle/TableToggle.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +1 -1
- package/dist/Components/UserDetails/UserDetails.js +5 -7
- package/dist/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/Components/WizardDialog/WizardDialog.d.ts +1 -1
- package/dist/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +5 -3
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +11 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +6 -3
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +16 -15
- package/dist/Hooks/useOutsideMouseDown.d.ts +11 -0
- package/dist/Hooks/useOutsideMouseDown.js +30 -0
- package/dist/Hooks/usePreferences.js +30 -12
- package/dist/Hooks/useScrollableRegion.d.ts +17 -0
- package/dist/Hooks/useScrollableRegion.js +36 -0
- package/dist/Hooks/useSidebarPrefs.d.ts +1 -0
- package/dist/Theme/chakra/Menu.styles.d.ts +4 -0
- package/dist/Theme/chakra/Menu.styles.js +6 -0
- package/dist/Theme/chakra/componentStyles.d.ts +4 -0
- package/dist/Theme/chakra/componentStyles.js +1 -1
- package/dist/Theme/chakra/createBrandTheme.d.ts +1 -0
- package/dist/Theme/chakra/focusRing.styles.d.ts +1 -1
- package/dist/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/Theme/chakra/paletteFromTheme.d.ts +2 -1
- package/dist/Theme/chakra/paletteFromTheme.js +18 -4
- package/dist/Theme/chakra/ringShadow.d.ts +3 -0
- package/dist/Theme/chakra/ringShadow.js +7 -0
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/Theme/testing/testPalette.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/Theme/tokens/builders/paletteScale.d.ts +2 -0
- package/dist/Theme/tokens/builders/paletteScale.js +10 -0
- package/dist/Theme/tokens/types.d.ts +1 -0
- package/dist/Utils/accountHandoff.d.ts +3 -0
- package/dist/Utils/price.d.ts +1 -0
- package/dist/Utils/tabular.d.ts +30 -0
- package/dist/Utils/tabular.js +61 -0
- package/dist/esm/Components/Accordion/Accordion.js +11 -8
- package/dist/esm/Components/Accordion/accordionColors.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +2 -1
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/esm/Components/Apexcharts/ApexPieChart/pieImageTexture.js +10 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/esm/Components/AppSwitcher/pixelizeSuite.js +67 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/esm/Components/Avatar/avatarColorway.js +4 -4
- package/dist/esm/Components/Button/Button.styles.js +5 -2
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/esm/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/esm/Components/Card/Card.js +1 -0
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/esm/Components/CheckoutKit/selectable.js +10 -7
- package/dist/esm/Components/CheckoutKit/tonalHover.js +2 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/esm/Components/Common/FormLabel.js +4 -3
- package/dist/esm/Components/Common/HelperText.js +1 -2
- package/dist/esm/Components/Common/activationKey.js +7 -0
- package/dist/esm/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/esm/Components/Common/findSlot.js +17 -0
- package/dist/esm/Components/Common/surfaceFocusRing.js +3 -0
- package/dist/esm/Components/ConfirmDialog/ConfirmDialog.js +18 -6
- package/dist/esm/Components/CopyButton/CopyButton.js +5 -8
- package/dist/esm/Components/CouponField/CouponField.js +5 -2
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/esm/Components/DatePicker/DatePicker.js +25 -27
- package/dist/esm/Components/DatePicker/PickerPortal.js +2 -2
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/esm/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/esm/Components/DetailSections/DetailSections.js +2 -1
- package/dist/esm/Components/Divider/Divider.js +3 -3
- package/dist/esm/Components/Drawer/Drawer.js +24 -19
- package/dist/esm/Components/Dropdown/DropDown.js +7 -22
- package/dist/esm/Components/Editor/Editor.js +7 -3
- package/dist/esm/Components/Editor/editorLabels.js +1 -0
- package/dist/esm/Components/Editor/editorTokenStyles.js +7 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +8 -4
- package/dist/esm/Components/EmptyState/FilteredEmptyState.js +18 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +8 -4
- package/dist/esm/Components/FileUpload/FileUpload.js +8 -9
- package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +94 -237
- package/dist/esm/Components/FilterSidebar/OptionsSection.js +41 -0
- package/dist/esm/Components/FilterSidebar/RangeSection.js +78 -0
- package/dist/esm/Components/FilterSidebar/SectionHeader.js +23 -0
- package/dist/esm/Components/FilterSidebar/useStableCallback.js +8 -0
- package/dist/esm/Components/Form/FormWrapper.js +5 -3
- package/dist/esm/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/esm/Components/FormField/FormField.js +1 -1
- package/dist/esm/Components/Header/Header.js +1 -1
- package/dist/esm/Components/Header/HeaderActions.js +6 -4
- package/dist/esm/Components/Input/TextInput.js +2 -2
- package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/esm/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/MediaViewer/MediaViewer.js +5 -4
- package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/esm/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/esm/Components/MediaViewer/mediaItems.js +4 -0
- package/dist/esm/Components/Modal/Modal.js +2 -17
- package/dist/esm/Components/Modal/dialogNaming.js +18 -0
- package/dist/esm/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/esm/Components/NavLauncher/NavLauncher.js +291 -59
- package/dist/esm/Components/NavLauncher/ScopeBar.js +136 -0
- package/dist/esm/Components/NavLauncher/engine/distance.js +37 -0
- package/dist/esm/Components/NavLauncher/engine/engine.js +459 -0
- package/dist/esm/Components/NavLauncher/engine/fold.js +75 -0
- package/dist/esm/Components/NavLauncher/engine/index.js +14 -0
- package/dist/esm/Components/NavLauncher/launcherParts.js +46 -10
- package/dist/esm/Components/NavLauncher/match.js +25 -12
- package/dist/esm/Components/NavLauncher/searchLayout.js +101 -0
- package/dist/esm/Components/NavLauncher/spotlight.js +194 -0
- package/dist/esm/Components/NavLauncher/spotlightParts.js +108 -0
- package/dist/esm/Components/NavLauncher/useCopiedFlash.js +17 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/esm/Components/Notification/Notification.js +20 -22
- package/dist/esm/Components/NotificationBell/notificationHelpers.js +12 -6
- package/dist/esm/Components/OffersList/OffersList.js +4 -2
- package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
- package/dist/esm/Components/OptionChip/optionInk.js +4 -2
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -7
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -8
- package/dist/esm/Components/PlanPill/PlanPill.js +4 -2
- package/dist/esm/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/esm/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +6 -17
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/esm/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/esm/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +2 -3
- package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/esm/Components/Select/Select.js +6 -0
- package/dist/esm/Components/Select/SelectPopup.js +171 -64
- package/dist/esm/Components/Select/groupedWindow.js +44 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +49 -39
- package/dist/esm/Components/SelectV2/SelectV2.js +1 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/esm/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -2
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +8 -3
- package/dist/esm/Components/SignInActivityTable/scrollRegionRing.js +9 -0
- package/dist/esm/Components/Slider/Slider.js +6 -5
- package/dist/esm/Components/StageProgress/StageItem.js +2 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +8 -2
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/esm/Components/Table/Table.js +8 -6
- package/dist/esm/Components/Table/components/HeaderActions.js +7 -5
- package/dist/esm/Components/Table/components/TableBody.js +13 -8
- package/dist/esm/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/esm/Components/Table/components/TableHeader.js +19 -23
- package/dist/esm/Components/Table/components/TableLoading.js +6 -3
- package/dist/esm/Components/Table/components/rowDetail.js +3 -2
- package/dist/esm/Components/Table/filters/ActiveFilters.js +8 -5
- package/dist/esm/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/esm/Components/Table/filters/FilterDatePicker.js +20 -0
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/esm/Components/Table/hooks/useTable.js +11 -7
- package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/esm/Components/Table/settings/TableSettings.js +4 -4
- package/dist/esm/Components/Tabs/Tabs.js +1 -0
- package/dist/esm/Components/Tabs/components/TabList.js +1 -0
- package/dist/esm/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/esm/Components/Tabs/tabStyles.js +5 -3
- package/dist/esm/Components/Tag/Tag.js +5 -4
- package/dist/esm/Components/Tag/Tag.styles.js +5 -4
- package/dist/esm/Components/Tag/tagDot.js +10 -3
- package/dist/esm/Components/TagInput/TagInput.js +8 -7
- package/dist/esm/Components/TagInput/tagEntries.js +16 -4
- package/dist/esm/Components/TimePicker/TimePicker.js +7 -3
- package/dist/esm/Components/Timeline/Timeline.js +14 -10
- package/dist/esm/Components/Toaster/Toaster.js +2 -1
- package/dist/esm/Components/Toggle/TableToggle.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/esm/Components/UserDetails/UserDetails.js +5 -7
- package/dist/esm/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/esm/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +12 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +7 -4
- package/dist/esm/Hooks/useOutsideMouseDown.js +26 -0
- package/dist/esm/Hooks/usePreferences.js +30 -12
- package/dist/esm/Hooks/useScrollableRegion.js +33 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +6 -0
- package/dist/esm/Theme/chakra/componentStyles.js +1 -1
- package/dist/esm/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/esm/Theme/chakra/paletteFromTheme.js +16 -3
- package/dist/esm/Theme/chakra/ringShadow.js +3 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/esm/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/esm/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/esm/Theme/tokens/builders/paletteScale.js +6 -0
- package/dist/esm/Utils/tabular.js +56 -0
- package/dist/esm/index.js +18 -25
- package/dist/index.d.ts +59 -5
- package/dist/index.js +36 -29
- package/package.json +3 -1
- package/dist/Components/Buttons/Buttons.d.ts +0 -3
- package/dist/Components/Buttons/Buttons.js +0 -9
- package/dist/Components/Buttons/ButtonsProps.d.ts +0 -12
- package/dist/Components/Common/ErrorComponent.d.ts +0 -7
- package/dist/Components/Common/ErrorComponent.js +0 -16
- package/dist/Components/Common/FormattedDescription.d.ts +0 -7
- package/dist/Components/Common/FormattedDescription.js +0 -62
- package/dist/Components/Common/Label.d.ts +0 -9
- package/dist/Components/Common/Label.js +0 -12
- package/dist/Components/Input/Input/Input.d.ts +0 -4
- package/dist/Components/Input/Input/Input.js +0 -75
- package/dist/Components/Input/Input/InputProps.d.ts +0 -24
- package/dist/Components/Input/Input/InputProps.js +0 -2
- package/dist/Components/ProductCard/productCardFixtures.d.ts +0 -7
- package/dist/Components/ProductCard/productCardFixtures.js +0 -61
- package/dist/esm/Components/Buttons/Buttons.js +0 -4
- package/dist/esm/Components/Common/ErrorComponent.js +0 -14
- package/dist/esm/Components/Common/FormattedDescription.js +0 -60
- package/dist/esm/Components/Common/Label.js +0 -10
- package/dist/esm/Components/Input/Input/Input.js +0 -37
- package/dist/esm/Components/Input/Input/InputProps.js +0 -1
- package/dist/esm/Components/ProductCard/productCardFixtures.js +0 -58
- package/dist/esm/services/feedback.js +0 -15
- package/dist/services/feedback.d.ts +0 -12
- package/dist/services/feedback.js +0 -18
- /package/dist/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
- /package/dist/esm/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOutsideMouseDown = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/** Calls `onOutside` for a document `mousedown` outside every ref; a null ref contains nothing. Unlike Chakra's `useOutsideClick` it never waits for `mouseup`. */
|
|
6
|
+
const useOutsideMouseDown = (refs, onOutside, { enabled = true, capture = false, includeClick = false } = {}) => {
|
|
7
|
+
const latest = (0, react_1.useRef)({ refs, onOutside });
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
latest.current = { refs, onOutside };
|
|
10
|
+
});
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
if (!enabled)
|
|
13
|
+
return;
|
|
14
|
+
const handle = (event) => {
|
|
15
|
+
const target = event.target;
|
|
16
|
+
if (latest.current.refs.some((ref) => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(target); }))
|
|
17
|
+
return;
|
|
18
|
+
latest.current.onOutside(event);
|
|
19
|
+
};
|
|
20
|
+
document.addEventListener("mousedown", handle, capture);
|
|
21
|
+
if (includeClick)
|
|
22
|
+
document.addEventListener("click", handle, capture);
|
|
23
|
+
return () => {
|
|
24
|
+
document.removeEventListener("mousedown", handle, capture);
|
|
25
|
+
if (includeClick)
|
|
26
|
+
document.removeEventListener("click", handle, capture);
|
|
27
|
+
};
|
|
28
|
+
}, [enabled, capture, includeClick]);
|
|
29
|
+
};
|
|
30
|
+
exports.useOutsideMouseDown = useOutsideMouseDown;
|
|
@@ -19,28 +19,45 @@ const constructUrl = ({ baseUrl, key, page, name, orgId }) => {
|
|
|
19
19
|
const queryString = params.toString();
|
|
20
20
|
return `${baseUrl}${queryString ? `?${queryString}` : ""}`;
|
|
21
21
|
};
|
|
22
|
+
const NO_PREFERENCES = [];
|
|
22
23
|
const useGetPreferences = ({ baseUrl = "", key = "", page = "", name = "", authToken = "", orgId = "", }) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const [
|
|
24
|
+
const url = baseUrl ? constructUrl({ baseUrl, key, page, name, orgId }) : "";
|
|
25
|
+
const requestKey = url ? JSON.stringify([url, authToken]) : "";
|
|
26
|
+
const [settled, setSettled] = (0, react_1.useState)({
|
|
27
|
+
requestKey: "",
|
|
28
|
+
preferences: NO_PREFERENCES,
|
|
29
|
+
});
|
|
26
30
|
(0, react_1.useEffect)(() => {
|
|
27
|
-
if (!
|
|
31
|
+
if (!url) {
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
const url = constructUrl({ baseUrl, key, page, name, orgId });
|
|
34
|
+
let cancelled = false;
|
|
32
35
|
fetch(url, {
|
|
33
36
|
headers: {
|
|
34
37
|
Authorization: authToken,
|
|
35
38
|
},
|
|
36
39
|
})
|
|
37
40
|
.then((response) => response.json())
|
|
38
|
-
.then((data) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
.then((data) => {
|
|
42
|
+
if (!cancelled)
|
|
43
|
+
setSettled({ requestKey, preferences: data });
|
|
44
|
+
})
|
|
45
|
+
.catch((error) => {
|
|
46
|
+
if (cancelled)
|
|
47
|
+
return;
|
|
48
|
+
console.error(error);
|
|
49
|
+
setSettled({ requestKey, preferences: NO_PREFERENCES });
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
cancelled = true;
|
|
53
|
+
};
|
|
54
|
+
}, [url, authToken, requestKey]);
|
|
55
|
+
const isSettled = settled.requestKey === requestKey;
|
|
56
|
+
return {
|
|
57
|
+
preferences: isSettled ? settled.preferences : NO_PREFERENCES,
|
|
58
|
+
// NOTE: derived so KanbanBoard never reads a stale loading=false, on mount or re-key.
|
|
59
|
+
loading: Boolean(baseUrl) && !isSettled,
|
|
60
|
+
};
|
|
44
61
|
};
|
|
45
62
|
exports.useGetPreferences = useGetPreferences;
|
|
46
63
|
const useSavePreferences = ({ baseUrl = "", key = "", page = "", name = "", authToken = "", orgId = "", }) => {
|
|
@@ -59,6 +76,7 @@ const useSavePreferences = ({ baseUrl = "", key = "", page = "", name = "", auth
|
|
|
59
76
|
body: JSON.stringify({ key, page, name, json: data }),
|
|
60
77
|
})
|
|
61
78
|
.then((r) => r.json())
|
|
79
|
+
.then(() => setError(null))
|
|
62
80
|
.catch((e) => setError(e))
|
|
63
81
|
.finally(() => setLoading(false));
|
|
64
82
|
}, [baseUrl, orgId, authToken, key, page, name]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** `label` or `labelledBy` names the scroller; `keepRole` stops it taking role=region. */
|
|
2
|
+
export type ScrollableRegionOptions = {
|
|
3
|
+
label?: string;
|
|
4
|
+
labelledBy?: string;
|
|
5
|
+
keepRole?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Attributes to spread on a scroller; empty unless it overflows with nothing focusable inside. */
|
|
8
|
+
export type ScrollableRegionProps = {
|
|
9
|
+
tabIndex?: 0;
|
|
10
|
+
role?: "region";
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
"aria-labelledby"?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function useScrollableRegion<T extends HTMLElement = HTMLElement>({ label, labelledBy, keepRole, }?: ScrollableRegionOptions): {
|
|
15
|
+
ref: (node: T | null) => void;
|
|
16
|
+
props: ScrollableRegionProps;
|
|
17
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useScrollableRegion = useScrollableRegion;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const sharedResizeObserver_1 = require("./sharedResizeObserver");
|
|
6
|
+
const FOCUSABLE_CONTENT = 'a[href], area[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';
|
|
7
|
+
const USER_SCROLLABLE = /auto|scroll/;
|
|
8
|
+
const SLACK_PX = 1;
|
|
9
|
+
const needsFocusStop = (el) => {
|
|
10
|
+
const { overflowX, overflowY } = getComputedStyle(el);
|
|
11
|
+
const scrollsX = USER_SCROLLABLE.test(overflowX) && el.scrollWidth > el.clientWidth + SLACK_PX;
|
|
12
|
+
const scrollsY = USER_SCROLLABLE.test(overflowY) && el.scrollHeight > el.clientHeight + SLACK_PX;
|
|
13
|
+
return (scrollsX || scrollsY) && !el.querySelector(FOCUSABLE_CONTENT);
|
|
14
|
+
};
|
|
15
|
+
function useScrollableRegion({ label, labelledBy, keepRole = false, } = {}) {
|
|
16
|
+
const [element, setElement] = (0, react_1.useState)(null);
|
|
17
|
+
const [isStop, setIsStop] = (0, react_1.useState)(false);
|
|
18
|
+
const measure = (0, react_1.useCallback)(() => setIsStop(element !== null && needsFocusStop(element)), [element]);
|
|
19
|
+
(0, react_1.useEffect)(() => {
|
|
20
|
+
if (!element)
|
|
21
|
+
return undefined;
|
|
22
|
+
return (0, sharedResizeObserver_1.observeResize)(element, measure);
|
|
23
|
+
}, [element, measure]);
|
|
24
|
+
// NOTE: also runs after every commit; an equal state bails out, so no loop.
|
|
25
|
+
(0, react_1.useEffect)(measure);
|
|
26
|
+
const named = Boolean(label || labelledBy);
|
|
27
|
+
const props = isStop
|
|
28
|
+
? {
|
|
29
|
+
tabIndex: 0,
|
|
30
|
+
role: named && !keepRole ? "region" : undefined,
|
|
31
|
+
"aria-label": label,
|
|
32
|
+
"aria-labelledby": labelledBy,
|
|
33
|
+
}
|
|
34
|
+
: {};
|
|
35
|
+
return { ref: setElement, props };
|
|
36
|
+
}
|
|
@@ -3,6 +3,7 @@ export type SidebarPrefs = {
|
|
|
3
3
|
collapsed: boolean;
|
|
4
4
|
mobileOpen: boolean;
|
|
5
5
|
};
|
|
6
|
+
/** Persistence key and first-visit defaults for sidebar preferences. */
|
|
6
7
|
export type UseSidebarPrefsOptions = {
|
|
7
8
|
/** localStorage key. Versioned so a future shape change can bump it. */
|
|
8
9
|
storageKey?: string;
|
|
@@ -8,6 +8,8 @@ const optionRowInk_1 = require("../../Components/Select/optionRowInk");
|
|
|
8
8
|
const optionRowSizes_1 = require("../tokens/primitives/optionRowSizes");
|
|
9
9
|
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
10
10
|
const overlay_styles_1 = require("./overlay.styles");
|
|
11
|
+
const accentText_1 = require("../tokens/builders/accentText");
|
|
12
|
+
const surfaceRaised_1 = require("../tokens/builders/surfaceRaised");
|
|
11
13
|
const itemRowSpec = optionRowSizes_1.OPTION_ROW_SIZES.sm;
|
|
12
14
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.menuAnatomy.keys);
|
|
13
15
|
const $bg = (0, react_1.cssVar)("menu-bg");
|
|
@@ -28,6 +30,10 @@ const baseStyle = definePartsStyle(({ theme }) => {
|
|
|
28
30
|
borderColor: colors.boxborder[200],
|
|
29
31
|
...overlay_styles_1.POPUP_SURFACE,
|
|
30
32
|
},
|
|
33
|
+
divider: {
|
|
34
|
+
borderColor: (0, surfaceRaised_1.raisedRule)(colors),
|
|
35
|
+
...((0, accentText_1.isDarkCanvas)(colors.surfaceRaised) && { opacity: 1 }),
|
|
36
|
+
},
|
|
31
37
|
item: {
|
|
32
38
|
color: (0, optionRowInk_1.optionRowInk)(colors, false),
|
|
33
39
|
minH: itemRowSpec.minH,
|
|
@@ -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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insetRingShadow = void 0;
|
|
4
|
+
const borderWidths_1 = require("../tokens/primitives/borderWidths");
|
|
5
|
+
/** A stroke drawn inside the border box as a box-shadow, so it never costs layout. */
|
|
6
|
+
const insetRingShadow = (color, width = "hairline") => `inset 0 0 0 ${borderWidths_1.BORDER_WIDTHS[width]} ${color}`;
|
|
7
|
+
exports.insetRingShadow = insetRingShadow;
|
|
@@ -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;
|
|
@@ -6,8 +6,9 @@ export declare const shiftLighter: (scale: ColorScale) => ColorScale;
|
|
|
6
6
|
export declare const accentLightnessDelta: (accent500: string, white: string) => number;
|
|
7
7
|
/** Raises every rung by the same lightness delta, preserving the ramp's shape and hue. */
|
|
8
8
|
export declare const liftScale: (scale: ColorScale, delta: number) => ColorScale;
|
|
9
|
-
/** `lifted`:
|
|
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
|
}
|
|
@@ -151,7 +151,8 @@ const NAMED_SURFACE_L = {
|
|
|
151
151
|
accent: 17,
|
|
152
152
|
muted: 18,
|
|
153
153
|
};
|
|
154
|
-
|
|
154
|
+
// NOTE: surfaces are hue-neutral on every brand; brand hue stays on accents, ink and rules.
|
|
155
|
+
const SURFACE_SAT = 0;
|
|
155
156
|
const TEXT_SAT = 12;
|
|
156
157
|
const PLACEHOLDER_SAT = 10;
|
|
157
158
|
const BORDER_SAT = 12;
|
|
@@ -182,16 +183,15 @@ const cardPlane = (canvas, white, planes) => {
|
|
|
182
183
|
function buildDarkPalette(light, { planes = "lifted" } = {}) {
|
|
183
184
|
const hueSource = light.primary[500];
|
|
184
185
|
const { h } = (0, color_1.hexToHsl)(hueSource);
|
|
185
|
-
const surfaceSat = SURFACE_SAT[planes];
|
|
186
186
|
const namedSurfaces = Object.fromEntries(Object.entries(NAMED_SURFACE_L).map(([key, l]) => [
|
|
187
187
|
key,
|
|
188
|
-
(0, color_1.hslToHex)({ h, s:
|
|
188
|
+
(0, color_1.hslToHex)({ h, s: SURFACE_SAT, l }),
|
|
189
189
|
]));
|
|
190
190
|
const white = light.white;
|
|
191
191
|
const { card, rise, tableHover } = cardPlane(namedSurfaces.main, white, planes);
|
|
192
192
|
const primary = liftBrand(light.primary, white);
|
|
193
193
|
const background = {
|
|
194
|
-
...fromTargets(hueSource, raise(SURFACE_TARGETS, BACKGROUND_FILLS, rise),
|
|
194
|
+
...fromTargets(hueSource, raise(SURFACE_TARGETS, BACKGROUND_FILLS, rise), SURFACE_SAT),
|
|
195
195
|
50: card,
|
|
196
196
|
};
|
|
197
197
|
const semantic = {
|
|
@@ -231,7 +231,7 @@ function buildDarkPalette(light, { planes = "lifted" } = {}) {
|
|
|
231
231
|
border: dividerRamp,
|
|
232
232
|
boxborder: dividerRamp,
|
|
233
233
|
table: {
|
|
234
|
-
hover: fromTargets(hueSource, tableHover,
|
|
234
|
+
hover: fromTargets(hueSource, tableHover, SURFACE_SAT),
|
|
235
235
|
},
|
|
236
236
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
237
237
|
accentText: (0, accentText_1.pickAccentText)(primary, namedSurfaces.main),
|
|
@@ -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
|
};
|