pixelize-design-library 2.4.2-beta.61 → 2.4.2-beta.62
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 +153 -0
- package/COMPONENT-GOTCHAS.md +119 -1
- package/dist/Components/Accordion/Accordion.js +2 -2
- package/dist/Components/AddressCard/AddressCard.js +2 -1
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
- package/dist/Components/AppSwitcher/AppSwitcher.js +1 -1
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +1 -1
- package/dist/Components/AudioRecorder/AudioRecorder.js +2 -1
- package/dist/Components/Avatar/Avatar.d.ts +2 -1
- package/dist/Components/Avatar/Avatar.js +5 -3
- package/dist/Components/Backdrop/Backdrop.js +1 -1
- package/dist/Components/BagBar/BagBar.js +2 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
- package/dist/Components/CalendarGrid/CalendarGrid.js +5 -5
- package/dist/Components/CalendarGrid/calendarMath.js +18 -6
- package/dist/Components/Card/PaymentCard/PaymentCard.js +6 -5
- package/dist/Components/CartItem/CartItem.js +2 -1
- package/dist/Components/Checkbox/Checkbox.d.ts +18 -3
- package/dist/Components/Checkbox/Checkbox.js +9 -7
- package/dist/Components/CheckoutKit/selectable.js +1 -1
- package/dist/Components/ChoiceCard/ChoiceCard.d.ts +3 -0
- package/dist/Components/ChoiceCard/ChoiceCard.js +16 -0
- package/dist/Components/ChoiceCard/ChoiceCardGroup.d.ts +3 -0
- package/dist/Components/ChoiceCard/ChoiceCardGroup.js +6 -0
- package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +28 -0
- package/dist/Components/ChoiceCard/ChoiceCardProps.js +2 -0
- package/dist/Components/CircularProgress/CircularProgress.js +4 -8
- package/dist/Components/CircularProgress/CircularProgressProps.d.ts +5 -3
- package/dist/Components/CircularProgress/arc.d.ts +9 -1
- package/dist/Components/CircularProgress/arc.js +15 -1
- package/dist/Components/Common/FormLabel.js +1 -1
- package/dist/Components/Common/FormattedDescription.js +1 -1
- package/dist/Components/Common/HelperText.d.ts +5 -4
- package/dist/Components/Common/HelperText.js +10 -7
- package/dist/Components/Common/fieldStyles.d.ts +4 -4
- package/dist/Components/Common/fieldStyles.js +2 -1
- package/dist/Components/ContactForm/ContactForm.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +12 -5
- package/dist/Components/CouponField/CouponField.js +4 -3
- package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +18 -0
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +2 -2
- package/dist/Components/DatePicker/DatePicker.js +8 -2
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +9 -3
- package/dist/Components/DatePicker/RangeDatePicker.js +6 -5
- package/dist/Components/DatePicker/SingleDatePicker.d.ts +9 -5
- package/dist/Components/DatePicker/SingleDatePicker.js +7 -4
- package/dist/Components/DatePicker/ThemeDatePicker.d.ts +8 -4
- package/dist/Components/DatePicker/ThemeDatePicker.js +9 -6
- package/dist/Components/DatePicker/TimeOnlyPicker.d.ts +9 -5
- package/dist/Components/DatePicker/TimeOnlyPicker.js +6 -4
- package/dist/Components/DatePicker/TimePickerInput.d.ts +2 -2
- package/dist/Components/DatePicker/TimePickerInput.js +6 -5
- package/dist/Components/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/Components/DescriptionList/DescriptionList.js +3 -3
- package/dist/Components/DescriptionList/DescriptionListProps.d.ts +3 -3
- package/dist/Components/Dropdown/DropDown.js +12 -4
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
- package/dist/Components/EmptyState/EmptyState.js +2 -2
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +3 -3
- package/dist/Components/FileUpload/FileUpload.js +21 -15
- package/dist/Components/FileUpload/useObjectUrl.d.ts +1 -0
- package/dist/Components/FileUpload/useObjectUrl.js +14 -0
- package/dist/Components/FileUploader/FileUploader.js +9 -3
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +8 -0
- package/dist/Components/FilterBar/FilterBar.d.ts +1 -1
- package/dist/Components/FilterBar/FilterBar.js +2 -2
- package/dist/Components/FilterBar/FilterBarProps.d.ts +3 -3
- package/dist/Components/FilterSidebar/FilterSidebar.js +10 -6
- package/dist/Components/Form/FormWrapper.js +1 -1
- package/dist/Components/FormField/FormField.d.ts +3 -0
- package/dist/Components/FormField/FormField.js +57 -0
- package/dist/Components/FormField/FormFieldProps.d.ts +33 -0
- package/dist/Components/FormField/FormFieldProps.js +2 -0
- package/dist/Components/Header/HeaderActions.js +2 -2
- package/dist/Components/Header/components/mobileMenu.js +1 -1
- package/dist/Components/IconButton/IconButton.d.ts +5 -0
- package/dist/Components/IconButton/IconButton.js +24 -0
- package/dist/Components/IconButton/IconButtonProps.d.ts +10 -0
- package/dist/Components/IconButton/IconButtonProps.js +2 -0
- package/dist/Components/Input/PhoneNumberInput.js +14 -0
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountCard.js +3 -2
- package/dist/Components/KanbanBoard/AccountRow.js +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +56 -39
- package/dist/Components/KanbanBoard/MeasuredItem.js +6 -14
- package/dist/Components/KanbanBoard/boardStore.d.ts +8 -0
- package/dist/Components/KanbanBoard/boardStore.js +27 -0
- package/dist/Components/Kbd/Kbd.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +1 -1
- package/dist/Components/Loading/Loading.js +1 -1
- package/dist/Components/MediaGallery/MediaGallery.js +1 -1
- package/dist/Components/MediaGallery/MediaLightbox.js +2 -1
- package/dist/Components/MediaGallery/glass.js +2 -1
- package/dist/Components/MediaViewer/MediaViewer.js +1 -1
- package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
- package/dist/Components/MediaViewer/components/MediaImageViewer.js +1 -1
- package/dist/Components/MediaViewer/components/MediaScrubber.js +5 -1
- package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
- package/dist/Components/MediaViewer/components/PlaybackTimeline.d.ts +20 -0
- package/dist/Components/MediaViewer/components/PlaybackTimeline.js +47 -0
- package/dist/Components/MediaViewer/components/TileChip.js +1 -1
- package/dist/Components/Modal/Modal.js +1 -1
- package/dist/Components/MoreItems/MoreItems.js +2 -2
- package/dist/Components/NavigationBar/NavigationBar.js +2 -2
- package/dist/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +12 -0
- package/dist/Components/Notification/Notification.js +17 -3
- package/dist/Components/Notification/NotificationProps.d.ts +17 -1
- package/dist/Components/NotificationBell/NotificationBell.js +5 -1
- package/dist/Components/NotificationBell/NotificationItem.js +1 -1
- package/dist/Components/NotificationBell/NotificationList.js +1 -1
- package/dist/Components/OffersList/OffersList.js +2 -1
- package/dist/Components/OptionChip/OptionChip.js +3 -2
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/Components/OrderSummary/OrderSummary.js +5 -5
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +7 -1
- package/dist/Components/PageHeader/PageHeader.d.ts +1 -1
- package/dist/Components/PageHeader/PageHeader.js +2 -2
- package/dist/Components/PageHeader/PageHeaderProps.d.ts +3 -3
- package/dist/Components/Pagination/Pagination.d.ts +5 -0
- package/dist/Components/Pagination/Pagination.js +48 -0
- package/dist/Components/Pagination/PaginationProps.d.ts +46 -0
- package/dist/Components/Pagination/PaginationProps.js +9 -0
- package/dist/Components/Pagination/pageWindow.d.ts +4 -0
- package/dist/Components/Pagination/pageWindow.js +22 -0
- package/dist/Components/PaymentOption/PaymentOption.js +1 -1
- package/dist/Components/PersonChip/PersonChip.js +2 -2
- package/dist/Components/PinInput/PinInput.d.ts +1 -1
- package/dist/Components/PinInput/PinInput.js +17 -2
- package/dist/Components/PinInput/PinInputProps.d.ts +9 -1
- package/dist/Components/PincodeChecker/PincodeChecker.js +4 -4
- package/dist/Components/PlanPill/PlanPill.js +2 -1
- package/dist/Components/PriceBlock/PriceBlock.js +3 -3
- package/dist/Components/Primitives/Primitives.d.ts +2 -2
- package/dist/Components/Primitives/Primitives.js +2 -3
- package/dist/Components/ProductBadges/ProductBadges.js +2 -1
- package/dist/Components/ProductCard/ProductCard.js +1 -1
- package/dist/Components/ProductCard/ProductCardAction.js +2 -2
- package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/Components/ProductCard/cardMetrics.d.ts +1 -1
- package/dist/Components/ProductCard/cardMetrics.js +5 -1
- package/dist/Components/ProfileCard/ProfileCardProps.d.ts +11 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
- package/dist/Components/QuantityStepper/QuantityStepper.js +2 -1
- package/dist/Components/RadioButton/RadioButton.d.ts +11 -2
- package/dist/Components/RadioButton/RadioButton.js +9 -6
- package/dist/Components/RangeSlider/RangeSlider.js +3 -3
- package/dist/Components/Rating/Rating.js +2 -1
- package/dist/Components/Reorder/Reorder.js +3 -2
- package/dist/Components/ReviewList/ReviewList.js +3 -3
- package/dist/Components/ReviewSummary/ReviewSummary.js +3 -3
- package/dist/Components/SaveBar/SaveBar.d.ts +1 -1
- package/dist/Components/SaveBar/SaveBar.js +2 -2
- package/dist/Components/SaveBar/SaveBarProps.d.ts +3 -3
- package/dist/Components/Search/Search.js +2 -9
- package/dist/Components/Search/ctrlShortcut.d.ts +1 -0
- package/dist/Components/Search/ctrlShortcut.js +29 -0
- package/dist/Components/SearchSelect/SearchSelect.js +117 -30
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +8 -2
- package/dist/Components/SegmentedControl/SegmentedControl.js +9 -5
- package/dist/Components/Select/SelectPopup.js +6 -4
- package/dist/Components/SelectSearch/SelectSearch.js +5 -4
- package/dist/Components/SettingRow/SettingRow.js +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +2 -1
- package/dist/Components/SideBar/SideBar.js +82 -21
- package/dist/Components/SideBar/components/MenuItemBox.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +4 -3
- package/dist/Components/SideBar/components/MenuItems.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItems.js +3 -3
- package/dist/Components/SideBar/components/OtherApps.js +5 -1
- package/dist/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/Components/SideBar/components/PinnedSection.js +2 -2
- package/dist/Components/SideBar/components/TextTruncation.js +11 -6
- package/dist/Components/SideBar/sidebarScale.d.ts +1 -1
- package/dist/Components/SideBar/sidebarScale.js +2 -1
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +8 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -2
- package/dist/Components/Skeletons/Skeletons.d.ts +1 -1
- package/dist/Components/Skeletons/Skeletons.js +4 -2
- package/dist/Components/SkipLink/SkipLink.d.ts +4 -0
- package/dist/Components/SkipLink/SkipLink.js +54 -0
- package/dist/Components/SkipLink/SkipLinkProps.d.ts +8 -0
- package/dist/Components/SkipLink/SkipLinkProps.js +2 -0
- package/dist/Components/Slider/Slider.d.ts +2 -2
- package/dist/Components/Slider/Slider.js +11 -4
- package/dist/Components/SpecTable/SpecTable.js +2 -1
- package/dist/Components/StageProgress/StageItem.js +2 -5
- package/dist/Components/StageProgress/StageProgress.js +2 -1
- package/dist/Components/StageProgress/StageProgressProps.d.ts +1 -1
- package/dist/Components/StageProgress/StepperStage.js +2 -6
- package/dist/Components/StageProgress/centerInStrip.d.ts +2 -0
- package/dist/Components/StageProgress/centerInStrip.js +15 -0
- package/dist/Components/StatCard/StatCard.d.ts +1 -1
- package/dist/Components/StatCard/StatCard.js +5 -4
- package/dist/Components/StatCard/StatCardProps.d.ts +3 -3
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +1 -1
- package/dist/Components/Table/components/TableActions.js +40 -24
- package/dist/Components/Table/components/TableBody.js +25 -40
- package/dist/Components/Table/components/rowMeasurer.d.ts +8 -0
- package/dist/Components/Table/components/rowMeasurer.js +71 -0
- package/dist/Components/Table/filters/TableFilters.js +2 -13
- package/dist/Components/Table/hooks/useTable.js +12 -9
- package/dist/Components/Tabs/components/CountBadge.js +3 -3
- package/dist/Components/Tabs/components/Tab.d.ts +2 -1
- package/dist/Components/Tabs/components/Tab.js +4 -3
- package/dist/Components/Tabs/components/TabList.js +16 -1
- package/dist/Components/Tag/Tag.d.ts +2 -2
- package/dist/Components/Tag/Tag.js +15 -12
- package/dist/Components/Tag/Tag.styles.js +6 -4
- package/dist/Components/TagInput/TagInput.d.ts +3 -0
- package/dist/Components/TagInput/TagInput.js +99 -0
- package/dist/Components/TagInput/TagInputProps.d.ts +46 -0
- package/dist/Components/TagInput/TagInputProps.js +2 -0
- package/dist/Components/TagInput/tagEntries.d.ts +15 -0
- package/dist/Components/TagInput/tagEntries.js +45 -0
- package/dist/Components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/Components/TimePicker/TimePicker.js +50 -0
- package/dist/Components/TimePicker/TimePickerProps.d.ts +44 -0
- package/dist/Components/TimePicker/TimePickerProps.js +2 -0
- package/dist/Components/TimePicker/timeParts.d.ts +10 -0
- package/dist/Components/TimePicker/timeParts.js +36 -0
- package/dist/Components/Timeline/Timeline.js +11 -9
- package/dist/Components/Toaster/Toaster.js +2 -1
- package/dist/Components/Toggle/TableToggle.js +4 -3
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +3 -2
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +6 -5
- package/dist/Components/ToolTip/ToolTip.js +86 -8
- package/dist/Components/UpgradeButton/UpgradeButton.js +4 -2
- package/dist/Components/UserDetails/UserDetails.js +7 -1
- package/dist/Components/VisuallyHidden/VisuallyHidden.d.ts +15 -0
- package/dist/Components/VisuallyHidden/VisuallyHidden.js +21 -0
- package/dist/Components/VisuallyHidden/VisuallyHiddenProps.d.ts +3 -0
- package/dist/Components/VisuallyHidden/VisuallyHiddenProps.js +2 -0
- package/dist/Components/WizardDialog/WizardDialog.js +10 -5
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +4 -0
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +5 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +15 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +2 -1
- package/dist/Hooks/sharedResizeObserver.d.ts +6 -0
- package/dist/Hooks/sharedResizeObserver.js +77 -0
- package/dist/Hooks/useIsTruncated.js +3 -4
- package/dist/Theme/chakra/Menu.styles.d.ts +1 -1
- package/dist/Theme/chakra/common.web.d.ts +1 -0
- package/dist/Theme/chakra/componentStyles.d.ts +1 -1
- package/dist/Theme/chakra/createBrandTheme.d.ts +3 -0
- package/dist/Theme/chakra/createBrandTheme.js +34 -4
- package/dist/Theme/chakra/focusRing.styles.d.ts +2 -0
- package/dist/Theme/chakra/focusRing.styles.js +5 -1
- package/dist/Theme/chakra/fonts.web.d.ts +2 -0
- package/dist/Theme/chakra/motion.d.ts +14 -0
- package/dist/Theme/chakra/motion.js +26 -1
- package/dist/Theme/index.d.ts +2 -1
- package/dist/Theme/index.js +12 -9
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +4 -1
- package/dist/Theme/provider/PixelizeThemeProvider.js +21 -12
- package/dist/Theme/provider/ThemeSwitcher.js +3 -2
- package/dist/Theme/themeProps.d.ts +3 -0
- package/dist/Theme/tokens/brands/emerald/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/index.d.ts +1 -1
- package/dist/Theme/tokens/brands/index.js +14 -13
- package/dist/Theme/tokens/brands/lavender/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/meadow/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/radiant/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/skyline/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/slate/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/storefront/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +28 -24
- package/dist/Theme/tokens/builders/color.js +11 -7
- package/dist/Theme/tokens/builders/filledSurface.d.ts +3 -1
- package/dist/Theme/tokens/builders/filledSurface.js +7 -7
- package/dist/Theme/tokens/builders/lazy.d.ts +5 -0
- package/dist/Theme/tokens/builders/lazy.js +55 -0
- package/dist/Theme/tokens/builders/memo.d.ts +9 -0
- package/dist/Theme/tokens/builders/memo.js +28 -0
- package/dist/Theme/tokens/builders/memoByReads.d.ts +2 -0
- package/dist/Theme/tokens/builders/memoByReads.js +50 -0
- package/dist/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/Theme/tokens/builders/tone.js +5 -4
- package/dist/Theme/tokens/primitives/borderWidths.d.ts +6 -0
- package/dist/Theme/tokens/primitives/borderWidths.js +5 -0
- package/dist/Theme/tokens/primitives/index.d.ts +8 -3
- package/dist/Theme/tokens/primitives/index.js +8 -1
- package/dist/Theme/tokens/primitives/motion.d.ts +25 -2
- package/dist/Theme/tokens/primitives/motion.js +23 -5
- package/dist/Theme/tokens/primitives/optionRowSizes.d.ts +1 -1
- package/dist/Theme/tokens/primitives/optionRowSizes.js +2 -1
- package/dist/Theme/tokens/primitives/radii.d.ts +15 -0
- package/dist/Theme/tokens/primitives/radii.js +14 -0
- package/dist/Theme/tokens/primitives/shadows.d.ts +5 -1
- package/dist/Theme/tokens/primitives/shadows.js +5 -1
- package/dist/Theme/tokens/primitives/states.d.ts +1 -0
- package/dist/Theme/tokens/primitives/states.js +4 -0
- package/dist/Theme/tokens/primitives/typography.d.ts +17 -0
- package/dist/Theme/tokens/primitives/typography.js +21 -1
- package/dist/Theme/tokens/primitives/zIndices.d.ts +1 -0
- package/dist/Theme/tokens/primitives/zIndices.js +1 -0
- package/dist/Utils/formatDate.d.ts +25 -0
- package/dist/Utils/formatDate.js +144 -0
- package/dist/esm/Components/Accordion/Accordion.js +2 -2
- package/dist/esm/Components/AddressCard/AddressCard.js +2 -1
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +1 -1
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +1 -1
- package/dist/esm/Components/AudioRecorder/AudioRecorder.js +2 -1
- package/dist/esm/Components/Avatar/Avatar.js +6 -4
- package/dist/esm/Components/Backdrop/Backdrop.js +1 -1
- package/dist/esm/Components/BagBar/BagBar.js +2 -1
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
- package/dist/esm/Components/CalendarGrid/CalendarGrid.js +6 -6
- package/dist/esm/Components/CalendarGrid/calendarMath.js +18 -6
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +6 -5
- package/dist/esm/Components/CartItem/CartItem.js +2 -1
- package/dist/esm/Components/Checkbox/Checkbox.js +8 -5
- package/dist/esm/Components/CheckoutKit/selectable.js +1 -1
- package/dist/esm/Components/ChoiceCard/ChoiceCard.js +14 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCardGroup.js +4 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCardProps.js +1 -0
- package/dist/esm/Components/CircularProgress/CircularProgress.js +5 -9
- package/dist/esm/Components/CircularProgress/arc.js +13 -0
- package/dist/esm/Components/Common/FormLabel.js +1 -1
- package/dist/esm/Components/Common/FormattedDescription.js +1 -1
- package/dist/esm/Components/Common/HelperText.js +11 -8
- package/dist/esm/Components/Common/fieldStyles.js +2 -1
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +14 -7
- package/dist/esm/Components/CouponField/CouponField.js +4 -3
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -2
- package/dist/esm/Components/DatePicker/DatePicker.js +8 -2
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +8 -6
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +7 -4
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +7 -4
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +5 -3
- package/dist/esm/Components/DatePicker/TimePickerInput.js +8 -6
- package/dist/esm/Components/DescriptionList/DescriptionList.js +3 -3
- package/dist/esm/Components/Dropdown/DropDown.js +12 -4
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
- package/dist/esm/Components/EmptyState/EmptyState.js +2 -2
- package/dist/esm/Components/FileUpload/FileUpload.js +21 -15
- package/dist/esm/Components/FileUpload/useObjectUrl.js +10 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +9 -3
- package/dist/esm/Components/FilterBar/FilterBar.js +2 -2
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +10 -6
- package/dist/esm/Components/Form/FormWrapper.js +1 -1
- package/dist/esm/Components/FormField/FormField.js +52 -0
- package/dist/esm/Components/FormField/FormFieldProps.js +1 -0
- package/dist/esm/Components/Header/HeaderActions.js +2 -2
- package/dist/esm/Components/Header/components/mobileMenu.js +1 -1
- package/dist/esm/Components/IconButton/IconButton.js +21 -0
- package/dist/esm/Components/IconButton/IconButtonProps.js +1 -0
- package/dist/esm/Components/Input/PhoneNumberInput.js +15 -1
- package/dist/esm/Components/KanbanBoard/AccountCard.js +3 -2
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -1
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +56 -39
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +6 -14
- package/dist/esm/Components/KanbanBoard/boardStore.js +22 -0
- package/dist/esm/Components/Kbd/Kbd.js +1 -1
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +1 -1
- package/dist/esm/Components/Loading/Loading.js +1 -1
- package/dist/esm/Components/MediaGallery/MediaGallery.js +2 -2
- package/dist/esm/Components/MediaGallery/MediaLightbox.js +2 -1
- package/dist/esm/Components/MediaGallery/glass.js +2 -1
- package/dist/esm/Components/MediaViewer/MediaViewer.js +1 -1
- package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
- package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +1 -1
- package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +5 -1
- package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
- package/dist/esm/Components/MediaViewer/components/PlaybackTimeline.js +38 -0
- package/dist/esm/Components/MediaViewer/components/TileChip.js +1 -1
- package/dist/esm/Components/Modal/Modal.js +1 -1
- package/dist/esm/Components/MoreItems/MoreItems.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -2
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/esm/Components/Notification/Notification.js +17 -3
- package/dist/esm/Components/NotificationBell/NotificationBell.js +2 -1
- package/dist/esm/Components/NotificationBell/NotificationItem.js +1 -1
- package/dist/esm/Components/NotificationBell/NotificationList.js +1 -1
- package/dist/esm/Components/OffersList/OffersList.js +2 -1
- package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/esm/Components/OrderSummary/OrderSummary.js +5 -5
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +7 -1
- package/dist/esm/Components/PageHeader/PageHeader.js +2 -2
- package/dist/esm/Components/Pagination/Pagination.js +42 -0
- package/dist/esm/Components/Pagination/PaginationProps.js +6 -0
- package/dist/esm/Components/Pagination/pageWindow.js +16 -0
- package/dist/esm/Components/PaymentOption/PaymentOption.js +1 -1
- package/dist/esm/Components/PersonChip/PersonChip.js +2 -2
- package/dist/esm/Components/PinInput/PinInput.js +14 -2
- package/dist/esm/Components/PincodeChecker/PincodeChecker.js +4 -4
- package/dist/esm/Components/PlanPill/PlanPill.js +2 -1
- package/dist/esm/Components/PriceBlock/PriceBlock.js +3 -3
- package/dist/esm/Components/Primitives/Primitives.js +1 -1
- package/dist/esm/Components/ProductBadges/ProductBadges.js +2 -1
- package/dist/esm/Components/ProductCard/ProductCard.js +1 -1
- package/dist/esm/Components/ProductCard/ProductCardAction.js +3 -3
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/esm/Components/ProductCard/cardMetrics.js +2 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +2 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +7 -4
- package/dist/esm/Components/RangeSlider/RangeSlider.js +3 -3
- package/dist/esm/Components/Rating/Rating.js +2 -1
- package/dist/esm/Components/Reorder/Reorder.js +3 -2
- package/dist/esm/Components/ReviewList/ReviewList.js +3 -3
- package/dist/esm/Components/ReviewSummary/ReviewSummary.js +3 -3
- package/dist/esm/Components/SaveBar/SaveBar.js +2 -2
- package/dist/esm/Components/Search/Search.js +2 -9
- package/dist/esm/Components/Search/ctrlShortcut.js +25 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +120 -33
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +11 -6
- package/dist/esm/Components/Select/SelectPopup.js +6 -4
- package/dist/esm/Components/SelectSearch/SelectSearch.js +5 -4
- package/dist/esm/Components/SettingRow/SettingRow.js +1 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +2 -1
- package/dist/esm/Components/SideBar/SideBar.js +83 -22
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +4 -3
- package/dist/esm/Components/SideBar/components/MenuItems.js +4 -4
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -1
- package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/esm/Components/SideBar/components/PinnedSection.js +2 -2
- package/dist/esm/Components/SideBar/components/TextTruncation.js +9 -7
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -1
- package/dist/esm/Components/Skeletons/Skeletons.js +4 -2
- package/dist/esm/Components/SkipLink/SkipLink.js +50 -0
- package/dist/esm/Components/SkipLink/SkipLinkProps.js +1 -0
- package/dist/esm/Components/Slider/Slider.js +11 -4
- package/dist/esm/Components/SpecTable/SpecTable.js +2 -1
- package/dist/esm/Components/StageProgress/StageItem.js +2 -5
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -1
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -6
- package/dist/esm/Components/StageProgress/centerInStrip.js +11 -0
- package/dist/esm/Components/StatCard/StatCard.js +5 -4
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -2
- package/dist/esm/Components/Table/components/TableActions.js +42 -26
- package/dist/esm/Components/Table/components/TableBody.js +25 -40
- package/dist/esm/Components/Table/components/rowMeasurer.js +66 -0
- package/dist/esm/Components/Table/filters/TableFilters.js +3 -14
- package/dist/esm/Components/Table/hooks/useTable.js +12 -9
- package/dist/esm/Components/Tabs/components/CountBadge.js +3 -3
- package/dist/esm/Components/Tabs/components/Tab.js +5 -4
- package/dist/esm/Components/Tabs/components/TabList.js +16 -1
- package/dist/esm/Components/Tag/Tag.js +11 -8
- package/dist/esm/Components/Tag/Tag.styles.js +6 -4
- package/dist/esm/Components/TagInput/TagInput.js +94 -0
- package/dist/esm/Components/TagInput/TagInputProps.js +1 -0
- package/dist/esm/Components/TagInput/tagEntries.js +39 -0
- package/dist/esm/Components/TimePicker/TimePicker.js +45 -0
- package/dist/esm/Components/TimePicker/TimePickerProps.js +1 -0
- package/dist/esm/Components/TimePicker/timeParts.js +26 -0
- package/dist/esm/Components/Timeline/Timeline.js +11 -9
- package/dist/esm/Components/Toaster/Toaster.js +2 -1
- package/dist/esm/Components/Toggle/TableToggle.js +4 -3
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +7 -5
- package/dist/esm/Components/ToolTip/ToolTip.js +89 -11
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +4 -2
- package/dist/esm/Components/UserDetails/UserDetails.js +7 -1
- package/dist/esm/Components/VisuallyHidden/VisuallyHidden.js +18 -0
- package/dist/esm/Components/VisuallyHidden/VisuallyHiddenProps.js +1 -0
- package/dist/esm/Components/WizardDialog/WizardDialog.js +11 -6
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +2 -1
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +13 -3
- package/dist/esm/Hooks/sharedResizeObserver.js +73 -0
- package/dist/esm/Hooks/useIsTruncated.js +3 -4
- package/dist/esm/Theme/chakra/createBrandTheme.js +34 -4
- package/dist/esm/Theme/chakra/focusRing.styles.js +3 -0
- package/dist/esm/Theme/chakra/motion.js +25 -0
- package/dist/esm/Theme/index.js +12 -9
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +22 -13
- package/dist/esm/Theme/provider/ThemeSwitcher.js +3 -2
- package/dist/esm/Theme/tokens/brands/emerald/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/index.js +14 -13
- package/dist/esm/Theme/tokens/brands/lavender/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/meadow/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/radiant/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/skyline/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/slate/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/storefront/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +28 -24
- package/dist/esm/Theme/tokens/builders/color.js +10 -6
- package/dist/esm/Theme/tokens/builders/filledSurface.js +7 -7
- package/dist/esm/Theme/tokens/builders/lazy.js +49 -0
- package/dist/esm/Theme/tokens/builders/memo.js +21 -0
- package/dist/esm/Theme/tokens/builders/memoByReads.js +46 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/esm/Theme/tokens/builders/tone.js +5 -4
- package/dist/esm/Theme/tokens/primitives/borderWidths.js +2 -0
- package/dist/esm/Theme/tokens/primitives/index.js +5 -3
- package/dist/esm/Theme/tokens/primitives/motion.js +20 -4
- package/dist/esm/Theme/tokens/primitives/optionRowSizes.js +2 -1
- package/dist/esm/Theme/tokens/primitives/radii.js +13 -0
- package/dist/esm/Theme/tokens/primitives/shadows.js +3 -1
- package/dist/esm/Theme/tokens/primitives/states.js +1 -0
- package/dist/esm/Theme/tokens/primitives/typography.js +20 -0
- package/dist/esm/Theme/tokens/primitives/zIndices.js +1 -0
- package/dist/esm/Utils/formatDate.js +138 -0
- package/dist/esm/index.js +18 -2
- package/dist/index.d.ts +33 -5
- package/dist/index.js +47 -4
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { chakra } from "@chakra-ui/react";
|
|
2
|
+
// NOTE: fixed, not Chakra's absolute: an absolute 1px box can extend a scrolled page.
|
|
3
|
+
export const visuallyHiddenStyle = {
|
|
4
|
+
border: "0",
|
|
5
|
+
clip: "rect(0, 0, 0, 0)",
|
|
6
|
+
height: "1px",
|
|
7
|
+
width: "1px",
|
|
8
|
+
margin: "-1px",
|
|
9
|
+
padding: "0",
|
|
10
|
+
overflow: "hidden",
|
|
11
|
+
whiteSpace: "nowrap",
|
|
12
|
+
position: "fixed",
|
|
13
|
+
top: "0",
|
|
14
|
+
left: "0",
|
|
15
|
+
};
|
|
16
|
+
const VisuallyHidden = chakra("span", { baseStyle: visuallyHiddenStyle });
|
|
17
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
18
|
+
export default VisuallyHidden;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useEffect, useId, useRef } from "react";
|
|
3
3
|
import { Alert, AlertDescription, AlertIcon, AlertTitle, Box, Flex, Heading, ListItem, Text, UnorderedList, } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
5
|
import Modal, { ModalBody, ModalFooter } from "../Modal/Modal.js";
|
|
@@ -38,21 +38,26 @@ const WizardBody = ({ flow, steps, labels, testId }) => {
|
|
|
38
38
|
value: candidate.summary,
|
|
39
39
|
})) })] })) : null] }));
|
|
40
40
|
};
|
|
41
|
-
const WizardFooter = ({ flow, labels, isFinishing,
|
|
41
|
+
const WizardFooter = ({ flow, labels, isFinishing, finishDisabled, finishBlockedReason, onCancel, }) => {
|
|
42
|
+
const { colors } = useCustomTheme();
|
|
43
|
+
const reasonId = useId();
|
|
44
|
+
const reason = finishDisabled && !isFinishing ? finishBlockedReason : undefined;
|
|
45
|
+
return (_jsxs(Flex, { w: "100%", justify: "space-between", gap: 2, wrap: "wrap", children: [onCancel ? (_jsx(Button, { variant: "ghost", colorScheme: "gray", label: labels.cancel, onClick: onCancel, isDisabled: isFinishing, "data-testid": "wizard-cancel" })) : (_jsx("span", {})), _jsxs(Flex, { gap: 2, align: reason ? "center" : undefined, children: [!flow.isFirst ? (_jsx(Button, { variant: "outline", colorScheme: "gray", label: labels.back, onClick: flow.back, isDisabled: isFinishing, "data-testid": "wizard-back" })) : null, flow.isLast && reason ? (_jsx(Text, { id: reasonId, fontSize: "xs", color: colors.textMuted, "data-testid": "wizard-finish-reason", children: reason })) : null, flow.isLast ? (_jsx(Button, { variant: "solid", colorScheme: "primary", label: labels.finish, onClick: flow.finish, isLoading: isFinishing, isDisabled: finishDisabled, "aria-describedby": reason ? reasonId : undefined, loadingText: labels.finish, "data-testid": "wizard-finish" })) : (_jsx(Button, { variant: "solid", colorScheme: "primary", label: labels.next, onClick: flow.next, "data-testid": "wizard-next" }))] })] }));
|
|
46
|
+
};
|
|
42
47
|
/** Modal wizard that owns step state: validated Continue, locked future steps, error summary, review on the last step. */
|
|
43
|
-
export const WizardDialog = ({ isOpen, onClose, title, subtitle, steps, onFinish, isFinishing = false, stepId, onStepChange, size = "3xl", labels, "data-testid": testId, }) => {
|
|
48
|
+
export const WizardDialog = ({ isOpen, onClose, title, subtitle, steps, onFinish, isFinishing = false, finishDisabled = false, finishBlockedReason, stepId, onStepChange, size = "3xl", labels, "data-testid": testId, }) => {
|
|
44
49
|
const flow = useWizardFlow({ steps, stepId, onStepChange, onFinish, resetWhen: !isOpen });
|
|
45
50
|
const resolved = { ...DEFAULT_LABELS, ...labels };
|
|
46
51
|
const guardedClose = () => {
|
|
47
52
|
if (!isFinishing)
|
|
48
53
|
onClose();
|
|
49
54
|
};
|
|
50
|
-
return (_jsxs(Modal, { isOpen: isOpen, onClose: guardedClose, size: size, isCentered: true, scrollBehavior: "inside", title: title, subtitle: subtitle, closeOnOverlayClick: false, closeOnEsc: !isFinishing, hideCloseButton: isFinishing, children: [_jsx(ModalBody, { children: _jsx(WizardBody, { flow: flow, steps: steps, labels: resolved, testId: testId !== null && testId !== void 0 ? testId : "wizard-dialog" }) }), _jsx(ModalFooter, { children: _jsx(WizardFooter, { flow: flow, labels: resolved, isFinishing: isFinishing, onCancel: guardedClose }) })] }));
|
|
55
|
+
return (_jsxs(Modal, { isOpen: isOpen, onClose: guardedClose, size: size, isCentered: true, scrollBehavior: "inside", title: title, subtitle: subtitle, closeOnOverlayClick: false, closeOnEsc: !isFinishing, hideCloseButton: isFinishing, children: [_jsx(ModalBody, { children: _jsx(WizardBody, { flow: flow, steps: steps, labels: resolved, testId: testId !== null && testId !== void 0 ? testId : "wizard-dialog" }) }), _jsx(ModalFooter, { children: _jsx(WizardFooter, { flow: flow, labels: resolved, isFinishing: isFinishing, finishDisabled: finishDisabled, finishBlockedReason: finishBlockedReason, onCancel: guardedClose }) })] }));
|
|
51
56
|
};
|
|
52
57
|
/** The same wizard inline, for a full-page flow rather than a modal. */
|
|
53
|
-
export const Wizard = ({ steps, onFinish, isFinishing = false, stepId, onStepChange, labels, onCancel, "data-testid": testId, }) => {
|
|
58
|
+
export const Wizard = ({ steps, onFinish, isFinishing = false, finishDisabled = false, finishBlockedReason, stepId, onStepChange, labels, onCancel, "data-testid": testId, }) => {
|
|
54
59
|
const flow = useWizardFlow({ steps, stepId, onStepChange, onFinish });
|
|
55
60
|
const resolved = { ...DEFAULT_LABELS, ...labels };
|
|
56
|
-
return (_jsxs(Flex, { direction: "column", gap: 6, children: [_jsx(WizardBody, { flow: flow, steps: steps, labels: resolved, testId: testId !== null && testId !== void 0 ? testId : "wizard" }), _jsx(WizardFooter, { flow: flow, labels: resolved, isFinishing: isFinishing, onCancel: onCancel })] }));
|
|
61
|
+
return (_jsxs(Flex, { direction: "column", gap: 6, children: [_jsx(WizardBody, { flow: flow, steps: steps, labels: resolved, testId: testId !== null && testId !== void 0 ? testId : "wizard" }), _jsx(WizardFooter, { flow: flow, labels: resolved, isFinishing: isFinishing, finishDisabled: finishDisabled, finishBlockedReason: finishBlockedReason, onCancel: onCancel })] }));
|
|
57
62
|
};
|
|
58
63
|
export default WizardDialog;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Box } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
+
import zIndices from "../../Theme/tokens/primitives/zIndices.js";
|
|
5
6
|
const PLACEMENT_STYLE = {
|
|
6
7
|
"top-end": { bottom: "100%", right: 0, marginBottom: "6px" },
|
|
7
8
|
"top-start": { bottom: "100%", left: 0, marginBottom: "6px" },
|
|
@@ -64,7 +65,7 @@ export default function WorkspaceTrayPreview({ children, preview, enabled = true
|
|
|
64
65
|
e.stopPropagation();
|
|
65
66
|
closeNow();
|
|
66
67
|
}
|
|
67
|
-
}, children: [children, open && (_jsx(Box, { position: "absolute", ...PLACEMENT_STYLE[placement], w: typeof width === "number" ? `${width}px` : width, maxW: "min(360px, calc(100vw - 2rem))", bg: theme.colors.surfaceRaised, borderWidth: "1px", borderColor: theme.colors.boxborder[200], borderRadius: "lg", boxShadow: "xl", zIndex:
|
|
68
|
+
}, children: [children, open && (_jsx(Box, { position: "absolute", ...PLACEMENT_STYLE[placement], w: typeof width === "number" ? `${width}px` : width, maxW: "min(360px, calc(100vw - 2rem))", bg: theme.colors.surfaceRaised, borderWidth: "1px", borderColor: theme.colors.boxborder[200], borderRadius: "lg", boxShadow: "xl", zIndex: zIndices.popover, pointerEvents: "auto", p: 3, textAlign: "left", color: theme.colors.text[700], cursor: "default", onMouseEnter: clearCloseTimer, onMouseLeave: scheduleClose, "data-testid": testId, children: typeof preview === "function"
|
|
68
69
|
? preview({ close: closeNow })
|
|
69
70
|
: preview }))] }));
|
|
70
71
|
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Flex, HStack, IconButton, Modal, ModalContent, ModalOverlay, Text, } from "@chakra-ui/react";
|
|
2
|
+
import { Box, Flex, HStack, IconButton, Modal, ModalContent, ModalOverlay, Text, useModalContext, } from "@chakra-ui/react";
|
|
3
|
+
import { useEffect } from "react";
|
|
3
4
|
import { ExternalLink, Minus, X } from "lucide-react";
|
|
4
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import zIndices from "../../Theme/tokens/primitives/zIndices.js";
|
|
5
7
|
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
6
8
|
// NOTE: no maximize/restore toggle (removed by product decision) — onMedium/onMaximize kept optional for back-compat.
|
|
7
9
|
const WINDOW_SIZE = { maxW: "88rem", h: "92vh" };
|
|
10
|
+
const WindowTitle = ({ testId, color, children }) => {
|
|
11
|
+
const { headerId, setHeaderMounted } = useModalContext();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setHeaderMounted(true);
|
|
14
|
+
return () => setHeaderMounted(false);
|
|
15
|
+
}, [setHeaderMounted]);
|
|
16
|
+
return (_jsx(Text, { id: headerId, fontSize: "sm", fontWeight: 600, color: color, noOfLines: 1, "data-testid": `${testId}-title`, children: children }));
|
|
17
|
+
};
|
|
8
18
|
// Presentational floating "workspace window" (Jira-style dialog), headless — the parent owns window state.
|
|
9
19
|
export default function WorkspaceWindow({ title, state, children, onMinimize, onClose, onOpenFullPage, onOverlayClick, headerActions, testId = "workspace-window", }) {
|
|
10
20
|
// Must run before the early return: a minimized render would otherwise skip the hook
|
|
@@ -21,7 +31,7 @@ export default function WorkspaceWindow({ title, state, children, onMinimize, on
|
|
|
21
31
|
onMouseDown: (e) => {
|
|
22
32
|
if (e.target === e.currentTarget)
|
|
23
33
|
onOverlayClick === null || onOverlayClick === void 0 ? void 0 : onOverlayClick();
|
|
24
|
-
}, "data-testid": `${testId}-backdrop`, children: _jsxs(Box, { bg: theme.colors.surfaceRaised, borderRadius: "xl", boxShadow: "2xl", overflow: "hidden", w: "100%", maxW: size.maxW, h: size.h, display: "flex", flexDirection: "column", "data-testid": testId, "data-window-state": state, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 3, py: 2, borderBottomWidth: "1px", borderColor: theme.colors.boxborder[200], bg: theme.colors.background[100], flexShrink: 0, children: [_jsx(
|
|
34
|
+
}, "data-testid": `${testId}-backdrop`, children: _jsxs(Box, { bg: theme.colors.surfaceRaised, borderRadius: "xl", boxShadow: "2xl", overflow: "hidden", w: "100%", maxW: size.maxW, h: size.h, display: "flex", flexDirection: "column", "data-testid": testId, "data-window-state": state, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 3, py: 2, borderBottomWidth: "1px", borderColor: theme.colors.boxborder[200], bg: theme.colors.background[100], flexShrink: 0, children: [_jsx(WindowTitle, { testId: testId, color: theme.colors.text[700], children: title }), _jsxs(HStack, { spacing: 1, children: [headerActions, onOpenFullPage ? (_jsx(IconButton, { "aria-label": "Open full page", size: "xs", variant: "ghost", icon: _jsx(ExternalLink, { size: 14 }), onClick: onOpenFullPage, "data-testid": `${testId}-fullpage` })) : null, onMinimize ? (_jsx(IconButton, { "aria-label": "Minimize", size: "xs", variant: "ghost", icon: _jsx(Minus, { size: 15 }), onClick: onMinimize, "data-testid": `${testId}-minimize` })) : null, onClose ? (_jsx(IconButton, { "aria-label": "Close", size: "xs", variant: "ghost", colorScheme: "red", icon: _jsx(X, { size: 15 }), onClick: onClose, "data-testid": `${testId}-close` })) : null] })] }), _jsx(Box, { flex: "1", overflow: "auto", px: { base: 3, md: 5 }, py: 4, children: children })] }) })] }));
|
|
25
35
|
}
|
|
26
36
|
// Bottom tray of restore pills for minimized WorkspaceWindows — presentational, parent supplies handlers.
|
|
27
37
|
export function WorkspaceTray({ items, onRestore, onClose, testId = "workspace-tray", renderItem, }) {
|
|
@@ -30,7 +40,7 @@ export function WorkspaceTray({ items, onRestore, onClose, testId = "workspace-t
|
|
|
30
40
|
return null;
|
|
31
41
|
return (
|
|
32
42
|
// NOTE: floating bottom-right cluster (Gmail/Jira pattern), not a docked bar — needs no reserved page gutter.
|
|
33
|
-
_jsx(Flex, { position: "fixed", bottom: 4, right: 4, zIndex:
|
|
43
|
+
_jsx(Flex, { position: "fixed", bottom: 4, right: 4, zIndex: zIndices.modal, direction: "row-reverse", wrap: "wrap-reverse", justify: "flex-start", gap: 2, maxW: { base: "calc(100vw - 2rem)", md: "36rem" }, "data-testid": testId, children: items.map((item) => {
|
|
34
44
|
const api = {
|
|
35
45
|
restore: () => onRestore === null || onRestore === void 0 ? void 0 : onRestore(item.id),
|
|
36
46
|
close: () => onClose === null || onClose === void 0 ? void 0 : onClose(item.id),
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const subscribers = new Map();
|
|
2
|
+
const suspendedRoots = new Map();
|
|
3
|
+
const deferred = new Map();
|
|
4
|
+
let observer = null;
|
|
5
|
+
const supported = () => typeof window !== "undefined" && typeof ResizeObserver !== "undefined";
|
|
6
|
+
const isSuspended = (target) => {
|
|
7
|
+
for (const root of suspendedRoots.keys())
|
|
8
|
+
if (root.contains(target))
|
|
9
|
+
return true;
|
|
10
|
+
return false;
|
|
11
|
+
};
|
|
12
|
+
const notify = (entry) => {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = subscribers.get(entry.target)) === null || _a === void 0 ? void 0 : _a.forEach((sub) => sub.callback(entry));
|
|
15
|
+
};
|
|
16
|
+
const dispatch = (entries) => {
|
|
17
|
+
entries.forEach((entry) => {
|
|
18
|
+
if (isSuspended(entry.target))
|
|
19
|
+
deferred.set(entry.target, entry);
|
|
20
|
+
else
|
|
21
|
+
notify(entry);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
/** Observes `element` on the one shared ResizeObserver; returns the unsubscribe. A no-op where ResizeObserver is missing. */
|
|
25
|
+
export function observeResize(element, callback) {
|
|
26
|
+
if (!supported())
|
|
27
|
+
return () => undefined;
|
|
28
|
+
observer !== null && observer !== void 0 ? observer : (observer = new ResizeObserver(dispatch));
|
|
29
|
+
let subs = subscribers.get(element);
|
|
30
|
+
if (!subs) {
|
|
31
|
+
subs = new Set();
|
|
32
|
+
subscribers.set(element, subs);
|
|
33
|
+
observer.observe(element);
|
|
34
|
+
}
|
|
35
|
+
const sub = { callback };
|
|
36
|
+
subs.add(sub);
|
|
37
|
+
return () => {
|
|
38
|
+
const current = subscribers.get(element);
|
|
39
|
+
if (!(current === null || current === void 0 ? void 0 : current.delete(sub)) || current.size > 0)
|
|
40
|
+
return;
|
|
41
|
+
subscribers.delete(element);
|
|
42
|
+
deferred.delete(element);
|
|
43
|
+
observer === null || observer === void 0 ? void 0 : observer.unobserve(element);
|
|
44
|
+
if (subscribers.size === 0) {
|
|
45
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
46
|
+
observer = null;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Defers callbacks for elements inside `root` until the returned resume runs, then delivers each element's latest entry once. */
|
|
51
|
+
export function suspendResizeWithin(root) {
|
|
52
|
+
var _a;
|
|
53
|
+
suspendedRoots.set(root, ((_a = suspendedRoots.get(root)) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
54
|
+
let resumed = false;
|
|
55
|
+
return () => {
|
|
56
|
+
var _a;
|
|
57
|
+
if (resumed)
|
|
58
|
+
return;
|
|
59
|
+
resumed = true;
|
|
60
|
+
const depth = ((_a = suspendedRoots.get(root)) !== null && _a !== void 0 ? _a : 1) - 1;
|
|
61
|
+
if (depth > 0) {
|
|
62
|
+
suspendedRoots.set(root, depth);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
suspendedRoots.delete(root);
|
|
66
|
+
deferred.forEach((entry, target) => {
|
|
67
|
+
if (isSuspended(target))
|
|
68
|
+
return;
|
|
69
|
+
deferred.delete(target);
|
|
70
|
+
notify(entry);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { observeResize } from "./sharedResizeObserver.js";
|
|
2
3
|
// NOTE: compares scrollWidth/Height vs clientWidth/Height to detect real ellipsis truncation; re-measures via ResizeObserver.
|
|
3
4
|
export function useIsTruncated(content, enabled = true) {
|
|
4
5
|
const ref = useRef(null);
|
|
@@ -14,11 +15,9 @@ export function useIsTruncated(content, enabled = true) {
|
|
|
14
15
|
return;
|
|
15
16
|
measure();
|
|
16
17
|
const el = ref.current;
|
|
17
|
-
if (!el
|
|
18
|
+
if (!el)
|
|
18
19
|
return;
|
|
19
|
-
|
|
20
|
-
observer.observe(el);
|
|
21
|
-
return () => observer.disconnect();
|
|
20
|
+
return observeResize(el, measure);
|
|
22
21
|
}, [measure, content, enabled]);
|
|
23
22
|
return { ref, isTruncated };
|
|
24
23
|
}
|
|
@@ -5,18 +5,44 @@ import { componentStyles } from "./componentStyles.js";
|
|
|
5
5
|
import { resolveFilledSurface } from "../tokens/builders/filledSurface.js";
|
|
6
6
|
import { globalScrollbarStyles } from "../tokens/builders/scrollbar.js";
|
|
7
7
|
import { focusRingShadow } from "./focusRing.styles.js";
|
|
8
|
+
import { shadowsFor } from "../tokens/primitives/shadows.js";
|
|
9
|
+
import { reducedMotionGlobalStyles } from "./motion.js";
|
|
10
|
+
import { TEXT_STYLES } from "../tokens/primitives/typography.js";
|
|
11
|
+
import { memoiseByReads } from "../tokens/builders/memoByReads.js";
|
|
12
|
+
const memoisedStyle = (value) => typeof value === "function" ? memoiseByReads(value) : value;
|
|
13
|
+
const memoisedGroup = (group) => Object.fromEntries(Object.entries(group).map(([key, value]) => [key, memoisedStyle(value)]));
|
|
14
|
+
const memoisedConfig = (config) => Object.fromEntries(Object.entries(config).map(([key, value]) => [
|
|
15
|
+
key,
|
|
16
|
+
key === "baseStyle"
|
|
17
|
+
? memoisedStyle(value)
|
|
18
|
+
: key === "variants" || key === "sizes"
|
|
19
|
+
? memoisedGroup(value)
|
|
20
|
+
: value,
|
|
21
|
+
]));
|
|
22
|
+
// NOTE: extendTheme deep-merges Chakra's and our style output on every call; cache it per theme.
|
|
23
|
+
const withMemoisedStyles = (theme) => {
|
|
24
|
+
const components = theme.components;
|
|
25
|
+
return {
|
|
26
|
+
...theme,
|
|
27
|
+
components: {
|
|
28
|
+
...components,
|
|
29
|
+
...Object.fromEntries(Object.keys(componentStyles).map((name) => [name, memoisedConfig(components[name])])),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
8
33
|
// Builds a Chakra theme from a pure brand palette — dark mode works by swapping which palette it carries.
|
|
9
34
|
export const createBrandTheme = (palette, options = {}) => {
|
|
10
35
|
var _a;
|
|
11
36
|
const colorMode = (_a = options.colorMode) !== null && _a !== void 0 ? _a : "light";
|
|
37
|
+
const motionRule = options.reducedMotion === "global" ? reducedMotionGlobalStyles : {};
|
|
12
38
|
const brand = {
|
|
13
39
|
colors: palette,
|
|
14
40
|
...fonts,
|
|
15
41
|
...common,
|
|
16
42
|
// NOTE: binds the palette-derived ring to shadows.outline — Chakra's stock one failed 1.4.11 on every brand.
|
|
17
|
-
shadows: { ...
|
|
43
|
+
shadows: { ...shadowsFor(colorMode), outline: focusRingShadow(palette) },
|
|
18
44
|
};
|
|
19
|
-
return extendTheme({
|
|
45
|
+
return withMemoisedStyles(extendTheme({
|
|
20
46
|
...brand,
|
|
21
47
|
config: {
|
|
22
48
|
...common.config,
|
|
@@ -64,11 +90,15 @@ export const createBrandTheme = (palette, options = {}) => {
|
|
|
64
90
|
WebkitTextFillColor: palette.text[900],
|
|
65
91
|
caretColor: palette.text[900],
|
|
66
92
|
},
|
|
93
|
+
...motionRule,
|
|
67
94
|
},
|
|
68
95
|
},
|
|
69
96
|
}
|
|
70
|
-
:
|
|
97
|
+
: options.reducedMotion === "global"
|
|
98
|
+
? { styles: { global: motionRule } }
|
|
99
|
+
: {}),
|
|
100
|
+
textStyles: TEXT_STYLES,
|
|
71
101
|
components: componentStyles,
|
|
72
|
-
});
|
|
102
|
+
}));
|
|
73
103
|
};
|
|
74
104
|
export default createBrandTheme;
|
|
@@ -6,6 +6,9 @@ export const FOCUS_RING_WIDTH = 4;
|
|
|
6
6
|
// NOTE: a box-shadow, not an outline — drawn outside the border box so it never resizes the control.
|
|
7
7
|
export const focusRingShadow = (colors) => `0 0 0 ${FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
8
8
|
`0 0 0 ${FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
9
|
+
/** For controls whose rounded shell clips overflow: the same halo and ring, drawn inside the border box. */
|
|
10
|
+
export const insetFocusRingShadow = (colors) => `inset 0 0 0 ${FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
11
|
+
`inset 0 0 0 ${FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
9
12
|
// NOTE: stacked pseudo-classes raise specificity above Chakra's _hover, so a hovered+focused button keeps its ring.
|
|
10
13
|
export const FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
11
14
|
// NOTE: transparent outline isn't decorative — forced-colors mode drops box-shadow but repaints an outline.
|
|
@@ -6,3 +6,28 @@ export const usePrefersReducedMotion = () => useMatchMedia(MEDIA, false);
|
|
|
6
6
|
export const reducedMotionSx = (overrides = {}) => ({
|
|
7
7
|
[REDUCED_MOTION_QUERY]: { transition: "none", animation: "none", ...overrides },
|
|
8
8
|
});
|
|
9
|
+
/** Add to an element whose loop is essential feedback; it and its subtree keep moving. */
|
|
10
|
+
export const MOTION_KEEP_CLASS = "pz-motion-keep";
|
|
11
|
+
const KEPT = [
|
|
12
|
+
".chakra-spinner",
|
|
13
|
+
".chakra-progress",
|
|
14
|
+
".chakra-progress *",
|
|
15
|
+
`.${MOTION_KEEP_CLASS}`,
|
|
16
|
+
`.${MOTION_KEEP_CLASS} *`,
|
|
17
|
+
];
|
|
18
|
+
const notKept = KEPT.map((selector) => `:not(${selector})`).join("");
|
|
19
|
+
export const REDUCED_MOTION_SELECTOR = [
|
|
20
|
+
`*${notKept}`,
|
|
21
|
+
`*${notKept}::before`,
|
|
22
|
+
`*${notKept}::after`,
|
|
23
|
+
].join(", ");
|
|
24
|
+
export const reducedMotionGlobalStyles = {
|
|
25
|
+
[REDUCED_MOTION_QUERY]: {
|
|
26
|
+
[REDUCED_MOTION_SELECTOR]: {
|
|
27
|
+
transitionDuration: "0.01ms !important",
|
|
28
|
+
animationDuration: "0.01ms !important",
|
|
29
|
+
animationIterationCount: "1 !important",
|
|
30
|
+
scrollBehavior: "auto !important",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
package/dist/esm/Theme/index.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import createBrandTheme from "./chakra/createBrandTheme.js";
|
|
2
2
|
import { lightPalettes, darkPalettes } from "./tokens/brands/index.js";
|
|
3
|
-
|
|
3
|
+
import { lazyObject } from "./tokens/builders/lazy.js";
|
|
4
|
+
// NOTE: lavender is built at import as the shape template — every light theme shares its keys.
|
|
4
5
|
const lavender = createBrandTheme(lightPalettes.lavender);
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
6
|
+
const lightThemeKeys = Object.keys(lavender);
|
|
7
|
+
const lazyLightTheme = (brand) => lazyObject(lightThemeKeys, () => createBrandTheme(lightPalettes[brand]));
|
|
8
|
+
const meadow = lazyLightTheme("meadow");
|
|
9
|
+
const radiant = lazyLightTheme("radiant");
|
|
10
|
+
const skyline = lazyLightTheme("skyline");
|
|
11
|
+
const slate = lazyLightTheme("slate");
|
|
12
|
+
const emerald = lazyLightTheme("emerald");
|
|
13
|
+
const rosewood = lazyLightTheme("rosewood");
|
|
14
|
+
const storefront = lazyLightTheme("storefront");
|
|
15
|
+
const zinc = lazyLightTheme("zinc");
|
|
13
16
|
export { skyline, meadow, radiant, lavender, slate, emerald, rosewood, storefront, zinc };
|
|
14
17
|
// NOTE: consumers iterate this to render theme pickers — key order is load-bearing. Stays light-only.
|
|
15
18
|
export const ThemesList = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
2
|
+
import { createContext, useCallback, useDeferredValue, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
3
3
|
import { ChakraProvider, extendTheme } from "@chakra-ui/react";
|
|
4
4
|
import { brandThemes } from "../index.js";
|
|
5
5
|
import ToasterProvider from "../../Components/Toaster/Toaster.js";
|
|
6
|
+
import { reducedMotionGlobalStyles } from "../chakra/motion.js";
|
|
6
7
|
import { getSystemColorMode, readStoredTheme, subscribeToSystemColorMode, writeStoredTheme, } from "./colorModeStorage.js";
|
|
7
8
|
const DEFAULT_BRAND = "lavender";
|
|
8
9
|
const DEFAULT_MODE = "system";
|
|
@@ -16,7 +17,7 @@ const forcedLightColorModeManager = {
|
|
|
16
17
|
};
|
|
17
18
|
export const ThemeModeContext = createContext(undefined);
|
|
18
19
|
// NOTE: Chakra's own color mode stays unsynced from resolvedMode — its built-in `_dark:` blocks assume the opposite ramp direction. Read mode via useThemeMode(), not useColorModeValue().
|
|
19
|
-
export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, onBrandChange, defaultMode = DEFAULT_MODE, onModeChange, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, themeOverrides, }) => {
|
|
20
|
+
export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, onBrandChange, defaultMode = DEFAULT_MODE, onModeChange, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, themeOverrides, reducedMotion = "components", }) => {
|
|
20
21
|
const [mode, setModeState] = useState(() => { var _a; return (_a = (disablePersistence ? undefined : readStoredTheme(storageKey).mode)) !== null && _a !== void 0 ? _a : defaultMode; });
|
|
21
22
|
const [brand, setBrandState] = useState(() => { var _a; return (_a = (disablePersistence ? undefined : readStoredTheme(storageKey).brand)) !== null && _a !== void 0 ? _a : brandProp; });
|
|
22
23
|
const [systemMode, setSystemMode] = useState(getSystemColorMode);
|
|
@@ -58,14 +59,17 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
|
|
|
58
59
|
writeStoredTheme(storageKey, { mode, brand });
|
|
59
60
|
}, [mode, brand, disablePersistence, storageKey]);
|
|
60
61
|
const resolvedMode = mode === "system" ? systemMode : mode;
|
|
62
|
+
// NOTE: the page re-themes in an interruptible second commit; the switcher paints first.
|
|
63
|
+
const appliedMode = useDeferredValue(resolvedMode);
|
|
64
|
+
const appliedBrand = useDeferredValue(brand);
|
|
61
65
|
// NOTE: sets CSS color-scheme so native chrome (select popups, date pickers) matches the mode.
|
|
62
66
|
useLayoutEffect(() => {
|
|
63
|
-
document.documentElement.style.colorScheme =
|
|
64
|
-
}, [
|
|
67
|
+
document.documentElement.style.colorScheme = appliedMode;
|
|
68
|
+
}, [appliedMode]);
|
|
65
69
|
// NOTE: re-asserted after Chakra's own ColorModeProvider effect overwrites it back to "light".
|
|
66
70
|
useEffect(() => {
|
|
67
|
-
document.documentElement.style.colorScheme =
|
|
68
|
-
}, [
|
|
71
|
+
document.documentElement.style.colorScheme = appliedMode;
|
|
72
|
+
}, [appliedMode]);
|
|
69
73
|
const onModeChangeRef = useRef(onModeChange);
|
|
70
74
|
const onBrandChangeRef = useRef(onBrandChange);
|
|
71
75
|
useLayoutEffect(() => {
|
|
@@ -87,14 +91,18 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
|
|
|
87
91
|
// NOTE: keyed by value, not identity — themeOverrides is usually an inline literal.
|
|
88
92
|
const overridesKey = themeOverrides ? JSON.stringify(themeOverrides) : "";
|
|
89
93
|
const resolvedTheme = useMemo(() => {
|
|
90
|
-
const base = brandThemes[
|
|
91
|
-
|
|
94
|
+
const base = brandThemes[appliedBrand][appliedMode];
|
|
95
|
+
const extensions = [
|
|
96
|
+
...(reducedMotion === "global" ? [{ styles: { global: reducedMotionGlobalStyles } }] : []),
|
|
97
|
+
...(themeOverrides ? [themeOverrides] : []),
|
|
98
|
+
];
|
|
99
|
+
return extensions.length ? extendTheme(base, ...extensions) : base;
|
|
92
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
|
-
}, [
|
|
101
|
+
}, [appliedBrand, appliedMode, overridesKey, reducedMotion]);
|
|
94
102
|
// NOTE: global.css ships var(--color-*) light-only — re-point them here in dark, clear in light.
|
|
95
103
|
useLayoutEffect(() => {
|
|
96
104
|
const root = document.documentElement;
|
|
97
|
-
root.dataset.mode =
|
|
105
|
+
root.dataset.mode = appliedMode;
|
|
98
106
|
const { colors } = resolvedTheme;
|
|
99
107
|
const { gray, semantic } = colors;
|
|
100
108
|
const HUE_SCALES = [
|
|
@@ -118,7 +126,7 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
|
|
|
118
126
|
const set = (name, val) => root.style.setProperty(`--color-${name}`, val);
|
|
119
127
|
const clear = (name) => root.style.removeProperty(`--color-${name}`);
|
|
120
128
|
const allRampNames = [...HUE_SCALES, ...SEMANTIC_SCALES].flatMap((s) => RUNGS.map((r) => `${s}-${r}`));
|
|
121
|
-
if (
|
|
129
|
+
if (appliedMode === "dark") {
|
|
122
130
|
for (const s of HUE_SCALES)
|
|
123
131
|
for (const r of RUNGS)
|
|
124
132
|
set(`${s}-${r}`, colors[s][r]);
|
|
@@ -134,6 +142,7 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
|
|
|
134
142
|
for (const name of Object.keys(SEMANTIC_VARS))
|
|
135
143
|
clear(name);
|
|
136
144
|
}
|
|
137
|
-
}, [
|
|
138
|
-
|
|
145
|
+
}, [appliedMode, resolvedTheme]);
|
|
146
|
+
const themedTree = useMemo(() => (_jsx(ChakraProvider, { theme: resolvedTheme, colorModeManager: forcedLightColorModeManager, children: _jsx(ToasterProvider, { children: children }) })), [resolvedTheme, children]);
|
|
147
|
+
return _jsx(ThemeModeContext.Provider, { value: value, children: themedTree });
|
|
139
148
|
};
|
|
@@ -3,6 +3,7 @@ import { useRef, useState } from "react";
|
|
|
3
3
|
import { Box, Button, HStack, IconButton, Menu, MenuButton, MenuDivider, MenuItemOption, MenuList, MenuOptionGroup, Text, Tooltip, } from "@chakra-ui/react";
|
|
4
4
|
import { Monitor, Moon, Sun } from "lucide-react";
|
|
5
5
|
import { brandThemes } from "../index.js";
|
|
6
|
+
import { lightPalettes } from "../tokens/brands/index.js";
|
|
6
7
|
import { useCustomTheme } from "../useCustomTheme.js";
|
|
7
8
|
import { useThemeMode } from "./useThemeMode.js";
|
|
8
9
|
import { focusGlowShadow, focusVisibleRing } from "../chakra/focusRing.styles.js";
|
|
@@ -18,8 +19,8 @@ const SIZES = {
|
|
|
18
19
|
lg: { control: "lg", icon: 18 },
|
|
19
20
|
};
|
|
20
21
|
const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
21
|
-
// NOTE:
|
|
22
|
-
const brandSwatchColor = (brand) =>
|
|
22
|
+
// NOTE: reads the brand's own palette, not its Chakra theme, so the picker builds no themes.
|
|
23
|
+
const brandSwatchColor = (brand) => lightPalettes[brand].primary[500];
|
|
23
24
|
const BrandSwatch = ({ brand }) => {
|
|
24
25
|
const { colors } = useCustomTheme();
|
|
25
26
|
return (_jsx(Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: colors.boxborder[200], flexShrink: 0 }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -26,6 +26,7 @@ import { buildFocusRing, withFocusRing } from "../builders/focusRing.js";
|
|
|
26
26
|
import { withSurfaceRungs } from "../builders/surfaceRungs.js";
|
|
27
27
|
import { buildSurfaceRaised, withSurfaceRaised } from "../builders/surfaceRaised.js";
|
|
28
28
|
import { buildStar } from "../builders/star.js";
|
|
29
|
+
import { lazyPalette } from "../builders/lazy.js";
|
|
29
30
|
/** Derived, never hand-written: a copied hex goes stale the moment a canvas moves. */
|
|
30
31
|
export const finalizeLightPalette = (source) => ({
|
|
31
32
|
...source,
|
|
@@ -43,8 +44,8 @@ export { lavender, meadow, radiant, skyline, slate, emerald, rosewood, storefron
|
|
|
43
44
|
export { lavenderDark, meadowDark, radiantDark, skylineDark, slateDark, emeraldDark, rosewoodDark, storefrontDark, zincDark, };
|
|
44
45
|
// NOTE: withFocusRing is outermost — it must see primary and surfaces together, after every earlier step.
|
|
45
46
|
const resolveRungs = (palette) => withFocusRing(withSurfaceRungs(withSurfaceRaised(withTableHoverRung(withPlaceholderRung(withOutlineRung(palette))))));
|
|
46
|
-
const lightBrand = (source) => resolveRungs(finalizeLightPalette(source));
|
|
47
|
-
/** Light palette per brand. `lavender` is the base the other six extend. */
|
|
47
|
+
const lightBrand = (source) => lazyPalette(source, () => resolveRungs(finalizeLightPalette(source)));
|
|
48
|
+
/** Light palette per brand, derived on first read. `lavender` is the base the other six extend. */
|
|
48
49
|
export const lightPalettes = {
|
|
49
50
|
lavender: lightBrand(lavender),
|
|
50
51
|
meadow: lightBrand(meadow),
|
|
@@ -56,18 +57,18 @@ export const lightPalettes = {
|
|
|
56
57
|
storefront: lightBrand(storefront),
|
|
57
58
|
zinc: lightBrand(zinc),
|
|
58
59
|
};
|
|
59
|
-
/** Dark palette per brand, derived from the matching light palette. */
|
|
60
|
-
const darkBrand = (dark) => resolveRungs(dark);
|
|
60
|
+
/** Dark palette per brand, derived from the matching light palette on first read. */
|
|
61
|
+
const darkBrand = (source, dark) => lazyPalette(source, () => resolveRungs(dark));
|
|
61
62
|
export const darkPalettes = {
|
|
62
|
-
lavender: darkBrand(lavenderDark),
|
|
63
|
-
meadow: darkBrand(meadowDark),
|
|
64
|
-
radiant: darkBrand(radiantDark),
|
|
65
|
-
skyline: darkBrand(skylineDark),
|
|
66
|
-
slate: darkBrand(slateDark),
|
|
67
|
-
emerald: darkBrand(emeraldDark),
|
|
68
|
-
rosewood: darkBrand(rosewoodDark),
|
|
69
|
-
storefront: darkBrand(storefrontDark),
|
|
70
|
-
zinc: darkBrand(zincDark),
|
|
63
|
+
lavender: darkBrand(lavender, lavenderDark),
|
|
64
|
+
meadow: darkBrand(meadow, meadowDark),
|
|
65
|
+
radiant: darkBrand(radiant, radiantDark),
|
|
66
|
+
skyline: darkBrand(skyline, skylineDark),
|
|
67
|
+
slate: darkBrand(slate, slateDark),
|
|
68
|
+
emerald: darkBrand(emerald, emeraldDark),
|
|
69
|
+
rosewood: darkBrand(rosewood, rosewoodDark),
|
|
70
|
+
storefront: darkBrand(storefront, storefrontDark),
|
|
71
|
+
zinc: darkBrand(zinc, zincDark),
|
|
71
72
|
};
|
|
72
73
|
// Built from lightPalettes/darkPalettes (not the raw literals) so accentText can never be
|
|
73
74
|
// present on one map and missing on the other.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
2
3
|
import light from "./palette.light.js";
|
|
3
|
-
const palette = buildDarkPalette(light);
|
|
4
|
+
const palette = lazyPalette(light, () => buildDarkPalette(light));
|
|
4
5
|
export default palette;
|