pixelize-design-library 2.4.2-beta.4 → 2.4.2-beta.41
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/COMPONENT-GOTCHAS.md +1102 -0
- package/README.md +26 -0
- package/dist/Components/Accordion/Accordion.d.ts +1 -0
- package/dist/Components/Accordion/Accordion.js +4 -1
- package/dist/Components/Accordion/AccordionProps.d.ts +2 -0
- package/dist/Components/AlertDialog/AlertDialog.d.ts +1 -0
- package/dist/Components/AlertDialog/AlertDialog.js +1 -0
- package/dist/Components/AlertDialog/AlertDialogProps.d.ts +2 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +1 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChartProps.d.ts +4 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.js +1 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChartProps.d.ts +6 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +8 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +1 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +6 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +1 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarChartsProps.d.ts +3 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +1 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChartProps.d.ts +3 -0
- package/dist/Components/AppSwitcher/AppMark.d.ts +19 -0
- package/dist/Components/AppSwitcher/AppMark.js +62 -0
- package/dist/Components/AppSwitcher/AppSwitcher.d.ts +4 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +278 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +70 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +86 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.d.ts +3 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.js +31 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -0
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +3 -0
- package/dist/Components/Button/Button.d.ts +2 -2
- package/dist/Components/Button/Button.js +4 -3
- package/dist/Components/Button/Button.styles.js +37 -23
- package/dist/Components/Button/ButtonProps.d.ts +9 -1
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +7 -0
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +2 -4
- package/dist/Components/Buttons/ButtonsProps.d.ts +2 -0
- package/dist/Components/Card/Card.d.ts +1 -1
- package/dist/Components/Card/Card.js +2 -2
- package/dist/Components/Card/CardProps.d.ts +3 -1
- package/dist/Components/Card/PaymentCard/PaymentCard.js +21 -12
- package/dist/Components/Card/PaymentCard/PaymentCardProps.d.ts +6 -0
- package/dist/Components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Components/Checkbox/Checkbox.js +2 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +12 -7
- package/dist/Components/Checkbox/CheckboxProps.d.ts +4 -0
- package/dist/Components/Common/ErrorComponent.d.ts +2 -0
- package/dist/Components/Common/ErrorComponent.js +7 -5
- package/dist/Components/Common/ErrorMessage.js +2 -2
- package/dist/Components/Common/FormLabel.d.ts +4 -0
- package/dist/Components/Common/FormLabel.js +1 -0
- package/dist/Components/Common/FormattedDescription.d.ts +2 -0
- package/dist/Components/Common/FormattedDescription.js +1 -0
- package/dist/Components/Common/HelperText.d.ts +2 -0
- package/dist/Components/Common/HelperText.js +2 -0
- package/dist/Components/Common/Label.d.ts +1 -0
- package/dist/Components/Common/Label.js +1 -0
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/ContactForm/ContactForm.d.ts +1 -0
- package/dist/Components/ContactForm/ContactForm.js +1 -0
- package/dist/Components/ContactForm/ContactFormProps.d.ts +4 -0
- package/dist/Components/CopyButton/CopyButton.d.ts +3 -1
- package/dist/Components/CopyButton/CopyButton.js +9 -3
- package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +8 -0
- package/dist/Components/DatePicker/CalendarPanel.d.ts +6 -0
- package/dist/Components/DatePicker/CalendarPanel.js +37 -15
- package/dist/Components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/DatePicker.js +1 -0
- package/dist/Components/DatePicker/DatePickerProps.d.ts +30 -0
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +30 -5
- package/dist/Components/DatePicker/SingleDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/SingleDatePicker.js +49 -14
- package/dist/Components/DatePicker/ThemeDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/ThemeDatePicker.js +1 -0
- package/dist/Components/DatePicker/TimeOnlyPicker.d.ts +1 -0
- package/dist/Components/DatePicker/TimeOnlyPicker.js +11 -2
- package/dist/Components/DatePicker/TimePicker.d.ts +1 -0
- package/dist/Components/DatePicker/TimePicker.js +4 -3
- package/dist/Components/DatePicker/TimePickerInput.d.ts +1 -0
- package/dist/Components/DatePicker/TimePickerInput.js +2 -1
- package/dist/Components/DatePicker/dayStates.d.ts +56 -0
- package/dist/Components/DatePicker/dayStates.js +87 -0
- package/dist/Components/Divider/Divider.d.ts +1 -0
- package/dist/Components/Divider/Divider.js +1 -0
- package/dist/Components/Drawer/DrawerProps.d.ts +2 -0
- package/dist/Components/Dropdown/DropDown.d.ts +1 -0
- package/dist/Components/Dropdown/DropDown.js +22 -6
- package/dist/Components/Dropdown/DropdownProps.d.ts +3 -0
- package/dist/Components/Editor/Editor.d.ts +1 -0
- package/dist/Components/Editor/Editor.js +1 -0
- package/dist/Components/Editor/EditorProps.d.ts +2 -0
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -0
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -5
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +4 -0
- package/dist/Components/EmptyState/EmptyState.d.ts +1 -0
- package/dist/Components/EmptyState/EmptyState.js +4 -2
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +3 -0
- package/dist/Components/FeedbackForm/FeedbackForm.d.ts +3 -0
- package/dist/Components/FeedbackForm/FeedbackForm.js +1 -0
- package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +3 -2
- package/dist/Components/FieldSelectModal/FieldSelectModal.js +1 -0
- package/dist/Components/FilePreview/FilePreview.d.ts +1 -0
- package/dist/Components/FilePreview/FilePreview.js +3 -1
- package/dist/Components/FilePreview/FilePreviewProps.d.ts +5 -2
- package/dist/Components/FileUpload/FileUpload.d.ts +1 -0
- package/dist/Components/FileUpload/FileUpload.js +7 -5
- package/dist/Components/FileUpload/FileUploadProps.d.ts +7 -1
- package/dist/Components/FileUpload/constants.js +1 -0
- package/dist/Components/FileUploader/FileUploader.d.ts +1 -0
- package/dist/Components/FileUploader/FileUploader.js +1 -0
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +2 -0
- package/dist/Components/FilterSidebar/FilterSidebar.d.ts +3 -0
- package/dist/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +2 -10
- package/dist/Components/FilterSidebar/filterHoverStyle.js +3 -10
- package/dist/Components/Form/FormWrapper.d.ts +3 -0
- package/dist/Components/Form/FormWrapper.js +2 -1
- package/dist/Components/Header/HeaderProps.d.ts +5 -0
- package/dist/Components/Header/components/mobileMenu.js +12 -3
- package/dist/Components/Input/Input/InputProps.d.ts +2 -0
- package/dist/Components/Input/PhoneNumberInput.d.ts +1 -0
- package/dist/Components/Input/PhoneNumberInput.js +1 -0
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +3 -0
- package/dist/Components/Input/Switch/InputSwitch.d.ts +2 -0
- package/dist/Components/Input/Switch/InputSwitch.js +1 -0
- package/dist/Components/Input/TextInput.js +1 -0
- package/dist/Components/Input/TextInput.styles.js +8 -10
- package/dist/Components/Input/TextInputProps.d.ts +2 -0
- package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -0
- package/dist/Components/InputTextArea/InputTextArea.js +1 -0
- package/dist/Components/InputTextArea/InputTextArea.style.js +7 -6
- package/dist/Components/InputTextArea/InputTextAreaProps.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountCard.d.ts +3 -0
- package/dist/Components/KanbanBoard/AccountCard.js +1 -0
- package/dist/Components/KanbanBoard/AccountRow.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountRow.js +1 -0
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.d.ts +2 -0
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -0
- package/dist/Components/KanbanBoard/KanbanBoard.js +1 -0
- package/dist/Components/KanbanBoard/KanbanBoardProps.d.ts +39 -14
- package/dist/Components/KanbanBoard/MeasuredItem.d.ts +1 -0
- package/dist/Components/KanbanBoard/MeasuredItem.js +1 -0
- package/dist/Components/LazyWrapper/LazyWrapper.d.ts +3 -2
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -0
- package/dist/Components/LimitReachedModal/LimitReachedModalProps.d.ts +4 -1
- package/dist/Components/LimitReachedModal/limitReachedCopy.d.ts +2 -0
- package/dist/Components/LimitReachedModal/limitReachedCopy.js +2 -0
- package/dist/Components/Loading/Loading.d.ts +1 -0
- package/dist/Components/Loading/Loading.js +16 -14
- package/dist/Components/Loading/LoadingProps.d.ts +2 -0
- package/dist/Components/Modal/ModalProps.d.ts +2 -0
- package/dist/Components/MoreItems/MoreItems.d.ts +1 -0
- package/dist/Components/MoreItems/MoreItems.js +4 -1
- package/dist/Components/MoreItems/MoreItemsProps.d.ts +4 -2
- package/dist/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +2 -0
- package/dist/Components/NavigationBar/NavigationBar.js +9 -10
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +3 -0
- package/dist/Components/NoteTextArea/NoteTextArea.d.ts +1 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +10 -4
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +2 -0
- package/dist/Components/Notification/Notification.d.ts +1 -0
- package/dist/Components/Notification/Notification.js +1 -0
- package/dist/Components/Notification/NotificationProps.d.ts +6 -0
- package/dist/Components/NumberInput/NumberInput.d.ts +1 -0
- package/dist/Components/NumberInput/NumberInput.js +4 -1
- package/dist/Components/NumberInput/NumberInput.styles.js +7 -6
- package/dist/Components/NumberInput/NumberInputProps.d.ts +3 -0
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +6 -1
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +1 -0
- package/dist/Components/OrganizationDetails/OrganizationDetails.d.ts +1 -0
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -2
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +17 -4
- package/dist/Components/PdfViewer/PdfViewer.d.ts +2 -1
- package/dist/Components/PdfViewer/PdfViewer.js +7 -1
- package/dist/Components/PinInput/PinInput.d.ts +1 -0
- package/dist/Components/PinInput/PinInput.js +1 -0
- package/dist/Components/PinInput/PinInputProps.d.ts +2 -0
- package/dist/Components/PinInputs/PinInputs.d.ts +1 -0
- package/dist/Components/PinInputs/PinInputs.js +1 -0
- package/dist/Components/PinInputs/PinInputsProps.d.ts +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +2 -0
- package/dist/Components/PlanPill/PlanPillProps.d.ts +2 -0
- package/dist/Components/Primitives/Primitives.d.ts +6 -0
- package/dist/Components/Primitives/Primitives.js +113 -0
- package/dist/Components/ProductCard/ProductCardProps.d.ts +10 -0
- package/dist/Components/ProductCard/ProductReview.d.ts +1 -0
- package/dist/Components/ProductCard/ProductReview.js +6 -1
- package/dist/Components/ProductCard/ProductTags.js +1 -1
- package/dist/Components/ProductDetails/ProductDetailsProps.d.ts +7 -0
- package/dist/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfileCard/ProfileCardProps.d.ts +3 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +1 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +5 -3
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +9 -1
- package/dist/Components/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/Components/ProgressBar/ProgressBar.js +1 -0
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts +2 -0
- package/dist/Components/RadioButton/RadioButton.js +3 -2
- package/dist/Components/RadioButton/RadioButtonProps.d.ts +2 -0
- package/dist/Components/Reorder/Reorder.d.ts +2 -0
- package/dist/Components/Reorder/Reorder.js +1 -0
- package/dist/Components/Reorder/ReorderProps.d.ts +3 -0
- package/dist/Components/RolesPermission/RolesPermission.d.ts +1 -0
- package/dist/Components/RolesPermission/RolesPermission.js +5 -3
- package/dist/Components/RolesPermission/RolesPermissionProps.d.ts +16 -1
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts +3 -2
- package/dist/Components/ScrollToTop/ScrollToTop.js +4 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +7 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +1 -0
- package/dist/Components/Search/Search.d.ts +1 -0
- package/dist/Components/Search/Search.js +3 -2
- package/dist/Components/Search/SearchProps.d.ts +2 -0
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -0
- package/dist/Components/SearchSelect/SearchSelect.js +48 -37
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +23 -0
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/Components/SegmentedControl/SegmentedControl.js +89 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +23 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.js +2 -0
- package/dist/Components/Select/Select.d.ts +1 -1
- package/dist/Components/Select/Select.js +4 -2
- package/dist/Components/Select/Select.styles.js +3 -2
- package/dist/Components/Select/SelectProps.d.ts +6 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/Components/SelectSearch/SelectSearch.js +37 -15
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +5 -0
- package/dist/Components/SelectV2/SelectV2.d.ts +1 -0
- package/dist/Components/SelectV2/SelectV2.js +20 -5
- package/dist/Components/SelectV2/SelectV2Props.d.ts +6 -1
- package/dist/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/Components/SideBar/SideBar.js +5 -3
- package/dist/Components/SideBar/SideBarProps.d.ts +38 -24
- package/dist/Components/SideBar/components/MenuItemBox.js +15 -11
- package/dist/Components/SideBar/components/MenuPopoverContent.js +13 -10
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +3 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +2 -0
- package/dist/Components/Skeletons/Skeletons.d.ts +1 -0
- package/dist/Components/Skeletons/Skeletons.js +1 -0
- package/dist/Components/Slider/Slider.d.ts +3 -0
- package/dist/Components/Slider/Slider.js +9 -1
- package/dist/Components/StageProgress/StageItem.d.ts +1 -0
- package/dist/Components/StageProgress/StageItem.js +1 -0
- package/dist/Components/StageProgress/StageProgress.d.ts +1 -0
- package/dist/Components/StageProgress/StageProgress.js +1 -0
- package/dist/Components/StageProgress/StageProgressProps.d.ts +45 -4
- package/dist/Components/StageProgress/StageProgressProps.js +6 -4
- package/dist/Components/StageProgress/StepperStage.js +2 -2
- package/dist/Components/Switch/Switch.d.ts +1 -0
- package/dist/Components/Switch/Switch.js +1 -0
- package/dist/Components/Switch/SwitchProps.d.ts +1 -0
- package/dist/Components/Table/Table.d.ts +2 -1
- package/dist/Components/Table/Table.js +15 -5
- package/dist/Components/Table/TableProps.d.ts +47 -0
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableActions.js +2 -2
- package/dist/Components/Table/components/TableBody.js +44 -18
- package/dist/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +21 -8
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/CompactSelect.d.ts +1 -0
- package/dist/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +9 -1
- package/dist/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/Components/Table/settings/ManageColumns.js +8 -5
- package/dist/Components/Table/settings/TableSettings.js +6 -4
- package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
- package/dist/Components/Table/variants/TableVariantContext.js +17 -0
- package/dist/Components/Table/variants/classic.d.ts +6 -0
- package/dist/Components/Table/variants/classic.js +47 -0
- package/dist/Components/Table/variants/index.d.ts +7 -0
- package/dist/Components/Table/variants/index.js +27 -0
- package/dist/Components/Table/variants/pillInk.d.ts +6 -0
- package/dist/Components/Table/variants/pillInk.js +21 -0
- package/dist/Components/Table/variants/studio.d.ts +6 -0
- package/dist/Components/Table/variants/studio.js +50 -0
- package/dist/Components/Table/variants/tokens.d.ts +49 -0
- package/dist/Components/Table/variants/tokens.js +2 -0
- package/dist/Components/Tag/Tag.d.ts +1 -0
- package/dist/Components/Tag/Tag.js +1 -0
- package/dist/Components/Tag/Tag.styles.js +16 -11
- package/dist/Components/Tag/TagProps.d.ts +7 -0
- package/dist/Components/Timeline/Timeline.d.ts +1 -0
- package/dist/Components/Timeline/Timeline.js +1 -0
- package/dist/Components/Timeline/TimelineProps.d.ts +8 -0
- package/dist/Components/Toaster/Toaster.d.ts +1 -0
- package/dist/Components/Toaster/Toaster.js +1 -0
- package/dist/Components/Toaster/ToasterProps.d.ts +3 -0
- package/dist/Components/Toggle/TableToggle.d.ts +1 -0
- package/dist/Components/Toggle/TableToggle.js +73 -18
- package/dist/Components/Toggle/TableToggleProps.d.ts +6 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +3 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +19 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.d.ts +13 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.js +2 -0
- package/dist/Components/ToolTip/ToolTip.d.ts +1 -0
- package/dist/Components/ToolTip/ToolTip.js +7 -6
- package/dist/Components/ToolTip/ToolTipProps.d.ts +5 -1
- package/dist/Components/Trail/EditableCell.d.ts +2 -0
- package/dist/Components/Trail/EditableCell.js +2 -1
- package/dist/Components/Trail/SelectAllCheckbox.d.ts +1 -0
- package/dist/Components/Trail/SelectAllCheckbox.js +1 -0
- package/dist/Components/Trail/TrailWorks.d.ts +1 -0
- package/dist/Components/Trail/TrailWorks.js +2 -1
- package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +6 -2
- package/dist/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/Components/UserDetails/UserDetails.d.ts +1 -0
- package/dist/Components/UserDetails/UserDetails.js +6 -3
- package/dist/Components/UserDetails/UserDetailsProps.d.ts +30 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +6 -1
- package/dist/Hooks/exclusiveOverlay.d.ts +4 -0
- package/dist/Hooks/exclusiveOverlay.js +22 -0
- package/dist/Hooks/useExclusiveOverlay.d.ts +5 -0
- package/dist/Hooks/useExclusiveOverlay.js +24 -0
- package/dist/Theme/assertPalette.d.ts +1 -1
- package/dist/Theme/assertPalette.js +3 -2
- package/dist/Theme/chakra/Menu.styles.d.ts +2 -0
- package/dist/Theme/chakra/Menu.styles.js +9 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -0
- package/dist/Theme/chakra/Popover.styles.js +5 -1
- package/dist/Theme/chakra/componentStyles.d.ts +5 -0
- package/dist/Theme/chakra/componentStyles.js +16 -9
- package/dist/Theme/chakra/createBrandTheme.js +22 -9
- package/dist/Theme/chakra/focusRing.styles.d.ts +52 -0
- package/dist/Theme/chakra/focusRing.styles.js +46 -0
- package/dist/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/Theme/tokens/brands/index.js +6 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/Theme/tokens/builders/filledSurface.d.ts +29 -0
- package/dist/Theme/tokens/builders/filledSurface.js +74 -0
- package/dist/Theme/tokens/builders/focusRing.d.ts +52 -0
- package/dist/Theme/tokens/builders/focusRing.js +92 -0
- package/dist/Theme/tokens/builders/index.d.ts +2 -0
- package/dist/Theme/tokens/builders/index.js +2 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +41 -3
- package/dist/Theme/tokens/builders/outlineRung.js +82 -5
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
- package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
- package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/Theme/tokens/builders/rowStates.d.ts +13 -0
- package/dist/Theme/tokens/builders/rowStates.js +19 -0
- package/dist/Theme/tokens/builders/scrollShadow.d.ts +2 -0
- package/dist/Theme/tokens/builders/scrollShadow.js +16 -0
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -2
- package/dist/Theme/tokens/builders/surfaceRungs.js +19 -9
- package/dist/Theme/tokens/types.d.ts +21 -1
- package/dist/Utils/table.d.ts +3 -0
- package/dist/Utils/table.js +49 -3
- package/dist/esm/Components/Accordion/Accordion.js +4 -1
- package/dist/esm/Components/AlertDialog/AlertDialog.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +1 -0
- package/dist/esm/Components/AppSwitcher/AppMark.js +56 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +243 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +78 -0
- package/dist/esm/Components/AppSwitcher/useAppSwitcherShortcut.js +27 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/esm/Components/Button/Button.js +5 -4
- package/dist/esm/Components/Button/Button.styles.js +38 -24
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +2 -4
- package/dist/esm/Components/Card/Card.js +2 -2
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +21 -12
- package/dist/esm/Components/Checkbox/Checkbox.js +2 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +13 -8
- package/dist/esm/Components/Common/ErrorComponent.js +7 -5
- package/dist/esm/Components/Common/ErrorMessage.js +2 -2
- package/dist/esm/Components/Common/FormLabel.js +1 -0
- package/dist/esm/Components/Common/FormattedDescription.js +1 -0
- package/dist/esm/Components/Common/HelperText.js +2 -0
- package/dist/esm/Components/Common/Label.js +1 -0
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -0
- package/dist/esm/Components/CopyButton/CopyButton.js +10 -4
- package/dist/esm/Components/DatePicker/CalendarPanel.js +38 -16
- package/dist/esm/Components/DatePicker/DatePicker.js +1 -0
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +31 -6
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +50 -15
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +1 -0
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +11 -2
- package/dist/esm/Components/DatePicker/TimePicker.js +4 -3
- package/dist/esm/Components/DatePicker/TimePickerInput.js +2 -1
- package/dist/esm/Components/DatePicker/dayStates.js +79 -0
- package/dist/esm/Components/Divider/Divider.js +1 -0
- package/dist/esm/Components/Dropdown/DropDown.js +23 -7
- package/dist/esm/Components/Editor/Editor.js +1 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -5
- package/dist/esm/Components/EmptyState/EmptyState.js +4 -2
- package/dist/esm/Components/FeedbackForm/FeedbackForm.js +1 -0
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +1 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +3 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +8 -6
- package/dist/esm/Components/FileUpload/constants.js +1 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +3 -10
- package/dist/esm/Components/Form/FormWrapper.js +2 -1
- package/dist/esm/Components/Header/components/mobileMenu.js +12 -3
- package/dist/esm/Components/Input/PhoneNumberInput.js +1 -0
- package/dist/esm/Components/Input/Switch/InputSwitch.js +1 -0
- package/dist/esm/Components/Input/TextInput.js +1 -0
- package/dist/esm/Components/Input/TextInput.styles.js +8 -10
- package/dist/esm/Components/InputTextArea/InputTextArea.js +1 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +7 -6
- package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -0
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -0
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +1 -0
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +1 -0
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -0
- package/dist/esm/Components/LimitReachedModal/limitReachedCopy.js +2 -0
- package/dist/esm/Components/Loading/Loading.js +13 -11
- package/dist/esm/Components/MoreItems/MoreItems.js +4 -1
- package/dist/esm/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +9 -10
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +10 -4
- package/dist/esm/Components/Notification/Notification.js +1 -0
- package/dist/esm/Components/NumberInput/NumberInput.js +5 -2
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +7 -6
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +1 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -3
- package/dist/esm/Components/PdfViewer/PdfViewer.js +7 -1
- package/dist/esm/Components/PinInput/PinInput.js +1 -0
- package/dist/esm/Components/PinInputs/PinInputs.js +1 -0
- package/dist/esm/Components/Primitives/Primitives.js +6 -0
- package/dist/esm/Components/ProductCard/ProductReview.js +6 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +1 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +6 -4
- package/dist/esm/Components/ProgressBar/ProgressBar.js +1 -0
- package/dist/esm/Components/RadioButton/RadioButton.js +3 -2
- package/dist/esm/Components/Reorder/Reorder.js +1 -0
- package/dist/esm/Components/RolesPermission/RolesPermission.js +5 -3
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +4 -1
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +1 -0
- package/dist/esm/Components/Search/Search.js +3 -2
- package/dist/esm/Components/SearchSelect/SearchSelect.js +48 -37
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +86 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControlProps.js +1 -0
- package/dist/esm/Components/Select/Select.js +5 -3
- package/dist/esm/Components/Select/Select.styles.js +3 -2
- package/dist/esm/Components/SelectSearch/SelectSearch.js +37 -15
- package/dist/esm/Components/SelectV2/SelectV2.js +20 -5
- package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/esm/Components/SideBar/SideBar.js +5 -3
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +15 -11
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +13 -10
- package/dist/esm/Components/Skeletons/Skeletons.js +1 -0
- package/dist/esm/Components/Slider/Slider.js +9 -1
- package/dist/esm/Components/StageProgress/StageItem.js +1 -0
- package/dist/esm/Components/StageProgress/StageProgress.js +1 -0
- package/dist/esm/Components/StageProgress/StageProgressProps.js +7 -5
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
- package/dist/esm/Components/Switch/Switch.js +1 -0
- package/dist/esm/Components/Table/Table.js +15 -5
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableActions.js +2 -2
- package/dist/esm/Components/Table/components/TableBody.js +44 -18
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +21 -8
- package/dist/esm/Components/Table/components/TableSearch.js +1 -1
- package/dist/esm/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/esm/Components/Table/settings/ManageColumns.js +8 -5
- package/dist/esm/Components/Table/settings/TableSettings.js +7 -5
- package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
- package/dist/esm/Components/Table/variants/classic.js +43 -0
- package/dist/esm/Components/Table/variants/index.js +9 -0
- package/dist/esm/Components/Table/variants/pillInk.js +18 -0
- package/dist/esm/Components/Table/variants/studio.js +46 -0
- package/dist/esm/Components/Table/variants/tokens.js +1 -0
- package/dist/esm/Components/Tag/Tag.js +1 -0
- package/dist/esm/Components/Tag/Tag.styles.js +17 -12
- package/dist/esm/Components/Timeline/Timeline.js +1 -0
- package/dist/esm/Components/Toaster/Toaster.js +1 -0
- package/dist/esm/Components/Toggle/TableToggle.js +72 -17
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +16 -0
- package/dist/esm/Components/ToggleSwitch/ToggleSwitchProps.js +1 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +7 -6
- package/dist/esm/Components/Trail/EditableCell.js +2 -1
- package/dist/esm/Components/Trail/SelectAllCheckbox.js +1 -0
- package/dist/esm/Components/Trail/TrailWorks.js +2 -1
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/esm/Components/UserDetails/UserDetails.js +6 -3
- package/dist/esm/Hooks/exclusiveOverlay.js +16 -0
- package/dist/esm/Hooks/useExclusiveOverlay.js +20 -0
- package/dist/esm/Theme/assertPalette.js +3 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +9 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +5 -1
- package/dist/esm/Theme/chakra/componentStyles.js +16 -9
- package/dist/esm/Theme/chakra/createBrandTheme.js +22 -9
- package/dist/esm/Theme/chakra/focusRing.styles.js +40 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/esm/Theme/tokens/brands/index.js +6 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/filledSurface.js +67 -0
- package/dist/esm/Theme/tokens/builders/focusRing.js +85 -0
- package/dist/esm/Theme/tokens/builders/index.js +2 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +78 -4
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/esm/Theme/tokens/builders/rowStates.js +15 -0
- package/dist/esm/Theme/tokens/builders/scrollShadow.js +13 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -10
- package/dist/esm/Utils/table.js +50 -5
- package/dist/esm/index.js +26 -1
- package/dist/index.d.ts +26 -3
- package/dist/index.js +67 -4
- package/package.json +11 -4
|
@@ -4,6 +4,7 @@ import { pickAccentText, onFilled } from "./accentText.js";
|
|
|
4
4
|
import { withSidebarTokens } from "./sidebarAccent.js";
|
|
5
5
|
import { buildMutedText } from "./mutedText.js";
|
|
6
6
|
import { buildSemanticText, buildOnSemantic } from "./semanticText.js";
|
|
7
|
+
import { buildFocusRing } from "./focusRing.js";
|
|
7
8
|
/**
|
|
8
9
|
* Derives a brand's dark palette from its light palette.
|
|
9
10
|
*
|
|
@@ -238,6 +239,7 @@ export function buildDarkPalette(light) {
|
|
|
238
239
|
]));
|
|
239
240
|
const white = light.white;
|
|
240
241
|
const primary = liftBrand(light.primary, white);
|
|
242
|
+
const background = fromTargets(hueSource, SURFACE_TARGETS, SURFACE_SAT);
|
|
241
243
|
const semantic = {
|
|
242
244
|
success: liftAccent(light.semantic.success, white),
|
|
243
245
|
error: liftAccent(light.semantic.error, white),
|
|
@@ -268,7 +270,7 @@ export function buildDarkPalette(light) {
|
|
|
268
270
|
purple: reverseScale(light.purple),
|
|
269
271
|
pink: reverseScale(light.pink),
|
|
270
272
|
backgroundColor: namedSurfaces,
|
|
271
|
-
background
|
|
273
|
+
background,
|
|
272
274
|
text: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT),
|
|
273
275
|
header: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT + 2),
|
|
274
276
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
@@ -285,6 +287,9 @@ export function buildDarkPalette(light) {
|
|
|
285
287
|
semanticText: buildSemanticText(semantic, namedSurfaces.main),
|
|
286
288
|
onPrimary: onFilled(primary[500], light.white, light.black),
|
|
287
289
|
onSemantic: buildOnSemantic(semantic, light.white, light.black),
|
|
290
|
+
// The dark ring is derived from the LIFTED accent against the dark canvas, not copied from
|
|
291
|
+
// light: the two modes squeeze it from opposite sides, so a shared value fails one of them.
|
|
292
|
+
focusRing: buildFocusRing({ primary, background, backgroundColor: namedSurfaces }),
|
|
288
293
|
// Sidebar is already near-black in light mode, so it needs no inversion.
|
|
289
294
|
sidebar: withSidebarTokens(light),
|
|
290
295
|
boxShadow: {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { contrastRatio } from "./color.js";
|
|
2
|
+
import { AA_NORMAL_TEXT, isDarkCanvas, onFilled } from "./accentText.js";
|
|
3
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
4
|
+
/**
|
|
5
|
+
* The rung one/two steps DARKER than the accent — what a filled button's hover/active needs so its
|
|
6
|
+
* white label stays legible.
|
|
7
|
+
*
|
|
8
|
+
* Every dark scale runs dark -> light across 50 -> 900 (brand scales are rebuilt that way, utility
|
|
9
|
+
* hues are reversed), the mirror of light mode. So "darker than [500]" is [600]/[700] in light but
|
|
10
|
+
* [400]/[300] in dark.
|
|
11
|
+
*/
|
|
12
|
+
const FILL_STEP_RUNGS = { light: [600, 700], dark: [400, 300] };
|
|
13
|
+
/**
|
|
14
|
+
* Lightest rung on `scale` that still carries `white` at WCAG AA. Prefers [500] when it already
|
|
15
|
+
* passes; otherwise walks toward darker rungs. Used for solid fills on buttons, tags, badges and
|
|
16
|
+
* table status pills so consumers never get black ink on a saturated fill when white is achievable.
|
|
17
|
+
*/
|
|
18
|
+
export const solidFillRung = (scale, white) => {
|
|
19
|
+
if (contrastRatio(scale[500], white) >= AA_NORMAL_TEXT)
|
|
20
|
+
return 500;
|
|
21
|
+
const passing = RUNGS.filter((r) => scale[r] && contrastRatio(scale[r], white) >= AA_NORMAL_TEXT);
|
|
22
|
+
if (!passing.length)
|
|
23
|
+
return 500;
|
|
24
|
+
return passing.reduce((a, b) => contrastRatio(scale[a], white) <= contrastRatio(scale[b], white) ? a : b);
|
|
25
|
+
};
|
|
26
|
+
const steppedRung = (base, canvas, step) => {
|
|
27
|
+
const dir = isDarkCanvas(canvas) ? -100 : 100;
|
|
28
|
+
return Math.min(900, Math.max(50, base + dir * step));
|
|
29
|
+
};
|
|
30
|
+
/** Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. */
|
|
31
|
+
export const darkerFillRung = (scale, canvas, white, step) => {
|
|
32
|
+
const base = solidFillRung(scale, white);
|
|
33
|
+
if (base === 500) {
|
|
34
|
+
const mode = isDarkCanvas(canvas) ? "dark" : "light";
|
|
35
|
+
return FILL_STEP_RUNGS[mode][step];
|
|
36
|
+
}
|
|
37
|
+
const stepped = steppedRung(base, canvas, step === 0 ? 1 : 2);
|
|
38
|
+
return stepped;
|
|
39
|
+
};
|
|
40
|
+
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
41
|
+
export const labelOnFill = (fill, white, black) => onFilled(fill, white, black);
|
|
42
|
+
/**
|
|
43
|
+
* Consumer-facing helper: given any `ColorScale` (primary, red, semantic.error, …), return the
|
|
44
|
+
* fill rung and matching ink for solid / hover / active states. Use this whenever you paint a
|
|
45
|
+
* `bg` from a scale — never pair `scale[500]` with `onFilled` or `colors.white` by hand.
|
|
46
|
+
*/
|
|
47
|
+
export const resolveFilledSurface = (scale, colors) => {
|
|
48
|
+
const { white, black, backgroundColor } = colors;
|
|
49
|
+
const canvas = backgroundColor.main;
|
|
50
|
+
const rung = solidFillRung(scale, white);
|
|
51
|
+
const fill = scale[rung];
|
|
52
|
+
const hoverRung = darkerFillRung(scale, canvas, white, 0);
|
|
53
|
+
const hoverFill = scale[hoverRung];
|
|
54
|
+
const activeRung = darkerFillRung(scale, canvas, white, 1);
|
|
55
|
+
const activeFill = scale[activeRung];
|
|
56
|
+
return {
|
|
57
|
+
rung,
|
|
58
|
+
fill,
|
|
59
|
+
color: labelOnFill(fill, white, black),
|
|
60
|
+
hoverRung,
|
|
61
|
+
hoverFill,
|
|
62
|
+
hoverColor: labelOnFill(hoverFill, white, black),
|
|
63
|
+
activeRung,
|
|
64
|
+
activeFill,
|
|
65
|
+
activeColor: labelOnFill(activeFill, white, black),
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, withLightness } from "./color.js";
|
|
2
|
+
import { AA_NON_TEXT } from "./outlineRung.js";
|
|
3
|
+
/** Same lightness granularity `buildDarkPalette` walks its accents at. */
|
|
4
|
+
const LIGHTNESS_STEP = 0.5;
|
|
5
|
+
/**
|
|
6
|
+
* The nearest re-lighting of `hex` that clears `target` against EVERY backdrop at once.
|
|
7
|
+
*
|
|
8
|
+
* Not `settleAcross`: that folds one `liftToContrast` per surface, and each lift walks AWAY from
|
|
9
|
+
* the surface it was handed. That is correct when every backdrop sits on the same side of the ink
|
|
10
|
+
* (its case — a set of light surfaces, or a set of dark ones), and wrong here, where a focus ring
|
|
11
|
+
* is squeezed BETWEEN a near-white canvas and a mid-dark button fill: the lift against the fill
|
|
12
|
+
* walks straight back across the canvas it had just cleared. Seeding `settleAcross` with
|
|
13
|
+
* `primary[500]` measured 1.08-1.99 on the light canvas for every brand for exactly that reason.
|
|
14
|
+
*
|
|
15
|
+
* Walking outward from the seed and testing every backdrop at each step keeps the result the
|
|
16
|
+
* CLOSEST passing colour to the brand accent, so the ring still reads as brand chrome. Contrast is
|
|
17
|
+
* a function of relative luminance alone, and lightness sweeps luminance monotonically from 0 to 1,
|
|
18
|
+
* so if any colour on this hue clears the set, this finds it.
|
|
19
|
+
*/
|
|
20
|
+
export function settleBetween(hex, backdrops, target = AA_NON_TEXT) {
|
|
21
|
+
const clears = (candidate) => backdrops.every((backdrop) => contrastRatio(candidate, backdrop) >= target);
|
|
22
|
+
if (clears(hex))
|
|
23
|
+
return hex;
|
|
24
|
+
const { l } = hexToHsl(hex);
|
|
25
|
+
for (let step = LIGHTNESS_STEP; step <= 100; step += LIGHTNESS_STEP) {
|
|
26
|
+
const darker = withLightness(hex, l - step);
|
|
27
|
+
if (clears(darker))
|
|
28
|
+
return darker;
|
|
29
|
+
const lighter = withLightness(hex, l + step);
|
|
30
|
+
if (clears(lighter))
|
|
31
|
+
return lighter;
|
|
32
|
+
}
|
|
33
|
+
// Unreachable for every shipped brand (the gate proves it) — a brand whose fill and canvas are
|
|
34
|
+
// close enough to leave no gap would land here. Take the end that is least bad rather than throw
|
|
35
|
+
// at import time, and let `focusRing.test.ts` be what reports it.
|
|
36
|
+
const ends = [withLightness(hex, 0), withLightness(hex, 100)];
|
|
37
|
+
const worst = (candidate) => Math.min(...backdrops.map((backdrop) => contrastRatio(candidate, backdrop)));
|
|
38
|
+
return worst(ends[0]) >= worst(ends[1]) ? ends[0] : ends[1];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The three backdrops a focused button's ring is actually drawn against: the page canvas, a card
|
|
42
|
+
* surface, and — because a solid button's ring sits directly against its own fill — `primary[500]`.
|
|
43
|
+
*
|
|
44
|
+
* Deliberately NOT every named surface. `muted`/`accent`/`quaternary` are mid-tone, and a single
|
|
45
|
+
* band asked to clear those AND a dark brand fill has no solution at any hue — contrast is
|
|
46
|
+
* luminance alone, and `skyline`/`storefront` come out with an empty band. That is what the second
|
|
47
|
+
* tone is for: `halo` owns the fill-side adjacency instead.
|
|
48
|
+
*/
|
|
49
|
+
export const focusRingBackdrops = (source) => [
|
|
50
|
+
source.backgroundColor.main,
|
|
51
|
+
source.background[50],
|
|
52
|
+
source.primary[500],
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* The two-tone `:focus-visible` indicator.
|
|
56
|
+
*
|
|
57
|
+
* Chakra's stock ring (`shadows.outline`, a fixed `rgba(66,153,225,.6)`) measured 1.83:1 on the
|
|
58
|
+
* lavender canvas and 1.38:1 on a primary button — a focus indicator you cannot see, on all nine
|
|
59
|
+
* brands. It is one hardcoded blue, so no palette could have saved it.
|
|
60
|
+
*
|
|
61
|
+
* `halo` is the surface tone, drawn as the inner band so the indicator separates from a filled
|
|
62
|
+
* control whatever `colorScheme` painted it. `ring` is the brand accent, walked to the nearest
|
|
63
|
+
* lightness that clears 3:1 on all three backdrops at once — including the halo, so the two tones
|
|
64
|
+
* are always told apart.
|
|
65
|
+
*/
|
|
66
|
+
export const buildFocusRing = (source) => {
|
|
67
|
+
const halo = settleBetween(source.background[50], [source.primary[500]]);
|
|
68
|
+
return {
|
|
69
|
+
halo,
|
|
70
|
+
ring: settleBetween(source.primary[500], [...focusRingBackdrops(source), halo]),
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Re-derives the ring from the FINISHED palette, as the last step of the rung chain.
|
|
75
|
+
*
|
|
76
|
+
* `finalizeLightPalette` and `buildDarkPalette` seed it, but neither is the final word: a brand
|
|
77
|
+
* file may replace `primary` or `background` after the generic derivation runs — `zinc`'s dark
|
|
78
|
+
* palette replaces both, inverting the filled button to near-white — and a ring resolved against
|
|
79
|
+
* the pre-override values is then silently wrong. Same reason `withSurfaceRungs` re-lifts inks the
|
|
80
|
+
* finalizers already derived. `focusRing.test.ts` asserts this is a fixed point.
|
|
81
|
+
*/
|
|
82
|
+
export const withFocusRing = (palette) => ({
|
|
83
|
+
...palette,
|
|
84
|
+
focusRing: buildFocusRing(palette),
|
|
85
|
+
});
|
|
@@ -3,5 +3,7 @@ export * from "./buildBrandTokens.js";
|
|
|
3
3
|
export * from "./buildDarkPalette.js";
|
|
4
4
|
export * from "./chartColorsFromTheme.js";
|
|
5
5
|
export * from "./color.js";
|
|
6
|
+
export * from "./focusRing.js";
|
|
6
7
|
export * from "./scrollbar.js";
|
|
7
8
|
export * from "./gradientInk.js";
|
|
9
|
+
export * from "./placeholderInk.js";
|
|
@@ -7,6 +7,35 @@ import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./col
|
|
|
7
7
|
export const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
8
8
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
9
9
|
export const AA_NON_TEXT = 3;
|
|
10
|
+
/**
|
|
11
|
+
* Resting chrome — card, popover and field outlines — settles here, not at `AA_NON_TEXT`.
|
|
12
|
+
* At 3:1 a container border is text-weight and the UI reads as a wireframe; every mainstream
|
|
13
|
+
* system draws this line far lighter (Tailwind gray-200 1.24, Chakra gray.200 1.30, Material
|
|
14
|
+
* outline-variant 1.61). 1.4.11 asks that a control be identifiable, not that its resting
|
|
15
|
+
* border carry the whole job: the fill, the label and the focus ring do that.
|
|
16
|
+
*
|
|
17
|
+
* That defence was untrue when it was written. Buttons defined no `_focusVisible` at all, so the
|
|
18
|
+
* focus ring was Chakra's stock `shadows.outline` — a fixed blue measuring 1.38:1 on a primary
|
|
19
|
+
* button — and nothing in the library was held to `AA_NON_TEXT` at the moment of focus. It is
|
|
20
|
+
* true now: `focusRing` (`builders/focusRing.ts`) is derived per brand per mode and gated at 3:1
|
|
21
|
+
* on the canvas, on a card and on the button's own fill by `builders/focusRing.test.ts`. If that
|
|
22
|
+
* gate is ever relaxed, this constant loses its justification with it.
|
|
23
|
+
*/
|
|
24
|
+
export const CHROME_BORDER = 1.5;
|
|
25
|
+
// The resting rule between two surfaces — a card edge, a divider, a menu outline. Lighter than
|
|
26
|
+
// CHROME_BORDER, which outlines a control the user acts on.
|
|
27
|
+
export const CHROME_RULE = 1.31;
|
|
28
|
+
/**
|
|
29
|
+
* A rule is decorative, so it has a ceiling and no floor: soften it until the surface it reads
|
|
30
|
+
* hardest against sits at `target`, and leave a already-fainter rung alone. Never `settleAcross`
|
|
31
|
+
* here — that clears a floor on EVERY surface, so one tinted surface drags the rule darker.
|
|
32
|
+
*/
|
|
33
|
+
export function ruleInk(hex, surfaces, target) {
|
|
34
|
+
const loudest = surfaces.reduce((worst, s) => contrastRatio(hex, s) > contrastRatio(hex, worst) ? s : worst);
|
|
35
|
+
return contrastRatio(hex, loudest) > target
|
|
36
|
+
? softenToContrast(hex, loudest, target)
|
|
37
|
+
: hex;
|
|
38
|
+
}
|
|
10
39
|
/**
|
|
11
40
|
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
12
41
|
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
@@ -50,9 +79,10 @@ export function softenToContrast(hex, backdrop, target) {
|
|
|
50
79
|
}
|
|
51
80
|
/**
|
|
52
81
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
53
|
-
* pickers, the editor's inputs).
|
|
54
|
-
*
|
|
55
|
-
*
|
|
82
|
+
* pickers, the editor's inputs). Settled onto `CHROME_BORDER` — lifted when a brand authored it
|
|
83
|
+
* invisibly pale, softened when it overshoots. It was previously lifted to `AA_NON_TEXT`, which
|
|
84
|
+
* shipped 3.85-4.95:1 outlines: a text-weight box around every card and popover.
|
|
85
|
+
* Resolved here rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
56
86
|
*
|
|
57
87
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
58
88
|
* and outside 1.4.11.
|
|
@@ -65,7 +95,9 @@ export function withOutlineRung(palette) {
|
|
|
65
95
|
contrastRatio(current, palette.background[50])
|
|
66
96
|
? palette.backgroundColor.main
|
|
67
97
|
: palette.background[50];
|
|
68
|
-
const resolved =
|
|
98
|
+
const resolved = contrastRatio(current, backdrop) > CHROME_BORDER
|
|
99
|
+
? softenToContrast(current, backdrop, CHROME_BORDER)
|
|
100
|
+
: liftToContrast(current, backdrop, CHROME_BORDER);
|
|
69
101
|
if (resolved === current)
|
|
70
102
|
return palette;
|
|
71
103
|
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
@@ -81,3 +113,45 @@ export function withOutlineRung(palette) {
|
|
|
81
113
|
export function resolveHoverTint(seed, restSurface) {
|
|
82
114
|
return liftToContrast(seed, restSurface, MIN_PERCEPTIBLE_STEP);
|
|
83
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Settles ink into `target` against EVERY surface at once. Softening one step can change which
|
|
118
|
+
* surface is hardest, so resolving against a single pre-computed "hardest" one lands under the
|
|
119
|
+
* floor on another — that is how radiant and rosewood ended up with an invisible outline on
|
|
120
|
+
* their muted surface.
|
|
121
|
+
*/
|
|
122
|
+
export function settleAcross(hex, surfaces, target) {
|
|
123
|
+
const clearsAll = (c) => surfaces.every((s) => contrastRatio(c, s) >= target);
|
|
124
|
+
if (!clearsAll(hex)) {
|
|
125
|
+
return surfaces.reduce((ink, s) => liftToContrast(ink, s, target), hex);
|
|
126
|
+
}
|
|
127
|
+
const { s: sat, l: start } = hexToHsl(hex);
|
|
128
|
+
const toward = relativeLuminance(surfaces[0]) < 0.5 ? -1 : 1;
|
|
129
|
+
let settled = hex;
|
|
130
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
131
|
+
const next = withLightness(hex, l, sat);
|
|
132
|
+
if (!clearsAll(next))
|
|
133
|
+
break;
|
|
134
|
+
settled = next;
|
|
135
|
+
}
|
|
136
|
+
return settled;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* A pure-grey surface sitting `target` contrast away from `backdrop`. Binary search, not a walk:
|
|
140
|
+
* `liftToContrast` cannot move a seed already at lightness 0 or 100, and a pure-white panel seeded
|
|
141
|
+
* itself straight to black. Neutral on purpose — the light palettes are hand-authored and tinted,
|
|
142
|
+
* so lifting one of their surface rungs turns a selected row into a saturated brand block, while
|
|
143
|
+
* the derived dark palettes land on grey and look right.
|
|
144
|
+
*/
|
|
145
|
+
export function neutralStep(backdrop, target) {
|
|
146
|
+
const grey = (l) => withLightness("#808080", l, 0);
|
|
147
|
+
let lo = hexToHsl(backdrop).l;
|
|
148
|
+
let hi = relativeLuminance(backdrop) < 0.5 ? 100 : 0;
|
|
149
|
+
for (let i = 0; i < 20; i += 1) {
|
|
150
|
+
const mid = (lo + hi) / 2;
|
|
151
|
+
if (contrastRatio(grey(mid), backdrop) < target)
|
|
152
|
+
lo = mid;
|
|
153
|
+
else
|
|
154
|
+
hi = mid;
|
|
155
|
+
}
|
|
156
|
+
return grey(hi);
|
|
157
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { contrastRatio } from "./color.js";
|
|
2
|
+
import { liftToContrast, softenToContrast } from "./outlineRung.js";
|
|
3
|
+
import { PLACEHOLDER_TEXT } from "./surfaceRungs.js";
|
|
4
|
+
/**
|
|
5
|
+
* The hint ink for a field: the brand's authored rung settled onto `PLACEHOLDER_TEXT` against the
|
|
6
|
+
* hardest surface a field can land on — lifted when it falls short, softened when it overshoots.
|
|
7
|
+
*
|
|
8
|
+
* Settled rather than floored because the authored rungs measured 3.96-7.73:1 across the brands,
|
|
9
|
+
* and anything much past the floor reads as a field already typed into. The floor is the look:
|
|
10
|
+
* one hint weight for every brand in both modes, instead of a per-brand accident.
|
|
11
|
+
*/
|
|
12
|
+
export const placeholderInkOn = (palette, surfaces) => {
|
|
13
|
+
const rung = palette.placeholder[500];
|
|
14
|
+
const hardest = surfaces.reduce((worst, s) => contrastRatio(rung, s) < contrastRatio(rung, worst) ? s : worst);
|
|
15
|
+
return contrastRatio(rung, hardest) > PLACEHOLDER_TEXT
|
|
16
|
+
? softenToContrast(rung, hardest, PLACEHOLDER_TEXT)
|
|
17
|
+
: liftToContrast(rung, hardest, PLACEHOLDER_TEXT);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Every surface an ENABLED field renders on. Disabled fields are deliberately absent — 1.4.3
|
|
21
|
+
* exempts them, and folding their dimmer fill in here would darken the hint on every other field.
|
|
22
|
+
*/
|
|
23
|
+
export const fieldSurfaces = (palette) => [
|
|
24
|
+
palette.gray[50],
|
|
25
|
+
palette.background[50],
|
|
26
|
+
palette.backgroundColor.main,
|
|
27
|
+
];
|
|
28
|
+
/** The hint ink every field in this library reads. Takes no backdrop: see `fieldSurfaces`. */
|
|
29
|
+
export const placeholderInk = (palette) => placeholderInkOn(palette, fieldSurfaces(palette));
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { liftToContrast, AA_NON_TEXT } from "./outlineRung.js";
|
|
2
2
|
import { AA_NORMAL_TEXT } from "./accentText.js";
|
|
3
|
-
|
|
3
|
+
import { PLACEHOLDER_TEXT } from "./surfaceRungs.js";
|
|
4
|
+
/**
|
|
5
|
+
* A hint is floored at 3:1, not 4.5:1. Held to body-text contrast it stopped reading as a hint —
|
|
6
|
+
* an empty field looked like one already typed into — and the published library ships this rung
|
|
7
|
+
* as the brand authored it. See CHROME-CONSISTENCY.md.
|
|
8
|
+
*/
|
|
4
9
|
export function withPlaceholderRung(palette) {
|
|
5
|
-
const resolved = liftToContrast(palette.placeholder[500], palette.background[50],
|
|
10
|
+
const resolved = liftToContrast(palette.placeholder[500], palette.background[50], PLACEHOLDER_TEXT);
|
|
6
11
|
if (resolved === palette.placeholder[500])
|
|
7
12
|
return palette;
|
|
8
13
|
return { ...palette, placeholder: { ...palette.placeholder, 500: resolved } };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { resolveHoverTint } from "./outlineRung.js";
|
|
2
|
+
/**
|
|
3
|
+
* The three backgrounds a selectable list row can rest on. Every rung is NEUTRAL and pale, so a
|
|
4
|
+
* row's ink stays the canvas ink `withSurfaceRungs` already settled. Seeding a row state from
|
|
5
|
+
* `primary[500]` instead — the filled-button rung — is what painted SelectV2's hovered rows a
|
|
6
|
+
* solid brand fill under unreadable text.
|
|
7
|
+
*/
|
|
8
|
+
export const listRowBackgrounds = (colors) => {
|
|
9
|
+
const selected = colors.backgroundColor.tertiary;
|
|
10
|
+
return {
|
|
11
|
+
active: resolveHoverTint(colors.gray[50], colors.backgroundColor.light),
|
|
12
|
+
selected,
|
|
13
|
+
selectedActive: resolveHoverTint(selected, selected),
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const EDGE = "24px";
|
|
2
|
+
const TINT = "rgba(0, 0, 0, 0.08)";
|
|
3
|
+
// CSS-only overflow hint via background-attachment local vs scroll — no listener, no extra node.
|
|
4
|
+
export function scrollShadowStyles(surface) {
|
|
5
|
+
return {
|
|
6
|
+
backgroundColor: surface,
|
|
7
|
+
backgroundImage: `linear-gradient(to right, ${surface}, ${surface}), linear-gradient(to left, ${surface}, ${surface}), linear-gradient(to right, ${TINT}, transparent), linear-gradient(to left, ${TINT}, transparent)`,
|
|
8
|
+
backgroundRepeat: "no-repeat",
|
|
9
|
+
backgroundSize: `${EDGE} 100%, ${EDGE} 100%, 8px 100%, 8px 100%`,
|
|
10
|
+
backgroundPosition: "0 0, 100% 0, 0 0, 100% 0",
|
|
11
|
+
backgroundAttachment: "local, local, scroll, scroll",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { contrastRatio } from "./color.js";
|
|
2
|
-
import { liftToContrast,
|
|
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
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A hint is held to the non-text floor, not the body-text one. Deliberate: at 4.5 an empty field
|
|
7
|
+
* reads as one already typed into. See CHROME-CONSISTENCY.md.
|
|
8
|
+
*/
|
|
9
|
+
export const PLACEHOLDER_TEXT = AA_NON_TEXT;
|
|
7
10
|
export const namedSurfaces = (palette) => [
|
|
8
11
|
...Object.values(palette.backgroundColor),
|
|
9
12
|
palette.background[50],
|
|
@@ -15,7 +18,8 @@ export const hardestSurface = (ink, surfaces) => surfaces.reduce((worst, s) => c
|
|
|
15
18
|
export function withSurfaceRungs(palette) {
|
|
16
19
|
const surfaces = namedSurfaces(palette);
|
|
17
20
|
const lift = (ink, target) => liftToContrast(ink, hardestSurface(ink, surfaces), target);
|
|
18
|
-
const
|
|
21
|
+
const settle = (ink, target) => settleAcross(ink, surfaces, target);
|
|
22
|
+
const rule = (ink) => ruleInk(ink, [palette.backgroundColor.main, palette.background[50]], CHROME_RULE);
|
|
19
23
|
const semanticText = SEMANTIC_TONES.reduce((acc, tone) => {
|
|
20
24
|
acc[tone] = lift(palette.semanticText[tone], AA_NORMAL_TEXT);
|
|
21
25
|
return acc;
|
|
@@ -27,12 +31,18 @@ export function withSurfaceRungs(palette) {
|
|
|
27
31
|
semanticText,
|
|
28
32
|
text: { ...palette.text, 500: lift(palette.text[500], AA_NORMAL_TEXT) },
|
|
29
33
|
header: { ...palette.header, 500: lift(palette.header[500], AA_NORMAL_TEXT) },
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
// `placeholder` is deliberately absent: the brand authors that rung and the published
|
|
35
|
+
// library ships it untouched. Its floor is enforced in `placeholderInk`, against the
|
|
36
|
+
// surfaces a FIELD renders on — not `table.hover`, which no field sits on.
|
|
37
|
+
// Settled, not lifted: this rung already passed through `withOutlineRung`, and lifting it
|
|
38
|
+
// again here to AA_NON_TEXT is what shipped 3.85-4.95:1 outlines. See CHROME_BORDER.
|
|
39
|
+
boxborder: {
|
|
40
|
+
...palette.boxborder,
|
|
41
|
+
200: rule(palette.boxborder[200]),
|
|
42
|
+
500: settle(palette.boxborder[500], CHROME_BORDER),
|
|
35
43
|
},
|
|
36
|
-
|
|
44
|
+
// The 200 rung of both ramps is the same job under two names; settle them together or an
|
|
45
|
+
// app picking `border` gets a heavier rule than one picking `boxborder`.
|
|
46
|
+
border: { ...palette.border, 200: rule(palette.border[200]) },
|
|
37
47
|
};
|
|
38
48
|
}
|
package/dist/esm/Utils/table.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
2
|
-
import { DEFAULT_BLACK, DEFAULT_WHITE, isDarkCanvas, onFilled, } from "../Theme/tokens/builders/accentText.js";
|
|
3
|
-
import {
|
|
2
|
+
import { AA_NORMAL_TEXT, DEFAULT_BLACK, DEFAULT_WHITE, isDarkCanvas, onFilled, } from "../Theme/tokens/builders/accentText.js";
|
|
3
|
+
import { compositeOver } from "../Theme/tokens/builders/color.js";
|
|
4
|
+
import { liftToContrast } from "../Theme/tokens/builders/outlineRung.js";
|
|
5
|
+
import { labelOnFill, solidFillRung } from "../Theme/tokens/builders/filledSurface.js";
|
|
6
|
+
import { resolveAvatarFill, resolveStatusTone } from "../Theme/tokens/builders/statusTone.js";
|
|
4
7
|
// Built once, not per comparison: sorting 10k rows runs this ~130k times, and constructing a
|
|
5
8
|
// collator is orders of magnitude dearer than using one.
|
|
6
9
|
const COLLATOR = new Intl.Collator(undefined, {
|
|
@@ -53,7 +56,45 @@ export function SortMultiColumnData(data, sortConfig) {
|
|
|
53
56
|
return 0;
|
|
54
57
|
});
|
|
55
58
|
}
|
|
59
|
+
/** Theme-aware status palette per value — soft fill + semantic ink from `resolveStatusTone`. */
|
|
60
|
+
export function buildSemanticStatusPalette(toneByValue, theme) {
|
|
61
|
+
const c = theme.colors;
|
|
62
|
+
const mode = isDarkCanvas(c.backgroundColor.main) ? "dark" : "light";
|
|
63
|
+
const scales = {
|
|
64
|
+
info: c.semantic.info,
|
|
65
|
+
warning: c.semantic.warning,
|
|
66
|
+
success: c.semantic.success,
|
|
67
|
+
error: c.semantic.error,
|
|
68
|
+
neutral: c.gray,
|
|
69
|
+
};
|
|
70
|
+
return Object.fromEntries(Object.entries(toneByValue).map(([value, key]) => {
|
|
71
|
+
const scale = scales[key];
|
|
72
|
+
const tone = resolveStatusTone(scale, mode);
|
|
73
|
+
const solidRung = solidFillRung(scale, c.white);
|
|
74
|
+
const solid = scale[solidRung];
|
|
75
|
+
return [
|
|
76
|
+
value,
|
|
77
|
+
{
|
|
78
|
+
solid,
|
|
79
|
+
soft: tone.bg,
|
|
80
|
+
text: tone.fg,
|
|
81
|
+
onSolid: labelOnFill(solid, c.white, c.black),
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
56
86
|
const withAlpha = (hex, aa) => /^#([0-9a-fA-F]{6})$/.test(hex) ? `${hex}${aa}` : hex;
|
|
87
|
+
/** Consumer `statusColors` values are fill seeds — derive bleed + pill ink from them. */
|
|
88
|
+
const resolveStatusOverride = (fill, white, black, surface) => {
|
|
89
|
+
const soft = withAlpha(fill, "22");
|
|
90
|
+
const solid = resolveAvatarFill(fill);
|
|
91
|
+
return {
|
|
92
|
+
solid,
|
|
93
|
+
soft,
|
|
94
|
+
text: liftToContrast(fill, compositeOver(soft, surface), AA_NORMAL_TEXT),
|
|
95
|
+
onSolid: onFilled(solid, white, black),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
57
98
|
/** Deterministic, theme-aware color palette for groups + status pills. */
|
|
58
99
|
export function buildTablePalette(theme) {
|
|
59
100
|
const c = theme.colors;
|
|
@@ -72,11 +113,13 @@ export function buildTablePalette(theme) {
|
|
|
72
113
|
];
|
|
73
114
|
return scales.map((scale) => {
|
|
74
115
|
const tone = resolveStatusTone(scale, mode);
|
|
116
|
+
const solidRung = solidFillRung(scale, c.white);
|
|
117
|
+
const solid = scale[solidRung];
|
|
75
118
|
return {
|
|
76
|
-
solid
|
|
119
|
+
solid,
|
|
77
120
|
soft: tone.bg,
|
|
78
121
|
text: tone.fg,
|
|
79
|
-
onSolid:
|
|
122
|
+
onSolid: labelOnFill(solid, c.white, c.black),
|
|
80
123
|
};
|
|
81
124
|
});
|
|
82
125
|
}
|
|
@@ -89,10 +132,12 @@ const hashKey = (value) => {
|
|
|
89
132
|
};
|
|
90
133
|
/** Pick a deterministic palette color for a value, with optional consumer override hex. */
|
|
91
134
|
export function pickTableColor(value, palette, override, theme) {
|
|
135
|
+
var _a;
|
|
92
136
|
const white = theme ? theme.colors.white : DEFAULT_WHITE;
|
|
93
137
|
const black = theme ? theme.colors.black : DEFAULT_BLACK;
|
|
94
138
|
if (override) {
|
|
95
|
-
|
|
139
|
+
const surface = (_a = theme === null || theme === void 0 ? void 0 : theme.colors.background[50]) !== null && _a !== void 0 ? _a : DEFAULT_WHITE;
|
|
140
|
+
return resolveStatusOverride(override, white, black, surface);
|
|
96
141
|
}
|
|
97
142
|
if (!palette.length) {
|
|
98
143
|
throw new Error("pickTableColor: empty palette — build it with buildTablePalette(theme).");
|
package/dist/esm/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import Header from "./Components/Header/Header.js";
|
|
|
23
23
|
import HeaderActions from "./Components/Header/HeaderActions.js";
|
|
24
24
|
import InputTextArea from "./Components/InputTextArea/InputTextArea.js";
|
|
25
25
|
import KanbanBoard from "./Components/KanbanBoard/KanbanBoard.js";
|
|
26
|
+
import KanbanActions from "./Components/KanbanBoard/KanbanActions/KanbanActions.js";
|
|
26
27
|
import Loading from "./Components/Loading/Loading.js";
|
|
27
28
|
import Modal, { ModalHeader, ModalBody, ModalFooter, } from "./Components/Modal/Modal.js";
|
|
28
29
|
import MultiSelect from "./Components/MultiSelect/MultiSelect.js";
|
|
@@ -45,6 +46,8 @@ import Slider from "./Components/Slider/Slider.js";
|
|
|
45
46
|
import ScrollbarBox from "./Components/ScrollbarBox/ScrollbarBox.js";
|
|
46
47
|
import Skeletons from "./Components/Skeletons/Skeletons.js";
|
|
47
48
|
import Switch from "./Components/Switch/Switch.js";
|
|
49
|
+
import ToggleSwitch from "./Components/ToggleSwitch/ToggleSwitch.js";
|
|
50
|
+
import SegmentedControl from "./Components/SegmentedControl/SegmentedControl.js";
|
|
48
51
|
import Table from "./Components/Table/Table.js";
|
|
49
52
|
import Tag from "./Components/Tag/Tag.js";
|
|
50
53
|
import TextInput from "./Components/Input/TextInput.js";
|
|
@@ -84,6 +87,7 @@ import FilePreview, { FilePreviewTrigger, } from "./Components/FilePreview/FileP
|
|
|
84
87
|
import StageProgress from "./Components/StageProgress/StageProgress.js";
|
|
85
88
|
import StageItem from "./Components/StageProgress/StageItem.js";
|
|
86
89
|
import OrgSwitcher from "./Components/OrgSwitcher/OrgSwitcher.js";
|
|
90
|
+
import AppSwitcher from "./Components/AppSwitcher/AppSwitcher.js";
|
|
87
91
|
import UpgradeButton from "./Components/UpgradeButton/UpgradeButton.js";
|
|
88
92
|
import PlanPill from "./Components/PlanPill/PlanPill.js";
|
|
89
93
|
import PlanBadge from "./Components/PlanBadge/PlanBadge.js";
|
|
@@ -97,7 +101,7 @@ import SignInActivityTable from "./Components/SignInActivityTable/SignInActivity
|
|
|
97
101
|
import OrganizationDetails from "./Components/OrganizationDetails/OrganizationDetails.js";
|
|
98
102
|
export {
|
|
99
103
|
// components
|
|
100
|
-
Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp,
|
|
104
|
+
Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, AppSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, KanbanActions, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, ToggleSwitch, SegmentedControl, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp,
|
|
101
105
|
// hooks
|
|
102
106
|
useSidebarPrefs, useIsTruncated,
|
|
103
107
|
// themes
|
|
@@ -124,6 +128,15 @@ export { buildDarkPalette } from "./Theme/tokens/builders/buildDarkPalette.js";
|
|
|
124
128
|
// status chips and generated avatars. Consumers pass a scale/seed and get tokens that already
|
|
125
129
|
// clear the bar, instead of pinning hexes that go stale when a palette moves.
|
|
126
130
|
export { AA_NON_TEXT, liftToContrast, withOutlineRung, } from "./Theme/tokens/builders/outlineRung.js";
|
|
131
|
+
// The three backgrounds a selectable row rests on, for a consumer's own list. Neutral by
|
|
132
|
+
// construction, so the canvas ink stays readable on every one of them.
|
|
133
|
+
export { listRowBackgrounds } from "./Theme/tokens/builders/rowStates.js";
|
|
134
|
+
// The two-tone `:focus-visible` indicator, derived per brand per mode. `buildFocusRing` resolves
|
|
135
|
+
// the pair from a palette; `focusVisibleStyles` is the ready-made Chakra pseudo-selector block a
|
|
136
|
+
// consumer's own control can spread to get the same ring Button draws. Both exist because Chakra's
|
|
137
|
+
// `shadows.outline` is one hardcoded blue that fails WCAG 1.4.11 on every Pixelize palette.
|
|
138
|
+
export { buildFocusRing, settleBetween, withFocusRing } from "./Theme/tokens/builders/focusRing.js";
|
|
139
|
+
export { focusRingShadow, focusVisibleRing, focusVisibleStyles, FOCUS_VISIBLE_OVER_STATE, FOCUS_HALO_WIDTH, FOCUS_RING_WIDTH, } from "./Theme/chakra/focusRing.styles.js";
|
|
127
140
|
export { AVATAR_SEEDS, avatarFillFor, meetsBodyText, resolveAvatarFill, resolveStatusTone, } from "./Theme/tokens/builders/statusTone.js";
|
|
128
141
|
// WCAG contrast + accent-picking helpers this library uses internally to keep text readable
|
|
129
142
|
// against any canvas/fill a palette produces. Pure and dependency-free — consumers building
|
|
@@ -131,9 +144,21 @@ export { AVATAR_SEEDS, avatarFillFor, meetsBodyText, resolveAvatarFill, resolveS
|
|
|
131
144
|
// of re-deriving contrast math themselves.
|
|
132
145
|
export { statusGradient, inkSafeGradient, chipFill, chipBorder, ACCENT_GRADIENT, STATUS_INK, } from "./Components/PlanPill/planPillGradient.js";
|
|
133
146
|
export { isDarkCanvas, onFilled, onGradient, accentTextOnCanvas, pickAccentText, AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE, } from "./Theme/tokens/builders/accentText.js";
|
|
147
|
+
// Filled-surface helpers — use whenever you paint a `bg` from a ColorScale (buttons, badges,
|
|
148
|
+
// chips, alerts). Never pair `scale[500]` with `onFilled` or `colors.white` by hand.
|
|
149
|
+
export { solidFillRung, darkerFillRung, labelOnFill, resolveFilledSurface, } from "./Theme/tokens/builders/filledSurface.js";
|
|
134
150
|
// Pure color math backing the helpers above (and `buildDarkPalette`) — no Chakra/React/DOM
|
|
135
151
|
// dependency, safe for the mobile port. `relativeLuminance`/`contrastRatio` are the WCAG 2.1
|
|
136
152
|
// primitives; `compositeOver` flattens a translucent color onto a backdrop first (an alpha
|
|
137
153
|
// color has no defined luminance on its own, so measure the composited result, not the tint).
|
|
138
154
|
export { hexToRgb, hexToRgba, compositeOver, rgbToHex, rgbToHsl, hslToRgb, hexToHsl, hslToHex, withLightness, mix, relativeLuminance, contrastRatio, } from "./Theme/tokens/builders/color.js";
|
|
155
|
+
// Calendar day marking (`DatePicker` + `isRange`). Exported so a consumer can build a legend,
|
|
156
|
+
// or a summary line, from the SAME keys, tokens and phrasing the calendar itself paints and
|
|
157
|
+
// announces — a hand-copied legend is how a legend goes stale.
|
|
158
|
+
export { DAY_STATE_KEYS, DAY_CLASS as CALENDAR_DAY_CLASS, isDayStateKey, resolveDayStateVisual, describeDayStates, } from "./Components/DatePicker/dayStates.js";
|
|
159
|
+
export { appInitials, filterApps, matchesShortcut, formatShortcut, buildSuiteApps, } from "./Components/AppSwitcher/AppSwitcherProps.js";
|
|
160
|
+
export { useAppSwitcherShortcut } from "./Components/AppSwitcher/useAppSwitcherShortcut.js";
|
|
139
161
|
export { scrollbarStyles, globalScrollbarStyles, SCROLLBAR_WIDTH, } from "./Theme/tokens/builders/scrollbar.js";
|
|
162
|
+
export { placeholderInk, placeholderInkOn, fieldSurfaces } from "./Theme/tokens/builders/placeholderInk.js";
|
|
163
|
+
export { resolveGradient, gradientCss, inkSafeGradient as inkSafeGradientToken, } from "./Theme/tokens/builders/gradientInk.js";
|
|
164
|
+
export * from "./Components/Primitives/Primitives.js";
|