pixelize-design-library 2.4.2-beta.4 → 2.4.2-beta.40
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 +1087 -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 +16 -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/MenuPopoverContent.js +2 -2
- 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/MenuPopoverContent.js +2 -2
- 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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetExclusiveOverlay = exports.exclusiveClose = exports.exclusiveOpen = void 0;
|
|
4
|
+
let active = null;
|
|
5
|
+
const exclusiveOpen = (id, close) => {
|
|
6
|
+
if (active && active.id !== id) {
|
|
7
|
+
active.close();
|
|
8
|
+
}
|
|
9
|
+
active = { id, close };
|
|
10
|
+
};
|
|
11
|
+
exports.exclusiveOpen = exclusiveOpen;
|
|
12
|
+
const exclusiveClose = (id) => {
|
|
13
|
+
if ((active === null || active === void 0 ? void 0 : active.id) === id) {
|
|
14
|
+
active = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.exclusiveClose = exclusiveClose;
|
|
18
|
+
/** Test-only reset — not exported from the package root. */
|
|
19
|
+
const resetExclusiveOverlay = () => {
|
|
20
|
+
active = null;
|
|
21
|
+
};
|
|
22
|
+
exports.resetExclusiveOverlay = resetExclusiveOverlay;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExclusiveOverlay = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const exclusiveOverlay_1 = require("./exclusiveOverlay");
|
|
6
|
+
/**
|
|
7
|
+
* Register this overlay with the global dismiss coordinator. Call `requestOpen()`
|
|
8
|
+
* immediately before opening; `onClose` is invoked when another overlay opens.
|
|
9
|
+
*/
|
|
10
|
+
const useExclusiveOverlay = (isOpen, onClose) => {
|
|
11
|
+
const id = (0, react_1.useId)();
|
|
12
|
+
const onCloseRef = (0, react_1.useRef)(onClose);
|
|
13
|
+
onCloseRef.current = onClose;
|
|
14
|
+
const requestOpen = (0, react_1.useCallback)(() => {
|
|
15
|
+
(0, exclusiveOverlay_1.exclusiveOpen)(id, () => onCloseRef.current());
|
|
16
|
+
}, [id]);
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
18
|
+
if (!isOpen) {
|
|
19
|
+
(0, exclusiveOverlay_1.exclusiveClose)(id);
|
|
20
|
+
}
|
|
21
|
+
}, [isOpen, id]);
|
|
22
|
+
return requestOpen;
|
|
23
|
+
};
|
|
24
|
+
exports.useExclusiveOverlay = useExclusiveOverlay;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaletteProps } from "./tokens/types";
|
|
2
|
-
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic"];
|
|
2
|
+
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic"];
|
|
3
3
|
type Unlisted = Exclude<keyof PaletteProps, (typeof REQUIRED_GROUPS)[number]>;
|
|
4
4
|
export type AllPaletteTokensListed = Unlisted extends never ? true : ["unlisted token", Unlisted];
|
|
5
5
|
export declare const allPaletteTokensListed: AllPaletteTokensListed;
|
|
@@ -5,8 +5,8 @@ const REQUIRED_GROUPS = [
|
|
|
5
5
|
"gradient", "primary", "secondary", "tertiary", "transparent", "black", "white",
|
|
6
6
|
"semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan",
|
|
7
7
|
"purple", "pink", "backgroundColor", "background", "text", "header", "placeholder",
|
|
8
|
-
"boxShadow", "sidebar", "boxborder", "border", "table", "disabled",
|
|
9
|
-
"textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
8
|
+
"boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled",
|
|
9
|
+
"accentText", "textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
10
10
|
];
|
|
11
11
|
exports.allPaletteTokensListed = true;
|
|
12
12
|
const NESTED = [
|
|
@@ -17,6 +17,7 @@ const NESTED = [
|
|
|
17
17
|
]],
|
|
18
18
|
["semanticText", ["success", "error", "warning", "info"]],
|
|
19
19
|
["onSemantic", ["success", "error", "warning", "info"]],
|
|
20
|
+
["focusRing", ["ring", "halo"]],
|
|
20
21
|
["backgroundColor", ["main", "base"]],
|
|
21
22
|
["boxShadow", ["primary", "default"]],
|
|
22
23
|
];
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Menu = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const anatomy_1 = require("@chakra-ui/anatomy");
|
|
6
|
+
const rowStates_1 = require("../tokens/builders/rowStates");
|
|
6
7
|
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
7
8
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.menuAnatomy.keys);
|
|
8
9
|
const $bg = (0, react_1.cssVar)("menu-bg");
|
|
@@ -24,16 +25,19 @@ const $bg = (0, react_1.cssVar)("menu-bg");
|
|
|
24
25
|
const $itemBg = (0, react_1.cssVar)("menu-item-bg");
|
|
25
26
|
const baseStyle = definePartsStyle(({ theme }) => {
|
|
26
27
|
const colors = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const rowBgs = (0, rowStates_1.listRowBackgrounds)(colors);
|
|
29
|
+
const hoverBg = rowBgs.active;
|
|
30
|
+
const activeBg = rowBgs.selectedActive;
|
|
29
31
|
return {
|
|
30
32
|
list: {
|
|
31
33
|
[$bg.variable]: colors.backgroundColor.light,
|
|
32
34
|
bg: $bg.reference,
|
|
33
35
|
color: colors.text[900],
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
36
|
+
// A rule at CHROME_RULE weight, not Chakra's gray.200: that default read as a hard edge,
|
|
37
|
+
// which is why this shipped borderless. At 1.31:1 the edge defines the surface instead.
|
|
38
|
+
borderWidth: "1px",
|
|
39
|
+
borderStyle: "solid",
|
|
40
|
+
borderColor: colors.boxborder[200],
|
|
37
41
|
},
|
|
38
42
|
// Own CSS var (`--menu-item-bg`), NOT the list's `--menu-bg` — Chakra's stock item
|
|
39
43
|
// baseStyle rewrites `--menu-bg` itself on hover/focus, so reusing that same var name
|
|
@@ -21,8 +21,12 @@ const baseStyle = definePartsStyle(({ theme }) => {
|
|
|
21
21
|
content: {
|
|
22
22
|
[$popperBg.variable]: colors.backgroundColor.light,
|
|
23
23
|
bg: $popperBg.reference,
|
|
24
|
-
[$arrowShadowColor.variable]: colors.
|
|
24
|
+
[$arrowShadowColor.variable]: colors.boxborder[200],
|
|
25
25
|
color: colors.text[900],
|
|
26
|
+
// Matches Menu: a CHROME_RULE-weight edge, not Chakra's gray.200 hard edge.
|
|
27
|
+
borderWidth: "1px",
|
|
28
|
+
borderStyle: "solid",
|
|
29
|
+
borderColor: colors.boxborder[200],
|
|
26
30
|
},
|
|
27
31
|
};
|
|
28
32
|
});
|
|
@@ -73,6 +73,8 @@ export declare const componentStyles: {
|
|
|
73
73
|
[x: string]: string;
|
|
74
74
|
bg: string;
|
|
75
75
|
color: string;
|
|
76
|
+
borderWidth: string;
|
|
77
|
+
borderStyle: string;
|
|
76
78
|
borderColor: string;
|
|
77
79
|
};
|
|
78
80
|
item: {
|
|
@@ -143,6 +145,9 @@ export declare const componentStyles: {
|
|
|
143
145
|
[x: string]: string;
|
|
144
146
|
bg: string;
|
|
145
147
|
color: string;
|
|
148
|
+
borderWidth: string;
|
|
149
|
+
borderStyle: string;
|
|
150
|
+
borderColor: string;
|
|
146
151
|
};
|
|
147
152
|
}) | undefined;
|
|
148
153
|
sizes?: {
|
|
@@ -12,6 +12,7 @@ const Tag_styles_1 = require("../../Components/Tag/Tag.styles");
|
|
|
12
12
|
const InputTextArea_style_1 = require("../../Components/InputTextArea/InputTextArea.style");
|
|
13
13
|
const NumberInput_styles_1 = require("../../Components/NumberInput/NumberInput.styles");
|
|
14
14
|
const accentText_1 = require("../tokens/builders/accentText");
|
|
15
|
+
const filledSurface_1 = require("../tokens/builders/filledSurface");
|
|
15
16
|
const color_1 = require("../tokens/builders/color");
|
|
16
17
|
const outlineRung_1 = require("../tokens/builders/outlineRung");
|
|
17
18
|
const Drawer_styles_1 = require("./Drawer.styles");
|
|
@@ -27,6 +28,14 @@ const Avatar_styles_1 = require("./Avatar.styles");
|
|
|
27
28
|
// math (hexToRgb) throws on those on purpose (see color.ts). Guard so those scales fall back to
|
|
28
29
|
// Chakra's own original fixed rung instead of computing contrast on a color it can't parse.
|
|
29
30
|
const isHexColor = (color) => typeof color === "string" && /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(color);
|
|
31
|
+
const solidFillStyle = (palette, swatch) => {
|
|
32
|
+
const rung = (0, filledSurface_1.solidFillRung)(swatch, palette.white);
|
|
33
|
+
const bg = swatch[rung];
|
|
34
|
+
return {
|
|
35
|
+
bg,
|
|
36
|
+
color: isHexColor(bg) ? (0, filledSurface_1.labelOnFill)(bg, palette.white, palette.black) : swatch[800],
|
|
37
|
+
};
|
|
38
|
+
};
|
|
30
39
|
// Badge isn't its own component family (no Components/Badge/), so its style config lives here —
|
|
31
40
|
// Chakra's stock `solid` variant hardcodes a white label on a variable fill, same AA gap Tag had.
|
|
32
41
|
const Badge = {
|
|
@@ -34,11 +43,7 @@ const Badge = {
|
|
|
34
43
|
solid: ({ theme, colorScheme = "gray" }) => {
|
|
35
44
|
const palette = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
36
45
|
const swatch = (0, paletteFromTheme_1.scaleFor)(palette, colorScheme);
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
bg,
|
|
40
|
-
color: isHexColor(bg) ? (0, accentText_1.onFilled)(bg, palette.white, palette.black) : swatch[800],
|
|
41
|
-
};
|
|
46
|
+
return solidFillStyle(palette, swatch);
|
|
42
47
|
},
|
|
43
48
|
// Chakra's stock `subtle` picks its bg/color pair via `mode()`, keyed to Chakra's own
|
|
44
49
|
// colorMode — which this app never toggles (dark mode swaps the palette object instead), so
|
|
@@ -90,13 +95,14 @@ const Alert = defineAlertStyles({
|
|
|
90
95
|
variants: {
|
|
91
96
|
solid: defineAlertParts(({ theme, colorScheme = "gray" }) => {
|
|
92
97
|
const palette = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
93
|
-
const
|
|
98
|
+
const swatch = (0, paletteFromTheme_1.scaleFor)(palette, colorScheme);
|
|
99
|
+
const { bg, color } = solidFillStyle(palette, swatch);
|
|
94
100
|
if (!isHexColor(bg))
|
|
95
101
|
return { container: {} };
|
|
96
102
|
return {
|
|
97
103
|
container: {
|
|
98
104
|
[$alertBg.variable]: bg,
|
|
99
|
-
[$alertFg.variable]:
|
|
105
|
+
[$alertFg.variable]: color,
|
|
100
106
|
},
|
|
101
107
|
};
|
|
102
108
|
}),
|
|
@@ -154,8 +160,9 @@ const Skeleton = {
|
|
|
154
160
|
const Radio = {
|
|
155
161
|
baseStyle: ({ theme, colorScheme }) => {
|
|
156
162
|
const palette = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
157
|
-
const
|
|
158
|
-
const
|
|
163
|
+
const swatch = (0, paletteFromTheme_1.scaleFor)(palette, colorScheme);
|
|
164
|
+
const fill = swatch[(0, filledSurface_1.solidFillRung)(swatch, palette.white)];
|
|
165
|
+
const dot = (0, filledSurface_1.labelOnFill)(fill, palette.white, palette.black);
|
|
159
166
|
// A browser probe found the checked radio's hover repeating its own resting `fill` —
|
|
160
167
|
// Chakra's stock checked._hover (inherited from checkbox) lands on the SAME `bg`/`borderColor`
|
|
161
168
|
// keys we do, so extendTheme's merge is a scalar overwrite here, not a coexisting selector;
|
|
@@ -8,8 +8,9 @@ const react_1 = require("@chakra-ui/react");
|
|
|
8
8
|
const common_web_1 = __importDefault(require("./common.web"));
|
|
9
9
|
const fonts_web_1 = __importDefault(require("./fonts.web"));
|
|
10
10
|
const componentStyles_1 = require("./componentStyles");
|
|
11
|
-
const
|
|
11
|
+
const filledSurface_1 = require("../tokens/builders/filledSurface");
|
|
12
12
|
const scrollbar_1 = require("../tokens/builders/scrollbar");
|
|
13
|
+
const focusRing_styles_1 = require("./focusRing.styles");
|
|
13
14
|
/**
|
|
14
15
|
* Builds a Chakra theme from a pure brand palette.
|
|
15
16
|
*
|
|
@@ -27,6 +28,12 @@ const createBrandTheme = (palette, options = {}) => {
|
|
|
27
28
|
colors: palette,
|
|
28
29
|
...fonts_web_1.default,
|
|
29
30
|
...common_web_1.default,
|
|
31
|
+
// `shadows.outline` is what Chakra's stock `_focusVisible` reaches for on EVERY component it
|
|
32
|
+
// themes. The primitive ships one hardcoded blue (`rgba(66,153,225,.6)`), which measured
|
|
33
|
+
// 1.83:1 on the lavender canvas and 1.38:1 on a primary button — below 1.4.11's 3:1 on all
|
|
34
|
+
// nine brands, in both modes. A primitive cannot know the palette; this is the first place
|
|
35
|
+
// that does, so the palette-derived ring is bound here and every stock focus state inherits it.
|
|
36
|
+
shadows: { ...common_web_1.default.shadows, outline: (0, focusRing_styles_1.focusRingShadow)(palette) },
|
|
30
37
|
};
|
|
31
38
|
return (0, react_1.extendTheme)({
|
|
32
39
|
...brand,
|
|
@@ -81,14 +88,20 @@ const createBrandTheme = (palette, options = {}) => {
|
|
|
81
88
|
// selecting text anywhere (e.g. a table cell) shows a stray white/lavender patch on
|
|
82
89
|
// the dark canvas. Brand it instead, with WCAG-safe ink via the same `onFilled` math
|
|
83
90
|
// used for buttons/badges.
|
|
84
|
-
"::selection": {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
"::selection": (() => {
|
|
92
|
+
const solid = (0, filledSurface_1.resolveFilledSurface)(palette.primary, palette);
|
|
93
|
+
return {
|
|
94
|
+
background: solid.fill,
|
|
95
|
+
color: solid.color,
|
|
96
|
+
};
|
|
97
|
+
})(),
|
|
98
|
+
"::-moz-selection": (() => {
|
|
99
|
+
const solid = (0, filledSurface_1.resolveFilledSurface)(palette.primary, palette);
|
|
100
|
+
return {
|
|
101
|
+
background: solid.fill,
|
|
102
|
+
color: solid.color,
|
|
103
|
+
};
|
|
104
|
+
})(),
|
|
92
105
|
// `color-scheme: dark` gives WebKit/Blink a dark scrollbar by default, but it's the
|
|
93
106
|
// OS's generic dark gray, not brand-aware.
|
|
94
107
|
...(0, scrollbar_1.globalScrollbarStyles)(palette),
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FocusRingTokens } from "../tokens/types";
|
|
2
|
+
/**
|
|
3
|
+
* WEB binding for the `focusRing` token pair. The colours are derived in
|
|
4
|
+
* `tokens/builders/focusRing.ts` (pure, shared with the mobile library); the CSS shape —
|
|
5
|
+
* box-shadow bands, the forced-colors outline — is web-only and lives here.
|
|
6
|
+
*/
|
|
7
|
+
/** Inner band, in the surface tone: separates the ring from the control's own fill. */
|
|
8
|
+
export declare const FOCUS_HALO_WIDTH = 2;
|
|
9
|
+
/** Outer edge of the brand band. The band itself is the 2px between halo and ring. */
|
|
10
|
+
export declare const FOCUS_RING_WIDTH = 4;
|
|
11
|
+
type WithFocusRing = {
|
|
12
|
+
focusRing: FocusRingTokens;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The two-tone ring as a single `box-shadow`. Drawn OUTSIDE the border box, so it costs no
|
|
16
|
+
* layout and never resizes the control — the reason this is a shadow and not an outline.
|
|
17
|
+
*/
|
|
18
|
+
export declare const focusRingShadow: (colors: WithFocusRing) => string;
|
|
19
|
+
/**
|
|
20
|
+
* `:hover`, `:active` and `:focus-visible` all score the same specificity, so which one paints
|
|
21
|
+
* comes down to source order — and in the merged style object Chakra's own Button baseStyle
|
|
22
|
+
* registers `_focusVisible` BEFORE `_hover`. A focused button that is also hovered would then
|
|
23
|
+
* drop the ring for `_hover`'s `boxShadow: "sm"`. Stacking the pseudo-classes raises the
|
|
24
|
+
* specificity above both, so the ring survives whatever else the state repaints.
|
|
25
|
+
*/
|
|
26
|
+
export declare const FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
27
|
+
/**
|
|
28
|
+
* `:focus-visible`, never `:focus` — a mouse click must not draw a ring.
|
|
29
|
+
*
|
|
30
|
+
* The transparent outline is not decoration: in Windows High Contrast / `forced-colors` mode
|
|
31
|
+
* box-shadows are dropped entirely, and a transparent outline is the one thing the OS repaints
|
|
32
|
+
* in its own focus colour. Without it, forced-colors users get no indicator at all.
|
|
33
|
+
*/
|
|
34
|
+
export declare const focusVisibleRing: (colors: WithFocusRing) => {
|
|
35
|
+
outline: string;
|
|
36
|
+
outlineOffset: string;
|
|
37
|
+
boxShadow: string;
|
|
38
|
+
};
|
|
39
|
+
/** Both selectors a control needs to keep the ring on top of its own hover/active styling. */
|
|
40
|
+
export declare const focusVisibleStyles: (colors: WithFocusRing) => {
|
|
41
|
+
_focusVisible: {
|
|
42
|
+
outline: string;
|
|
43
|
+
outlineOffset: string;
|
|
44
|
+
boxShadow: string;
|
|
45
|
+
};
|
|
46
|
+
"&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible": {
|
|
47
|
+
outline: string;
|
|
48
|
+
outlineOffset: string;
|
|
49
|
+
boxShadow: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.focusVisibleStyles = exports.focusVisibleRing = exports.FOCUS_VISIBLE_OVER_STATE = exports.focusRingShadow = exports.FOCUS_RING_WIDTH = exports.FOCUS_HALO_WIDTH = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* WEB binding for the `focusRing` token pair. The colours are derived in
|
|
6
|
+
* `tokens/builders/focusRing.ts` (pure, shared with the mobile library); the CSS shape —
|
|
7
|
+
* box-shadow bands, the forced-colors outline — is web-only and lives here.
|
|
8
|
+
*/
|
|
9
|
+
/** Inner band, in the surface tone: separates the ring from the control's own fill. */
|
|
10
|
+
exports.FOCUS_HALO_WIDTH = 2;
|
|
11
|
+
/** Outer edge of the brand band. The band itself is the 2px between halo and ring. */
|
|
12
|
+
exports.FOCUS_RING_WIDTH = 4;
|
|
13
|
+
/**
|
|
14
|
+
* The two-tone ring as a single `box-shadow`. Drawn OUTSIDE the border box, so it costs no
|
|
15
|
+
* layout and never resizes the control — the reason this is a shadow and not an outline.
|
|
16
|
+
*/
|
|
17
|
+
const focusRingShadow = (colors) => `0 0 0 ${exports.FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
18
|
+
`0 0 0 ${exports.FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
19
|
+
exports.focusRingShadow = focusRingShadow;
|
|
20
|
+
/**
|
|
21
|
+
* `:hover`, `:active` and `:focus-visible` all score the same specificity, so which one paints
|
|
22
|
+
* comes down to source order — and in the merged style object Chakra's own Button baseStyle
|
|
23
|
+
* registers `_focusVisible` BEFORE `_hover`. A focused button that is also hovered would then
|
|
24
|
+
* drop the ring for `_hover`'s `boxShadow: "sm"`. Stacking the pseudo-classes raises the
|
|
25
|
+
* specificity above both, so the ring survives whatever else the state repaints.
|
|
26
|
+
*/
|
|
27
|
+
exports.FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
28
|
+
/**
|
|
29
|
+
* `:focus-visible`, never `:focus` — a mouse click must not draw a ring.
|
|
30
|
+
*
|
|
31
|
+
* The transparent outline is not decoration: in Windows High Contrast / `forced-colors` mode
|
|
32
|
+
* box-shadows are dropped entirely, and a transparent outline is the one thing the OS repaints
|
|
33
|
+
* in its own focus colour. Without it, forced-colors users get no indicator at all.
|
|
34
|
+
*/
|
|
35
|
+
const focusVisibleRing = (colors) => ({
|
|
36
|
+
outline: "2px solid transparent",
|
|
37
|
+
outlineOffset: "2px",
|
|
38
|
+
boxShadow: (0, exports.focusRingShadow)(colors),
|
|
39
|
+
});
|
|
40
|
+
exports.focusVisibleRing = focusVisibleRing;
|
|
41
|
+
/** Both selectors a control needs to keep the ring on top of its own hover/active styling. */
|
|
42
|
+
const focusVisibleStyles = (colors) => {
|
|
43
|
+
const ring = (0, exports.focusVisibleRing)(colors);
|
|
44
|
+
return { _focusVisible: ring, [exports.FOCUS_VISIBLE_OVER_STATE]: ring };
|
|
45
|
+
};
|
|
46
|
+
exports.focusVisibleStyles = focusVisibleStyles;
|
|
@@ -26,7 +26,10 @@ const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
|
26
26
|
* regardless of which brand/mode is currently active.
|
|
27
27
|
*/
|
|
28
28
|
const brandSwatchColor = (brand) => index_1.brandThemes[brand].light.colors.primary[500];
|
|
29
|
-
const BrandSwatch = ({ brand }) =>
|
|
29
|
+
const BrandSwatch = ({ brand }) => {
|
|
30
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: colors.boxborder[200], flexShrink: 0 }));
|
|
32
|
+
};
|
|
30
33
|
/**
|
|
31
34
|
* Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
|
|
32
35
|
* are read straight from the active theme — no `useColorModeValue` pairing needed here.
|
|
@@ -39,7 +42,7 @@ const useSwitcherColors = () => {
|
|
|
39
42
|
activeColor: colors.primary[500],
|
|
40
43
|
mutedColor: colors.text[600],
|
|
41
44
|
hoverBg: colors.gray[100],
|
|
42
|
-
borderColor: colors.
|
|
45
|
+
borderColor: colors.boxborder[200],
|
|
43
46
|
// NOTE: menuBg lives in Menu.styles.ts — re-pushing it via `sx` flickers on every render.
|
|
44
47
|
menuColor: colors.text[900],
|
|
45
48
|
};
|
|
@@ -46,6 +46,7 @@ const sidebarAccent_1 = require("../builders/sidebarAccent");
|
|
|
46
46
|
const mutedText_1 = require("../builders/mutedText");
|
|
47
47
|
const semanticText_1 = require("../builders/semanticText");
|
|
48
48
|
const resolvedRungs_1 = require("../builders/resolvedRungs");
|
|
49
|
+
const focusRing_1 = require("../builders/focusRing");
|
|
49
50
|
const surfaceRungs_1 = require("../builders/surfaceRungs");
|
|
50
51
|
/** Derived, never hand-written: a copied hex goes stale the moment a canvas moves. */
|
|
51
52
|
const finalizeLightPalette = (source) => ({
|
|
@@ -56,9 +57,13 @@ const finalizeLightPalette = (source) => ({
|
|
|
56
57
|
semanticText: (0, semanticText_1.buildSemanticText)(source.semantic, source.backgroundColor.main),
|
|
57
58
|
onPrimary: (0, accentText_1.onFilled)(source.primary[500], source.white, source.black),
|
|
58
59
|
onSemantic: (0, semanticText_1.buildOnSemantic)(source.semantic, source.white, source.black),
|
|
60
|
+
focusRing: (0, focusRing_1.buildFocusRing)(source),
|
|
59
61
|
});
|
|
60
62
|
exports.finalizeLightPalette = finalizeLightPalette;
|
|
61
|
-
|
|
63
|
+
// `withFocusRing` is outermost: it is the only step that reads `primary` and the surfaces
|
|
64
|
+
// TOGETHER, so it must see both after every earlier step — and after a brand file's own
|
|
65
|
+
// post-derivation overrides (zinc dark replaces `primary` and `background` wholesale).
|
|
66
|
+
const resolveRungs = (palette) => (0, focusRing_1.withFocusRing)((0, surfaceRungs_1.withSurfaceRungs)((0, resolvedRungs_1.withTableHoverRung)((0, resolvedRungs_1.withPlaceholderRung)((0, outlineRung_1.withOutlineRung)(palette)))));
|
|
62
67
|
const lightBrand = (source) => resolveRungs((0, exports.finalizeLightPalette)(source));
|
|
63
68
|
/** Light palette per brand. `lavender` is the base the other six extend. */
|
|
64
69
|
exports.lightPalettes = {
|
|
@@ -197,6 +197,7 @@ declare const palette: {
|
|
|
197
197
|
purple: import("../..").ColorScale;
|
|
198
198
|
pink: import("../..").ColorScale;
|
|
199
199
|
backgroundColor: import("../..").NamedSurfaces;
|
|
200
|
+
focusRing: import("../..").FocusRingTokens;
|
|
200
201
|
sidebar: import("../..").SidebarTokens;
|
|
201
202
|
semanticText: import("../..").SemanticTextTokens;
|
|
202
203
|
textMuted: string;
|
|
@@ -8,6 +8,7 @@ const accentText_1 = require("./accentText");
|
|
|
8
8
|
const sidebarAccent_1 = require("./sidebarAccent");
|
|
9
9
|
const mutedText_1 = require("./mutedText");
|
|
10
10
|
const semanticText_1 = require("./semanticText");
|
|
11
|
+
const focusRing_1 = require("./focusRing");
|
|
11
12
|
/**
|
|
12
13
|
* Derives a brand's dark palette from its light palette.
|
|
13
14
|
*
|
|
@@ -246,6 +247,7 @@ function buildDarkPalette(light) {
|
|
|
246
247
|
]));
|
|
247
248
|
const white = light.white;
|
|
248
249
|
const primary = liftBrand(light.primary, white);
|
|
250
|
+
const background = fromTargets(hueSource, SURFACE_TARGETS, SURFACE_SAT);
|
|
249
251
|
const semantic = {
|
|
250
252
|
success: liftAccent(light.semantic.success, white),
|
|
251
253
|
error: liftAccent(light.semantic.error, white),
|
|
@@ -276,7 +278,7 @@ function buildDarkPalette(light) {
|
|
|
276
278
|
purple: (0, exports.reverseScale)(light.purple),
|
|
277
279
|
pink: (0, exports.reverseScale)(light.pink),
|
|
278
280
|
backgroundColor: namedSurfaces,
|
|
279
|
-
background
|
|
281
|
+
background,
|
|
280
282
|
text: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT),
|
|
281
283
|
header: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT + 2),
|
|
282
284
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
@@ -293,6 +295,9 @@ function buildDarkPalette(light) {
|
|
|
293
295
|
semanticText: (0, semanticText_1.buildSemanticText)(semantic, namedSurfaces.main),
|
|
294
296
|
onPrimary: (0, accentText_1.onFilled)(primary[500], light.white, light.black),
|
|
295
297
|
onSemantic: (0, semanticText_1.buildOnSemantic)(semantic, light.white, light.black),
|
|
298
|
+
// The dark ring is derived from the LIFTED accent against the dark canvas, not copied from
|
|
299
|
+
// light: the two modes squeeze it from opposite sides, so a shared value fails one of them.
|
|
300
|
+
focusRing: (0, focusRing_1.buildFocusRing)({ primary, background, backgroundColor: namedSurfaces }),
|
|
296
301
|
// Sidebar is already near-black in light mode, so it needs no inversion.
|
|
297
302
|
sidebar: (0, sidebarAccent_1.withSidebarTokens)(light),
|
|
298
303
|
boxShadow: {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ColorScale, PaletteProps } from "../types";
|
|
2
|
+
/** Resolved fill + ink for a solid surface, including hover/active steps. */
|
|
3
|
+
export type FilledSurface = {
|
|
4
|
+
rung: keyof ColorScale;
|
|
5
|
+
fill: string;
|
|
6
|
+
color: string;
|
|
7
|
+
hoverRung: keyof ColorScale;
|
|
8
|
+
hoverFill: string;
|
|
9
|
+
hoverColor: string;
|
|
10
|
+
activeRung: keyof ColorScale;
|
|
11
|
+
activeFill: string;
|
|
12
|
+
activeColor: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Lightest rung on `scale` that still carries `white` at WCAG AA. Prefers [500] when it already
|
|
16
|
+
* passes; otherwise walks toward darker rungs. Used for solid fills on buttons, tags, badges and
|
|
17
|
+
* table status pills so consumers never get black ink on a saturated fill when white is achievable.
|
|
18
|
+
*/
|
|
19
|
+
export declare const solidFillRung: (scale: ColorScale, white: string) => keyof ColorScale;
|
|
20
|
+
/** Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. */
|
|
21
|
+
export declare const darkerFillRung: (scale: ColorScale, canvas: string, white: string, step: 0 | 1) => keyof ColorScale;
|
|
22
|
+
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
23
|
+
export declare const labelOnFill: (fill: string, white: string, black: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Consumer-facing helper: given any `ColorScale` (primary, red, semantic.error, …), return the
|
|
26
|
+
* fill rung and matching ink for solid / hover / active states. Use this whenever you paint a
|
|
27
|
+
* `bg` from a scale — never pair `scale[500]` with `onFilled` or `colors.white` by hand.
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveFilledSurface: (scale: ColorScale, colors: Pick<PaletteProps, "white" | "black" | "backgroundColor">) => FilledSurface;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveFilledSurface = exports.labelOnFill = exports.darkerFillRung = exports.solidFillRung = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
const accentText_1 = require("./accentText");
|
|
6
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
7
|
+
/**
|
|
8
|
+
* The rung one/two steps DARKER than the accent — what a filled button's hover/active needs so its
|
|
9
|
+
* white label stays legible.
|
|
10
|
+
*
|
|
11
|
+
* Every dark scale runs dark -> light across 50 -> 900 (brand scales are rebuilt that way, utility
|
|
12
|
+
* hues are reversed), the mirror of light mode. So "darker than [500]" is [600]/[700] in light but
|
|
13
|
+
* [400]/[300] in dark.
|
|
14
|
+
*/
|
|
15
|
+
const FILL_STEP_RUNGS = { light: [600, 700], dark: [400, 300] };
|
|
16
|
+
/**
|
|
17
|
+
* Lightest rung on `scale` that still carries `white` at WCAG AA. Prefers [500] when it already
|
|
18
|
+
* passes; otherwise walks toward darker rungs. Used for solid fills on buttons, tags, badges and
|
|
19
|
+
* table status pills so consumers never get black ink on a saturated fill when white is achievable.
|
|
20
|
+
*/
|
|
21
|
+
const solidFillRung = (scale, white) => {
|
|
22
|
+
if ((0, color_1.contrastRatio)(scale[500], white) >= accentText_1.AA_NORMAL_TEXT)
|
|
23
|
+
return 500;
|
|
24
|
+
const passing = RUNGS.filter((r) => scale[r] && (0, color_1.contrastRatio)(scale[r], white) >= accentText_1.AA_NORMAL_TEXT);
|
|
25
|
+
if (!passing.length)
|
|
26
|
+
return 500;
|
|
27
|
+
return passing.reduce((a, b) => (0, color_1.contrastRatio)(scale[a], white) <= (0, color_1.contrastRatio)(scale[b], white) ? a : b);
|
|
28
|
+
};
|
|
29
|
+
exports.solidFillRung = solidFillRung;
|
|
30
|
+
const steppedRung = (base, canvas, step) => {
|
|
31
|
+
const dir = (0, accentText_1.isDarkCanvas)(canvas) ? -100 : 100;
|
|
32
|
+
return Math.min(900, Math.max(50, base + dir * step));
|
|
33
|
+
};
|
|
34
|
+
/** Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. */
|
|
35
|
+
const darkerFillRung = (scale, canvas, white, step) => {
|
|
36
|
+
const base = (0, exports.solidFillRung)(scale, white);
|
|
37
|
+
if (base === 500) {
|
|
38
|
+
const mode = (0, accentText_1.isDarkCanvas)(canvas) ? "dark" : "light";
|
|
39
|
+
return FILL_STEP_RUNGS[mode][step];
|
|
40
|
+
}
|
|
41
|
+
const stepped = steppedRung(base, canvas, step === 0 ? 1 : 2);
|
|
42
|
+
return stepped;
|
|
43
|
+
};
|
|
44
|
+
exports.darkerFillRung = darkerFillRung;
|
|
45
|
+
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
46
|
+
const labelOnFill = (fill, white, black) => (0, accentText_1.onFilled)(fill, white, black);
|
|
47
|
+
exports.labelOnFill = labelOnFill;
|
|
48
|
+
/**
|
|
49
|
+
* Consumer-facing helper: given any `ColorScale` (primary, red, semantic.error, …), return the
|
|
50
|
+
* fill rung and matching ink for solid / hover / active states. Use this whenever you paint a
|
|
51
|
+
* `bg` from a scale — never pair `scale[500]` with `onFilled` or `colors.white` by hand.
|
|
52
|
+
*/
|
|
53
|
+
const resolveFilledSurface = (scale, colors) => {
|
|
54
|
+
const { white, black, backgroundColor } = colors;
|
|
55
|
+
const canvas = backgroundColor.main;
|
|
56
|
+
const rung = (0, exports.solidFillRung)(scale, white);
|
|
57
|
+
const fill = scale[rung];
|
|
58
|
+
const hoverRung = (0, exports.darkerFillRung)(scale, canvas, white, 0);
|
|
59
|
+
const hoverFill = scale[hoverRung];
|
|
60
|
+
const activeRung = (0, exports.darkerFillRung)(scale, canvas, white, 1);
|
|
61
|
+
const activeFill = scale[activeRung];
|
|
62
|
+
return {
|
|
63
|
+
rung,
|
|
64
|
+
fill,
|
|
65
|
+
color: (0, exports.labelOnFill)(fill, white, black),
|
|
66
|
+
hoverRung,
|
|
67
|
+
hoverFill,
|
|
68
|
+
hoverColor: (0, exports.labelOnFill)(hoverFill, white, black),
|
|
69
|
+
activeRung,
|
|
70
|
+
activeFill,
|
|
71
|
+
activeColor: (0, exports.labelOnFill)(activeFill, white, black),
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.resolveFilledSurface = resolveFilledSurface;
|