pixelize-design-library 2.4.2-beta.61 → 2.4.2-beta.63
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 +228 -2
- package/COMPONENT-GOTCHAS.md +144 -7
- package/DESIGN-GUIDE.md +12 -5
- 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/Button/Button.styles.js +51 -21
- 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/CardProps.d.ts +2 -2
- 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/ConfirmDialog/ConfirmDialog.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/CustomModulesTable.js +6 -4
- package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +18 -0
- package/dist/Components/CustomModulesTable/EditModuleModal.js +2 -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 +8 -6
- package/dist/Components/DatePicker/SingleDatePicker.d.ts +9 -5
- package/dist/Components/DatePicker/SingleDatePicker.js +9 -5
- 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 +8 -5
- package/dist/Components/DatePicker/TimePickerInput.d.ts +2 -2
- package/dist/Components/DatePicker/TimePickerInput.js +6 -5
- package/dist/Components/DatePicker/dayStates.js +2 -1
- 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/Drawer/Drawer.js +2 -1
- package/dist/Components/Dropdown/DropDown.js +13 -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 +28 -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 +15 -8
- 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 +7 -4
- 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 +5 -4
- package/dist/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +12 -0
- package/dist/Components/Notification/Notification.js +18 -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/NotificationBell/NotificationPanel.js +4 -3
- 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/CreateOrgModal.js +2 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +10 -2
- 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 +9 -4
- 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 +157 -49
- package/dist/Components/SearchSelect/searchSelectNav.d.ts +13 -0
- package/dist/Components/SearchSelect/searchSelectNav.js +40 -0
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +8 -2
- package/dist/Components/SegmentedControl/SegmentedControl.js +9 -5
- package/dist/Components/Select/SelectPopup.js +7 -4
- package/dist/Components/SelectSearch/SelectSearch.js +6 -4
- package/dist/Components/SettingRow/SettingRow.js +2 -1
- package/dist/Components/SettingRow/SettingsSection.js +2 -1
- package/dist/Components/SideBar/SecondaryBar.js +5 -3
- package/dist/Components/SideBar/SideBar.js +96 -32
- package/dist/Components/SideBar/SideBarProps.d.ts +1 -1
- package/dist/Components/SideBar/components/MenuItemBox.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +11 -7
- package/dist/Components/SideBar/components/MenuItems.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItems.js +3 -3
- package/dist/Components/SideBar/components/MenuPopoverContent.js +2 -1
- package/dist/Components/SideBar/components/OtherApps.js +7 -2
- package/dist/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/Components/SideBar/components/PinnedSection.js +8 -5
- package/dist/Components/SideBar/components/TextTruncation.js +11 -6
- package/dist/Components/SideBar/sidebarMotion.d.ts +2 -0
- package/dist/Components/SideBar/sidebarMotion.js +6 -0
- package/dist/Components/SideBar/sidebarScale.d.ts +1 -1
- package/dist/Components/SideBar/sidebarScale.js +2 -1
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +6 -4
- 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 +7 -7
- package/dist/Components/StageProgress/StageProgress.js +2 -1
- package/dist/Components/StageProgress/StageProgressProps.d.ts +1 -1
- package/dist/Components/StageProgress/StepperStage.js +4 -8
- 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 +6 -4
- package/dist/Components/StatCard/StatCardProps.d.ts +3 -3
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +1 -1
- package/dist/Components/Table/Table.js +6 -2
- package/dist/Components/Table/components/TableActions.js +41 -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/CompactSelect.js +2 -1
- package/dist/Components/Table/filters/TableFilters.js +2 -13
- package/dist/Components/Table/hooks/useTable.js +12 -9
- package/dist/Components/Table/settings/TableSettings.js +7 -2
- package/dist/Components/Table/variants/classic.js +3 -2
- 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 +21 -12
- package/dist/Components/Toaster/Toaster.js +20 -8
- package/dist/Components/Toggle/TableToggle.js +8 -4
- 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/AddUserModal.js +2 -1
- package/dist/Components/UserDetails/ChangeRoleModal.js +2 -1
- package/dist/Components/UserDetails/UserDetails.js +10 -2
- 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/Card.styles.d.ts +7 -1
- package/dist/Theme/chakra/Card.styles.js +4 -1
- package/dist/Theme/chakra/Menu.styles.d.ts +4 -6
- package/dist/Theme/chakra/Menu.styles.js +3 -0
- package/dist/Theme/chakra/Popover.styles.d.ts +2 -11
- package/dist/Theme/chakra/Popover.styles.js +2 -0
- package/dist/Theme/chakra/common.web.d.ts +5 -0
- package/dist/Theme/chakra/componentStyles.d.ts +12 -4
- package/dist/Theme/chakra/componentStyles.js +10 -6
- 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 +15 -0
- package/dist/Theme/chakra/motion.js +27 -1
- package/dist/Theme/chakra/overlay.styles.d.ts +5 -0
- package/dist/Theme/chakra/overlay.styles.js +4 -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 +7 -0
- package/dist/Theme/tokens/brands/emerald/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/index.d.ts +2 -1
- package/dist/Theme/tokens/brands/index.js +31 -14
- 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/radiant/palette.light.js +15 -0
- package/dist/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/rosewood/palette.light.js +10 -10
- 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.d.ts +7 -29
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +27 -55
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +6 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +37 -8
- 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/mutedText.d.ts +1 -1
- package/dist/Theme/tokens/builders/mutedText.js +13 -3
- package/dist/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/Theme/tokens/builders/planeStep.d.ts +4 -0
- package/dist/Theme/tokens/builders/planeStep.js +20 -0
- package/dist/Theme/tokens/builders/planes.d.ts +4 -0
- package/dist/Theme/tokens/builders/planes.js +33 -0
- package/dist/Theme/tokens/builders/skeletonShimmer.d.ts +9 -0
- package/dist/Theme/tokens/builders/skeletonShimmer.js +25 -0
- package/dist/Theme/tokens/builders/surfaceRaised.d.ts +3 -1
- package/dist/Theme/tokens/builders/surfaceRaised.js +18 -8
- package/dist/Theme/tokens/builders/surfaceRungs.js +3 -1
- 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 +11 -1
- package/dist/Theme/tokens/primitives/motion.d.ts +26 -2
- package/dist/Theme/tokens/primitives/motion.js +24 -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 +21 -1
- package/dist/Theme/tokens/primitives/shadows.js +59 -5
- 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 +22 -2
- 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/Button/Button.styles.js +54 -24
- 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/ConfirmDialog/ConfirmDialog.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/CustomModulesTable.js +6 -4
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +2 -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 +10 -7
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +9 -5
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +7 -4
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +7 -4
- package/dist/esm/Components/DatePicker/TimePickerInput.js +8 -6
- package/dist/esm/Components/DatePicker/dayStates.js +2 -1
- package/dist/esm/Components/DescriptionList/DescriptionList.js +3 -3
- package/dist/esm/Components/Drawer/Drawer.js +2 -1
- package/dist/esm/Components/Dropdown/DropDown.js +13 -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 +29 -16
- 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 +15 -8
- 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 +7 -4
- 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 +5 -4
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/esm/Components/Notification/Notification.js +18 -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/NotificationBell/NotificationPanel.js +4 -3
- 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/CreateOrgModal.js +2 -1
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +10 -2
- 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 +9 -4
- 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 +160 -52
- package/dist/esm/Components/SearchSelect/searchSelectNav.js +32 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +11 -6
- package/dist/esm/Components/Select/SelectPopup.js +7 -4
- package/dist/esm/Components/SelectSearch/SelectSearch.js +6 -4
- package/dist/esm/Components/SettingRow/SettingRow.js +2 -1
- package/dist/esm/Components/SettingRow/SettingsSection.js +2 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +5 -3
- package/dist/esm/Components/SideBar/SideBar.js +98 -34
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +11 -7
- package/dist/esm/Components/SideBar/components/MenuItems.js +4 -4
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +2 -1
- package/dist/esm/Components/SideBar/components/OtherApps.js +4 -2
- package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/esm/Components/SideBar/components/PinnedSection.js +8 -5
- package/dist/esm/Components/SideBar/components/TextTruncation.js +9 -7
- package/dist/esm/Components/SideBar/sidebarMotion.js +3 -0
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -1
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +6 -4
- 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 +7 -7
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -1
- package/dist/esm/Components/StageProgress/StepperStage.js +4 -8
- package/dist/esm/Components/StageProgress/centerInStrip.js +11 -0
- package/dist/esm/Components/StatCard/StatCard.js +6 -4
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -2
- package/dist/esm/Components/Table/Table.js +8 -4
- package/dist/esm/Components/Table/components/TableActions.js +43 -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/CompactSelect.js +2 -1
- package/dist/esm/Components/Table/filters/TableFilters.js +3 -14
- package/dist/esm/Components/Table/hooks/useTable.js +12 -9
- package/dist/esm/Components/Table/settings/TableSettings.js +8 -3
- package/dist/esm/Components/Table/variants/classic.js +3 -2
- 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 +21 -12
- package/dist/esm/Components/Toaster/Toaster.js +21 -9
- package/dist/esm/Components/Toggle/TableToggle.js +8 -4
- 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/AddUserModal.js +2 -1
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +2 -1
- package/dist/esm/Components/UserDetails/UserDetails.js +10 -2
- 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/Card.styles.js +4 -1
- package/dist/esm/Theme/chakra/Menu.styles.js +3 -0
- package/dist/esm/Theme/chakra/Popover.styles.js +2 -0
- package/dist/esm/Theme/chakra/componentStyles.js +10 -6
- 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 +26 -0
- package/dist/esm/Theme/chakra/overlay.styles.js +3 -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 +30 -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/radiant/palette.light.js +15 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +10 -10
- 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 +27 -55
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +38 -9
- 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/mutedText.js +12 -2
- package/dist/esm/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/esm/Theme/tokens/builders/planeStep.js +14 -0
- package/dist/esm/Theme/tokens/builders/planes.js +28 -0
- package/dist/esm/Theme/tokens/builders/skeletonShimmer.js +21 -0
- package/dist/esm/Theme/tokens/builders/surfaceRaised.js +16 -7
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +3 -1
- 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 +21 -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 +56 -5
- package/dist/esm/Theme/tokens/primitives/states.js +1 -0
- package/dist/esm/Theme/tokens/primitives/typography.js +21 -1
- package/dist/esm/Theme/tokens/primitives/zIndices.js +1 -0
- package/dist/esm/Utils/formatDate.js +138 -0
- package/dist/esm/index.js +19 -2
- package/dist/index.d.ts +34 -5
- package/dist/index.js +51 -4
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
|
2
2
|
import { rotateScaleHue } from "../../builders/brandInk.js";
|
|
3
3
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
4
4
|
import { pickAccentText, onFilled } from "../../builders/accentText.js";
|
|
5
|
+
import { lazyPalette } from "../../builders/lazy.js";
|
|
5
6
|
import light from "./palette.light.js";
|
|
6
7
|
// NOTE: zinc dark INVERTS the primary (near-white fill, dark label) to match shadcn — every other brand lifts its own hue instead. Most ramps below are literals ported from Mobile-Components.
|
|
7
|
-
const derived = buildDarkPalette(light);
|
|
8
8
|
const PRIMARY_500 = "#e4e4e7";
|
|
9
9
|
const SECONDARY_500 = "#a1a1aa";
|
|
10
10
|
const primary = {
|
|
@@ -33,19 +33,6 @@ const secondary = {
|
|
|
33
33
|
900: "#fafafa",
|
|
34
34
|
opacity: buildPrimaryOpacity(SECONDARY_500),
|
|
35
35
|
};
|
|
36
|
-
// background[50] = the elevated surface (#0e0e11), resolved through a token, not a literal.
|
|
37
|
-
const background = {
|
|
38
|
-
50: "#0e0e11",
|
|
39
|
-
100: "#131316",
|
|
40
|
-
200: "#18181b",
|
|
41
|
-
300: "#212124",
|
|
42
|
-
400: "#27272a",
|
|
43
|
-
500: "#3f3f46",
|
|
44
|
-
600: "#52525b",
|
|
45
|
-
700: "#71717a",
|
|
46
|
-
800: "#a1a1aa",
|
|
47
|
-
900: "#d4d4d8",
|
|
48
|
-
};
|
|
49
36
|
const text = {
|
|
50
37
|
50: "#71717a",
|
|
51
38
|
100: "#8a8a93",
|
|
@@ -71,10 +58,7 @@ const header = {
|
|
|
71
58
|
900: "#ffffff",
|
|
72
59
|
};
|
|
73
60
|
// NOTE: gray[400] is the one value here NOT ported verbatim — pinned to clear the 3:1 non-text bar (shadcn's own measures 2.81).
|
|
74
|
-
const
|
|
75
|
-
50: "#18181b",
|
|
76
|
-
100: "#27272a",
|
|
77
|
-
200: "#3f3f46",
|
|
61
|
+
const grayInk = {
|
|
78
62
|
300: "#52525b",
|
|
79
63
|
400: "#7a7a83",
|
|
80
64
|
500: "#a1a1aa",
|
|
@@ -132,42 +116,30 @@ const disabled = {
|
|
|
132
116
|
800: "#a1a1aa",
|
|
133
117
|
900: "#d4d4d8",
|
|
134
118
|
};
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
gray,
|
|
160
|
-
border,
|
|
161
|
-
boxborder,
|
|
162
|
-
placeholder,
|
|
163
|
-
disabled,
|
|
164
|
-
table,
|
|
165
|
-
accentText: pickAccentText(primary, derived.backgroundColor.main),
|
|
166
|
-
onPrimary: onFilled(PRIMARY_500, derived.white, derived.black),
|
|
167
|
-
boxShadow: {
|
|
168
|
-
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
169
|
-
error: derived.boxShadow.error,
|
|
170
|
-
default: "#00000080",
|
|
171
|
-
},
|
|
119
|
+
const buildPalette = () => {
|
|
120
|
+
const derived = buildDarkPalette(light);
|
|
121
|
+
return {
|
|
122
|
+
...derived,
|
|
123
|
+
gradient: { from: PRIMARY_500, to: "#a1a1aa" },
|
|
124
|
+
primary,
|
|
125
|
+
secondary,
|
|
126
|
+
tertiary: { ...rotateScaleHue(secondary), opacity: secondary.opacity },
|
|
127
|
+
// NOTE: the planes (backgroundColor, background, table, gray fills) stay derived — they rise with the card.
|
|
128
|
+
text,
|
|
129
|
+
header,
|
|
130
|
+
gray: { ...derived.gray, ...grayInk },
|
|
131
|
+
border,
|
|
132
|
+
boxborder,
|
|
133
|
+
placeholder,
|
|
134
|
+
disabled,
|
|
135
|
+
accentText: pickAccentText(primary, derived.backgroundColor.main),
|
|
136
|
+
onPrimary: onFilled(PRIMARY_500, derived.white, derived.black),
|
|
137
|
+
boxShadow: {
|
|
138
|
+
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
139
|
+
error: derived.boxShadow.error,
|
|
140
|
+
default: "#00000080",
|
|
141
|
+
},
|
|
142
|
+
};
|
|
172
143
|
};
|
|
144
|
+
const palette = lazyPalette(light, buildPalette);
|
|
173
145
|
export default palette;
|
|
@@ -5,8 +5,9 @@ import { withSidebarTokens } from "./sidebarAccent.js";
|
|
|
5
5
|
import { buildMutedText } from "./mutedText.js";
|
|
6
6
|
import { buildSemanticText, buildOnSemantic } from "./semanticText.js";
|
|
7
7
|
import { buildFocusRing } from "./focusRing.js";
|
|
8
|
-
import { buildSurfaceRaised } from "./surfaceRaised.js";
|
|
8
|
+
import { buildSurfaceRaised, filledMarks } from "./surfaceRaised.js";
|
|
9
9
|
import { buildStar } from "./star.js";
|
|
10
|
+
import { CARD_LIFT, lift } from "./planes.js";
|
|
10
11
|
// Structural ramps are rebuilt at explicit targets (not reversed — light ramps bottom near 35%);
|
|
11
12
|
// utility hues are reversed so index roles survive; brand/semantic ramps shift one step lighter.
|
|
12
13
|
const SCALE_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
@@ -142,23 +143,49 @@ const NAMED_SURFACE_L = {
|
|
|
142
143
|
accent: 17,
|
|
143
144
|
muted: 18,
|
|
144
145
|
};
|
|
145
|
-
|
|
146
|
-
const SURFACE_SAT = 0;
|
|
146
|
+
const SURFACE_SAT = { lifted: 14, flat: 0 };
|
|
147
147
|
const TEXT_SAT = 12;
|
|
148
148
|
const PLACEHOLDER_SAT = 10;
|
|
149
149
|
const BORDER_SAT = 12;
|
|
150
150
|
const DISABLED_SAT = 8;
|
|
151
151
|
const GRAY_SAT = 0;
|
|
152
|
-
|
|
152
|
+
// Fill rungs drawn ON a card keep their step above it, so they rise with the card; ink and chrome rungs stay.
|
|
153
|
+
const BACKGROUND_FILLS = [100, 200, 300, 400, 500];
|
|
154
|
+
// NOTE: table.hover[500] gates every ink (it is a named surface), so it climbs one rung per step, not the card's full rise.
|
|
155
|
+
const TABLE_HOVER_ABOVE_CARD = {
|
|
156
|
+
50: 1, 100: 3, 200: 5, 300: 6, 400: 6.5, 500: 7,
|
|
157
|
+
};
|
|
158
|
+
const GRAY_FILLS = [50, 100, 200];
|
|
159
|
+
const raise = (targets, rungs, by) => ({
|
|
160
|
+
...targets,
|
|
161
|
+
...Object.fromEntries(rungs.map((k) => [k, targets[k] + by])),
|
|
162
|
+
});
|
|
163
|
+
const cardPlane = (canvas, white, planes) => {
|
|
164
|
+
if (planes === "flat")
|
|
165
|
+
return { card: canvas, rise: 0, tableHover: TABLE_HOVER_TARGETS };
|
|
166
|
+
const card = lift(white, canvas, CARD_LIFT);
|
|
167
|
+
const cardL = hexToHsl(card).l;
|
|
168
|
+
const tableHover = {
|
|
169
|
+
...TABLE_HOVER_TARGETS,
|
|
170
|
+
...Object.fromEntries(Object.entries(TABLE_HOVER_ABOVE_CARD).map(([k, step]) => [k, cardL + step])),
|
|
171
|
+
};
|
|
172
|
+
return { card, rise: cardL - hexToHsl(canvas).l, tableHover };
|
|
173
|
+
};
|
|
174
|
+
export function buildDarkPalette(light, { planes = "lifted" } = {}) {
|
|
153
175
|
const hueSource = light.primary[500];
|
|
154
176
|
const { h } = hexToHsl(hueSource);
|
|
177
|
+
const surfaceSat = SURFACE_SAT[planes];
|
|
155
178
|
const namedSurfaces = Object.fromEntries(Object.entries(NAMED_SURFACE_L).map(([key, l]) => [
|
|
156
179
|
key,
|
|
157
|
-
hslToHex({ h, s:
|
|
180
|
+
hslToHex({ h, s: surfaceSat, l }),
|
|
158
181
|
]));
|
|
159
182
|
const white = light.white;
|
|
183
|
+
const { card, rise, tableHover } = cardPlane(namedSurfaces.main, white, planes);
|
|
160
184
|
const primary = liftBrand(light.primary, white);
|
|
161
|
-
const background =
|
|
185
|
+
const background = {
|
|
186
|
+
...fromTargets(hueSource, raise(SURFACE_TARGETS, BACKGROUND_FILLS, rise), surfaceSat),
|
|
187
|
+
50: card,
|
|
188
|
+
};
|
|
162
189
|
const semantic = {
|
|
163
190
|
success: liftAccent(light.semantic.success, white),
|
|
164
191
|
error: liftAccent(light.semantic.error, white),
|
|
@@ -178,7 +205,7 @@ export function buildDarkPalette(light) {
|
|
|
178
205
|
transparent: light.transparent,
|
|
179
206
|
black: light.black,
|
|
180
207
|
white: light.white,
|
|
181
|
-
gray: fromTargets(hueSource, GRAY_TARGETS, GRAY_SAT),
|
|
208
|
+
gray: fromTargets(hueSource, raise(GRAY_TARGETS, GRAY_FILLS, rise), GRAY_SAT),
|
|
182
209
|
red: reverseScale(light.red),
|
|
183
210
|
orange: reverseScale(light.orange),
|
|
184
211
|
yellow: reverseScale(light.yellow),
|
|
@@ -195,7 +222,9 @@ export function buildDarkPalette(light) {
|
|
|
195
222
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
196
223
|
border: dividerRamp,
|
|
197
224
|
boxborder: dividerRamp,
|
|
198
|
-
table: {
|
|
225
|
+
table: {
|
|
226
|
+
hover: fromTargets(hueSource, tableHover, surfaceSat),
|
|
227
|
+
},
|
|
199
228
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
200
229
|
accentText: pickAccentText(primary, namedSurfaces.main),
|
|
201
230
|
textMuted: buildMutedText(fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT), namedSurfaces.main),
|
|
@@ -203,7 +232,7 @@ export function buildDarkPalette(light) {
|
|
|
203
232
|
onPrimary: onFilled(primary[500], light.white, light.black),
|
|
204
233
|
onSemantic: buildOnSemantic(semantic, light.white, light.black),
|
|
205
234
|
focusRing: buildFocusRing({ primary, background, backgroundColor: namedSurfaces }),
|
|
206
|
-
surfaceRaised: buildSurfaceRaised({ backgroundColor: namedSurfaces, background, white }),
|
|
235
|
+
surfaceRaised: buildSurfaceRaised({ backgroundColor: namedSurfaces, background, white }, filledMarks({ primary, semantic })),
|
|
207
236
|
star: buildStar(namedSurfaces.main),
|
|
208
237
|
sidebar: withSidebarTokens(light),
|
|
209
238
|
boxShadow: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Pure color math, no dependencies or platform APIs — safe for the mobile port.
|
|
2
|
+
import { memoize } from "./memo.js";
|
|
2
3
|
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
3
4
|
// NOTE: #rrggbbaa throws on purpose — alpha over an unknown backdrop has no defined luminance; composite first.
|
|
4
5
|
export function hexToRgb(hex) {
|
|
@@ -105,14 +106,17 @@ export function mix(a, b, weight) {
|
|
|
105
106
|
b: ca.b + (cb.b - ca.b) * w,
|
|
106
107
|
});
|
|
107
108
|
}
|
|
109
|
+
const linearChannel = (v) => {
|
|
110
|
+
const c = v / 255;
|
|
111
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
112
|
+
};
|
|
113
|
+
const luminanceOf = memoize((hex) => {
|
|
114
|
+
const { r, g, b } = hexToRgb(hex);
|
|
115
|
+
return 0.2126 * linearChannel(r) + 0.7152 * linearChannel(g) + 0.0722 * linearChannel(b);
|
|
116
|
+
}, (hex) => hex, 4096);
|
|
108
117
|
/** WCAG 2.1 relative luminance. */
|
|
109
118
|
export function relativeLuminance(hex) {
|
|
110
|
-
|
|
111
|
-
const channel = (v) => {
|
|
112
|
-
const c = v / 255;
|
|
113
|
-
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
114
|
-
};
|
|
115
|
-
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
119
|
+
return luminanceOf(hex);
|
|
116
120
|
}
|
|
117
121
|
/** WCAG 2.1 contrast ratio, 1–21. AA body text needs >= 4.5. */
|
|
118
122
|
export function contrastRatio(a, b) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { contrastRatio } from "./color.js";
|
|
2
2
|
import { AA_NORMAL_TEXT, isDarkCanvas, onFilled } from "./accentText.js";
|
|
3
3
|
import { AA_NON_TEXT } from "./outlineRung.js";
|
|
4
|
+
import { memoize, scaleKey } from "./memo.js";
|
|
4
5
|
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
5
6
|
// NOTE: "darker than [500]" is [600]/[700] in light but [400]/[300] in dark, since dark ramps run dark -> light.
|
|
6
7
|
const FILL_STEP_RUNGS = { light: [600, 700], dark: [400, 300] };
|
|
@@ -51,12 +52,8 @@ export const darkerFillRung = (scale, canvas, white, step) => {
|
|
|
51
52
|
};
|
|
52
53
|
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
53
54
|
export const labelOnFill = (fill, white, black) => onFilled(fill, white, black);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const { white, black, backgroundColor, background } = colors;
|
|
57
|
-
const canvas = contrastRatio(scale[500], backgroundColor.main) <= contrastRatio(scale[500], background[50])
|
|
58
|
-
? backgroundColor.main
|
|
59
|
-
: background[50];
|
|
55
|
+
const filledSurfaceMemo = memoize((scale, white, black, main, card) => {
|
|
56
|
+
const canvas = contrastRatio(scale[500], main) <= contrastRatio(scale[500], card) ? main : card;
|
|
60
57
|
const rung = solidFillRung(scale, white, canvas);
|
|
61
58
|
const fill = scale[rung];
|
|
62
59
|
const hoverRung = darkerFillRung(scale, canvas, white, 0);
|
|
@@ -74,4 +71,7 @@ export const resolveFilledSurface = (scale, colors) => {
|
|
|
74
71
|
activeFill,
|
|
75
72
|
activeColor: labelOnFill(activeFill, white, black),
|
|
76
73
|
};
|
|
77
|
-
};
|
|
74
|
+
}, (scale, white, black, main, card) => `${scaleKey(scale)}|${white}|${black}|${main}|${card}`);
|
|
75
|
+
export const resolveFilledSurface = (scale, colors) => ({
|
|
76
|
+
...filledSurfaceMemo(scale, colors.white, colors.black, colors.backgroundColor.main, colors.background[50]),
|
|
77
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const dataProperty = (value) => ({
|
|
2
|
+
value,
|
|
3
|
+
writable: true,
|
|
4
|
+
enumerable: true,
|
|
5
|
+
configurable: true,
|
|
6
|
+
});
|
|
7
|
+
// NOTE: first read of any key builds once and swaps every getter for a plain data property.
|
|
8
|
+
export const lazyObject = (keys, build) => {
|
|
9
|
+
const target = {};
|
|
10
|
+
let built;
|
|
11
|
+
const materialise = () => {
|
|
12
|
+
if (built)
|
|
13
|
+
return built;
|
|
14
|
+
const value = build();
|
|
15
|
+
built = value;
|
|
16
|
+
if (!Object.isSealed(target)) {
|
|
17
|
+
keys.forEach((key) => Object.defineProperty(target, key, dataProperty(value[key])));
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
keys.forEach((key) => Object.defineProperty(target, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
get: () => materialise()[key],
|
|
25
|
+
set: (next) => {
|
|
26
|
+
materialise();
|
|
27
|
+
Object.defineProperty(target, key, dataProperty(next));
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
// NOTE: order matches finalizeLightPalette and buildDarkPalette, which append these after the source keys.
|
|
33
|
+
const DERIVED = {
|
|
34
|
+
accentText: true,
|
|
35
|
+
textMuted: true,
|
|
36
|
+
semanticText: true,
|
|
37
|
+
onPrimary: true,
|
|
38
|
+
onSemantic: true,
|
|
39
|
+
focusRing: true,
|
|
40
|
+
surfaceRaised: true,
|
|
41
|
+
star: true,
|
|
42
|
+
};
|
|
43
|
+
const DERIVED_KEYS = Object.keys(DERIVED);
|
|
44
|
+
export const paletteKeys = (source) => [
|
|
45
|
+
...Object.keys(source),
|
|
46
|
+
...DERIVED_KEYS.filter((key) => !(key in source)),
|
|
47
|
+
];
|
|
48
|
+
/** A palette derived from `source` on its first read; same keys, order and values as `build()`. */
|
|
49
|
+
export const lazyPalette = (source, build) => lazyObject(paletteKeys(source), build);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const registry = [];
|
|
2
|
+
export const MEMO_LIMIT = 1024;
|
|
3
|
+
// NOTE: clear-on-overflow, not LRU — a hit stays one Map lookup; contrast walks mint many one-off keys.
|
|
4
|
+
export const memoize = (fn, keyOf, limit = MEMO_LIMIT) => {
|
|
5
|
+
const cache = new Map();
|
|
6
|
+
registry.push({ cache, limit });
|
|
7
|
+
return (...args) => {
|
|
8
|
+
const key = keyOf(...args);
|
|
9
|
+
const hit = cache.get(key);
|
|
10
|
+
if (hit !== undefined)
|
|
11
|
+
return hit;
|
|
12
|
+
const value = fn(...args);
|
|
13
|
+
if (cache.size >= limit)
|
|
14
|
+
cache.clear();
|
|
15
|
+
cache.set(key, value);
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const scaleKey = (s) => `${s[50]}|${s[100]}|${s[200]}|${s[300]}|${s[400]}|${s[500]}|${s[600]}|${s[700]}|${s[800]}|${s[900]}`;
|
|
20
|
+
export const memoCaches = () => registry.map(({ cache, limit }) => ({ size: cache.size, limit }));
|
|
21
|
+
export const clearMemoCaches = () => registry.forEach(({ cache }) => cache.clear());
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const READS_MEMO_LIMIT = 16;
|
|
2
|
+
// NOTE: keyed on exactly the props a call read; a call that enumerates or probes props is never cached.
|
|
3
|
+
export const memoiseByReads = (fn, limit = READS_MEMO_LIMIT) => {
|
|
4
|
+
const entries = [];
|
|
5
|
+
return (props) => {
|
|
6
|
+
const source = props;
|
|
7
|
+
const hit = entries.find((entry) => entry.keys.every((key, i) => Object.is(source[key], entry.values[i])));
|
|
8
|
+
if (hit)
|
|
9
|
+
return hit.result;
|
|
10
|
+
const reads = new Map();
|
|
11
|
+
let opaque = false;
|
|
12
|
+
const tracked = new Proxy(props, {
|
|
13
|
+
get(target, key, receiver) {
|
|
14
|
+
const value = Reflect.get(target, key, receiver);
|
|
15
|
+
if (typeof key !== "string")
|
|
16
|
+
opaque = true;
|
|
17
|
+
else if (!reads.has(key))
|
|
18
|
+
reads.set(key, value);
|
|
19
|
+
return value;
|
|
20
|
+
},
|
|
21
|
+
has(target, key) {
|
|
22
|
+
opaque = true;
|
|
23
|
+
return Reflect.has(target, key);
|
|
24
|
+
},
|
|
25
|
+
ownKeys(target) {
|
|
26
|
+
opaque = true;
|
|
27
|
+
return Reflect.ownKeys(target);
|
|
28
|
+
},
|
|
29
|
+
getOwnPropertyDescriptor(target, key) {
|
|
30
|
+
opaque = true;
|
|
31
|
+
return Reflect.getOwnPropertyDescriptor(target, key);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const result = fn(tracked);
|
|
35
|
+
if (!opaque) {
|
|
36
|
+
if (entries.length >= limit)
|
|
37
|
+
entries.shift();
|
|
38
|
+
entries.push({
|
|
39
|
+
keys: [...reads.keys()],
|
|
40
|
+
values: [...reads.values()],
|
|
41
|
+
result,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
1
2
|
import { liftToContrast } from "./outlineRung.js";
|
|
2
3
|
/** WCAG 1.4.3 — muted is still body text. */
|
|
3
4
|
export const AA_NORMAL_TEXT = 4.5;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
export const MUTED_TEXT_CEILING = 8;
|
|
6
|
+
const settleUnder = (hex, canvas, ceiling) => {
|
|
7
|
+
const { s, l } = hexToHsl(hex);
|
|
8
|
+
const toward = relativeLuminance(canvas) < 0.5 ? -1 : 1;
|
|
9
|
+
let settled = hex;
|
|
10
|
+
for (let next = l; contrastRatio(settled, canvas) > ceiling; next += toward) {
|
|
11
|
+
settled = withLightness(hex, next, s);
|
|
12
|
+
}
|
|
13
|
+
return settled;
|
|
14
|
+
};
|
|
15
|
+
export const buildMutedText = (text, canvas) => liftToContrast(settleUnder(text[400], canvas, MUTED_TEXT_CEILING), canvas, AA_NORMAL_TEXT);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
2
|
+
import { memoize } from "./memo.js";
|
|
2
3
|
export const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
3
4
|
export const AA_NON_TEXT = 3;
|
|
4
5
|
// NOTE: settles below AA_NON_TEXT — focusRing.ts covers the 1.4.11 gate instead.
|
|
@@ -22,7 +23,8 @@ export function tintStep(seed, backdrop, target) {
|
|
|
22
23
|
}
|
|
23
24
|
return withLightness(seed, away > 0 ? 100 : 0, s);
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
const contrastKey = (hex, backdrop, target) => `${hex}|${backdrop}|${target}`;
|
|
27
|
+
const liftMemo = memoize((hex, backdrop, target) => {
|
|
26
28
|
if (contrastRatio(hex, backdrop) >= target)
|
|
27
29
|
return hex;
|
|
28
30
|
const { s, l: start } = hexToHsl(hex);
|
|
@@ -38,8 +40,11 @@ export function liftToContrast(hex, backdrop, target = AA_NON_TEXT) {
|
|
|
38
40
|
}
|
|
39
41
|
const ends = [withLightness(hex, 100, s), withLightness(hex, 0, s)];
|
|
40
42
|
return contrastRatio(ends[0], backdrop) >= contrastRatio(ends[1], backdrop) ? ends[0] : ends[1];
|
|
43
|
+
}, contrastKey);
|
|
44
|
+
export function liftToContrast(hex, backdrop, target = AA_NON_TEXT) {
|
|
45
|
+
return liftMemo(hex, backdrop, target);
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
const softenMemo = memoize((hex, backdrop, target) => {
|
|
43
48
|
if (contrastRatio(hex, backdrop) <= target)
|
|
44
49
|
return hex;
|
|
45
50
|
const { s, l: start } = hexToHsl(hex);
|
|
@@ -52,6 +57,9 @@ export function softenToContrast(hex, backdrop, target) {
|
|
|
52
57
|
softest = next;
|
|
53
58
|
}
|
|
54
59
|
return softest;
|
|
60
|
+
}, contrastKey);
|
|
61
|
+
export function softenToContrast(hex, backdrop, target) {
|
|
62
|
+
return softenMemo(hex, backdrop, target);
|
|
55
63
|
}
|
|
56
64
|
// NOTE: border[*] is untouched — it draws decorative table gridlines, outside 1.4.11.
|
|
57
65
|
export function withOutlineRung(palette) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DEFAULT_BLACK, isDarkCanvas } from "./accentText.js";
|
|
2
|
+
import { contrastRatio } from "./color.js";
|
|
3
|
+
import { CHROME_RULE, MIN_PERCEPTIBLE_STEP, liftToContrast, tintStep } from "./outlineRung.js";
|
|
4
|
+
import { lift } from "./planes.js";
|
|
5
|
+
const holds = (fill, plane, target) => !isDarkCanvas(plane) || contrastRatio(fill, plane) >= target;
|
|
6
|
+
export const bandOn = (fill, plane) => holds(fill, plane, MIN_PERCEPTIBLE_STEP) ? fill : tintStep(fill, plane, MIN_PERCEPTIBLE_STEP);
|
|
7
|
+
export const recessOn = (fill, plane) => holds(fill, plane, MIN_PERCEPTIBLE_STEP)
|
|
8
|
+
? fill
|
|
9
|
+
: lift(DEFAULT_BLACK, plane, MIN_PERCEPTIBLE_STEP);
|
|
10
|
+
export const cardRule = (colors) => {
|
|
11
|
+
const rule = colors.boxborder[200];
|
|
12
|
+
const card = colors.background[50];
|
|
13
|
+
return holds(rule, card, CHROME_RULE) ? rule : liftToContrast(rule, card, CHROME_RULE);
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { contrastRatio, mix } from "./color.js";
|
|
2
|
+
import { AA_NON_TEXT } from "./outlineRung.js";
|
|
3
|
+
export const CARD_LIFT = 1.16;
|
|
4
|
+
export const RAISED_LIFT = 1.15;
|
|
5
|
+
const STEP = 0.005;
|
|
6
|
+
const MAX_WEIGHT = 0.4;
|
|
7
|
+
export function lift(ink, base, target) {
|
|
8
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
9
|
+
const next = mix(base, ink, t);
|
|
10
|
+
if (contrastRatio(next, base) >= target)
|
|
11
|
+
return next;
|
|
12
|
+
}
|
|
13
|
+
return mix(base, ink, MAX_WEIGHT);
|
|
14
|
+
}
|
|
15
|
+
const clearsMarks = (surface, marks) => marks.every((mark) => contrastRatio(mark, surface) >= AA_NON_TEXT);
|
|
16
|
+
// NOTE: stops one step early rather than drop a filled mark under 3:1 on the lifted plane.
|
|
17
|
+
export function liftUnder(ink, base, target, marks) {
|
|
18
|
+
let settled = base;
|
|
19
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
20
|
+
const next = mix(base, ink, t);
|
|
21
|
+
if (!clearsMarks(next, marks))
|
|
22
|
+
return settled;
|
|
23
|
+
if (contrastRatio(next, base) >= target)
|
|
24
|
+
return next;
|
|
25
|
+
settled = next;
|
|
26
|
+
}
|
|
27
|
+
return settled;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
2
|
+
/** Same pulse depth as the mobile library's `SKELETON_SHIMMER_CONTRAST`. */
|
|
3
|
+
export const SKELETON_SHIMMER_CONTRAST = 1.35;
|
|
4
|
+
const settleAway = (seed, base, target) => {
|
|
5
|
+
const { s } = hexToHsl(seed);
|
|
6
|
+
let near = hexToHsl(base).l;
|
|
7
|
+
let far = relativeLuminance(base) < 0.5 ? 100 : 0;
|
|
8
|
+
for (let i = 0; i < 20; i += 1) {
|
|
9
|
+
const mid = (near + far) / 2;
|
|
10
|
+
if (contrastRatio(withLightness(seed, mid, s), base) < target)
|
|
11
|
+
near = mid;
|
|
12
|
+
else
|
|
13
|
+
far = mid;
|
|
14
|
+
}
|
|
15
|
+
return withLightness(seed, far, s);
|
|
16
|
+
};
|
|
17
|
+
/** The two colours a Skeleton pulses between: `gray[100]`, and `gray[300]`'s tint settled to the amplitude. */
|
|
18
|
+
export const skeletonShimmer = (palette) => ({
|
|
19
|
+
start: palette.gray[100],
|
|
20
|
+
end: settleAway(palette.gray[300], palette.gray[100], SKELETON_SHIMMER_CONTRAST),
|
|
21
|
+
});
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { contrastRatio, mix, relativeLuminance } from "./color.js";
|
|
2
2
|
import { liftToContrast } from "./outlineRung.js";
|
|
3
|
+
import { RAISED_LIFT, liftUnder } from "./planes.js";
|
|
4
|
+
import { cardRule } from "./planeStep.js";
|
|
5
|
+
import { SEMANTIC_TONES } from "./semanticText.js";
|
|
3
6
|
export const RAISED_OVERLAY = 0.07;
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
+
/** The filled fills a raised plane must keep at 3:1, or a button on a menu stops reading. */
|
|
8
|
+
export const filledMarks = (colors) => [
|
|
9
|
+
colors.primary[500],
|
|
10
|
+
...SEMANTIC_TONES.map((tone) => colors.semantic[tone][500]),
|
|
11
|
+
];
|
|
12
|
+
// Never below the card: the lighter of one white-overlay step off the canvas and a RAISED_LIFT step off the card.
|
|
13
|
+
export const buildSurfaceRaised = (source, marks = []) => {
|
|
7
14
|
const card = source.background[50];
|
|
8
|
-
|
|
15
|
+
const overlay = mix(source.backgroundColor.main, source.white, RAISED_OVERLAY);
|
|
16
|
+
const stepped = liftUnder(source.white, card, RAISED_LIFT, marks);
|
|
17
|
+
return [overlay, stepped].reduce((top, c) => (relativeLuminance(c) > relativeLuminance(top) ? c : top), card);
|
|
9
18
|
};
|
|
10
19
|
export const withSurfaceRaised = (palette) => ({
|
|
11
20
|
...palette,
|
|
12
|
-
surfaceRaised: buildSurfaceRaised(palette),
|
|
21
|
+
surfaceRaised: buildSurfaceRaised(palette, filledMarks(palette)),
|
|
13
22
|
});
|
|
14
|
-
// A divider inside an overlay, at the weight
|
|
15
|
-
export const raisedRule = (colors) => liftToContrast(colors.boxborder[200], colors.surfaceRaised, contrastRatio(colors
|
|
23
|
+
// A divider inside an overlay, at the weight a rule has inside a card.
|
|
24
|
+
export const raisedRule = (colors) => liftToContrast(colors.boxborder[200], colors.surfaceRaised, contrastRatio(cardRule(colors), colors.background[50]));
|
|
@@ -2,6 +2,7 @@ import { contrastRatio } from "./color.js";
|
|
|
2
2
|
import { liftToContrast, settleAcross, ruleInk, AA_NON_TEXT, CHROME_BORDER, CHROME_RULE } from "./outlineRung.js";
|
|
3
3
|
import { AA_NORMAL_TEXT, pickAccentText } from "./accentText.js";
|
|
4
4
|
import { SEMANTIC_TONES } from "./semanticText.js";
|
|
5
|
+
import { listRowBackgrounds } from "./rowStates.js";
|
|
5
6
|
// NOTE: hint held to the non-text floor, not body-text — at 4.5 an empty field reads as typed-into. See CHROME-CONSISTENCY.md.
|
|
6
7
|
export const PLACEHOLDER_TEXT = AA_NON_TEXT;
|
|
7
8
|
export const namedSurfaces = (palette) => [
|
|
@@ -15,6 +16,7 @@ export const hardestSurface = (ink, surfaces) => surfaces.reduce((worst, s) => c
|
|
|
15
16
|
// Runs last: `table.hover` is one of the surfaces, and it settles in its own rung.
|
|
16
17
|
export function withSurfaceRungs(palette) {
|
|
17
18
|
const surfaces = namedSurfaces(palette);
|
|
19
|
+
const accentSurfaces = [...surfaces, ...Object.values(listRowBackgrounds(palette))];
|
|
18
20
|
const lift = (ink, target) => liftToContrast(ink, hardestSurface(ink, surfaces), target);
|
|
19
21
|
const settle = (ink, target) => settleAcross(ink, surfaces, target);
|
|
20
22
|
const rule = (ink) => ruleInk(ink, [palette.backgroundColor.main, palette.background[50]], CHROME_RULE);
|
|
@@ -25,7 +27,7 @@ export function withSurfaceRungs(palette) {
|
|
|
25
27
|
return {
|
|
26
28
|
...palette,
|
|
27
29
|
textMuted: lift(palette.textMuted, AA_NORMAL_TEXT),
|
|
28
|
-
accentText: pickAccentText(palette.primary, hardestSurface(palette.accentText,
|
|
30
|
+
accentText: pickAccentText(palette.primary, hardestSurface(palette.accentText, accentSurfaces)),
|
|
29
31
|
semanticText,
|
|
30
32
|
text: { ...palette.text, 500: lift(palette.text[500], AA_NORMAL_TEXT) },
|
|
31
33
|
header: { ...palette.header, 500: lift(palette.header[500], AA_NORMAL_TEXT) },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isDarkCanvas } from "./accentText.js";
|
|
2
2
|
import { compositeOver } from "./color.js";
|
|
3
3
|
import { liftToContrast } from "./outlineRung.js";
|
|
4
|
+
import { memoize } from "./memo.js";
|
|
4
5
|
export const TONES = ["neutral", "info", "success", "warning", "error"];
|
|
5
6
|
export const toneToColorScheme = {
|
|
6
7
|
neutral: "gray",
|
|
@@ -26,10 +27,8 @@ const SOFT_INK_TARGET = 6.5;
|
|
|
26
27
|
const withAlpha = (hex, alpha) => `${hex}${Math.round(Math.min(1, Math.max(0, alpha)) * 255)
|
|
27
28
|
.toString(16)
|
|
28
29
|
.padStart(2, "0")}`;
|
|
29
|
-
|
|
30
|
-
export const resolveSoftTone = (colors, scale, surface = colors.backgroundColor.main) => {
|
|
30
|
+
const softToneMemo = memoize((hue, surface) => {
|
|
31
31
|
const dark = isDarkCanvas(surface);
|
|
32
|
-
const hue = scale[500];
|
|
33
32
|
const bgAlpha = dark ? BG_ALPHA.dark : BG_ALPHA.light;
|
|
34
33
|
const ringAlpha = dark ? RING_ALPHA.dark : RING_ALPHA.light;
|
|
35
34
|
const bg = withAlpha(hue, bgAlpha);
|
|
@@ -44,4 +43,6 @@ export const resolveSoftTone = (colors, scale, surface = colors.backgroundColor.
|
|
|
44
43
|
activeBg: withAlpha(hue, bgAlpha + STATE_STEP * 1.75),
|
|
45
44
|
activeBorder: withAlpha(hue, ringAlpha + STATE_STEP * 2),
|
|
46
45
|
};
|
|
47
|
-
};
|
|
46
|
+
}, (hue, surface) => `${hue}|${surface}`);
|
|
47
|
+
/** Translucent tint of the scale's own `[500]` hue — one rung for every scheme, any surface. */
|
|
48
|
+
export const resolveSoftTone = (colors, scale, surface = colors.backgroundColor.main) => ({ ...softToneMemo(scale[500], surface) });
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { default as space } from "./space.js";
|
|
2
2
|
export { default as sizes } from "./sizes.js";
|
|
3
|
-
export { default as radii } from "./radii.js";
|
|
4
|
-
export
|
|
3
|
+
export { default as radii, RADIUS_ROLE } from "./radii.js";
|
|
4
|
+
export * from "./borderWidths.js";
|
|
5
|
+
export * from "./states.js";
|
|
6
|
+
export { default as shadows, shadowsDark, shadowsFor, shadowCss, ELEVATION_LAYERS, SHADOW_INK } from "./shadows.js";
|
|
5
7
|
export { default as zIndices } from "./zIndices.js";
|
|
6
8
|
export { default as breakpoints } from "./breakpoints.js";
|
|
7
9
|
export { default as lineHeights } from "./lineHeights.js";
|
|
8
10
|
export { default as letterSpacings } from "./letterSpacings.js";
|
|
9
|
-
export { default as typography, fonts, fontSizes, fontWeights } from "./typography.js";
|
|
11
|
+
export { default as typography, fonts, fontSizes, fontWeights, NUMERIC_TEXT, TEXT_STYLES } from "./typography.js";
|
|
10
12
|
export * from "./controlSizes.js";
|
|
11
13
|
export * from "./motion.js";
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
export const MOTION_MS = { fast: 150, base: 200 };
|
|
2
|
-
|
|
1
|
+
export const MOTION_MS = { fast: 150, base: 200, enter: 200, exit: 200 };
|
|
2
|
+
/** Pebble easing curves (mobile `pebble-spec.json` motion.easing); `in` is Pebble's `accelerate`. */
|
|
3
|
+
export const MOTION_BEZIER = {
|
|
4
|
+
standard: [0.2, 0, 0, 1],
|
|
5
|
+
out: [0.16, 1, 0.3, 1],
|
|
6
|
+
in: [0.3, 0, 1, 1],
|
|
7
|
+
};
|
|
8
|
+
export const cubicBezierCss = (curve) => `cubic-bezier(${curve.join(", ")})`;
|
|
9
|
+
export const MOTION_EASE = cubicBezierCss(MOTION_BEZIER.standard);
|
|
10
|
+
export const MOTION_EASE_OUT = cubicBezierCss(MOTION_BEZIER.out);
|
|
11
|
+
export const MOTION_EASE_IN = cubicBezierCss(MOTION_BEZIER.in);
|
|
12
|
+
/** Periods for loops that are feedback, not transitions: skeleton pulse, spinner turn, progress sweep. */
|
|
13
|
+
export const MOTION_LOOP_MS = { pulse: 700, spin: 800, sweep: 1200 };
|
|
14
|
+
export const MOTION_PRESS_SCALE = 0.98;
|
|
3
15
|
/** A `transition` value for named properties only — `all` also animates layout and colour flips. */
|
|
4
|
-
export const transitionFor = (properties, speed = "fast") => {
|
|
16
|
+
export const transitionFor = (properties, speed = "fast", curve = "standard") => {
|
|
5
17
|
if (properties.includes("all"))
|
|
6
18
|
throw new Error("transitionFor: name the properties, never `all`");
|
|
7
|
-
|
|
19
|
+
const ease = cubicBezierCss(MOTION_BEZIER[curve]);
|
|
20
|
+
return properties.map((p) => `${p} ${MOTION_MS[speed]}ms ${ease}`).join(", ");
|
|
21
|
+
};
|
|
22
|
+
export const motionTransition = (speed = "base", curve = "standard") => {
|
|
23
|
+
const [x1, y1, x2, y2] = MOTION_BEZIER[curve];
|
|
24
|
+
return { duration: MOTION_MS[speed] / 1000, ease: [x1, y1, x2, y2] };
|
|
8
25
|
};
|