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
|
@@ -4,6 +4,7 @@ import { Box, Input, Button, Menu, MenuButton, MenuList, MenuItem, useOutsideCli
|
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
6
|
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
7
|
+
/** Inline editable cell driven entirely by parent-owned row state — no internal draft state of its own. */
|
|
7
8
|
export const EditableCell = ({ row, column, isEditable, handleCellClick, handleCellChange, }) => {
|
|
8
9
|
const { colors } = useCustomTheme();
|
|
9
10
|
const cellRef = useRef(null);
|
|
@@ -20,7 +21,7 @@ export const EditableCell = ({ row, column, isEditable, handleCellClick, handleC
|
|
|
20
21
|
return (_jsx(Box, { width: "50%", ref: cellRef, children: _jsx(Input, { type: "date", value: value, onChange: (e) => handleCellChange(row.id, column.label, e.target.value) }) }));
|
|
21
22
|
}
|
|
22
23
|
else if (column.label === "priority") {
|
|
23
|
-
return (_jsx(Box, { width: "100%", ref: cellRef, children: _jsxs(Menu, { isOpen: true, children: [_jsx(MenuButton, { as: Button, rightIcon: _jsx(ChevronDown, {}), bg: colors.teal[50], color: accentTextOnCanvas(colors.teal, colors.teal[50]), _hover: { bg: colors.teal[100] }, _active: { bg: colors.teal[200] }, children: value }), _jsxs(MenuList, { children: [_jsx(MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Low"),
|
|
24
|
+
return (_jsx(Box, { width: "100%", ref: cellRef, children: _jsxs(Menu, { isOpen: true, children: [_jsx(MenuButton, { as: Button, rightIcon: _jsx(ChevronDown, {}), bg: colors.teal[50], color: accentTextOnCanvas(colors.teal, colors.teal[50]), _hover: { bg: colors.teal[100] }, _active: { bg: colors.teal[200] }, children: value }), _jsxs(MenuList, { children: [_jsx(MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Low"), children: "Low" }), _jsx(MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Medium"), children: "Medium" }), _jsx(MenuItem, { onClick: () => handleCellChange(row.id, column.label, "High"), children: "High" })] })] }) }));
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
27
|
return (_jsx(Box, { width: "100%", ref: cellRef, children: _jsx(Input, { value: value, onChange: (e) => handleCellChange(row.id, column.label, e.target.value) }) }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox } from "@chakra-ui/react";
|
|
3
|
+
/** Purely presentational — isAllSelected/isIndeterminate must be computed and owned entirely by the parent. */
|
|
3
4
|
export const SelectAllCheckbox = ({ isAllSelected, isIndeterminate, handleSelectAll, }) => {
|
|
4
5
|
return (_jsx(Checkbox, { isChecked: isAllSelected, isIndeterminate: isIndeterminate, onChange: handleSelectAll }));
|
|
5
6
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Thead, Table, Tr, Th, Tbody, Td, Checkbox, } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
|
+
/** Hardcoded 2-row demo table with no props at all — not a reusable grid; use Table for a real editable/selectable list. */
|
|
4
5
|
const TrailWorks = () => {
|
|
5
6
|
const { colors } = useCustomTheme();
|
|
6
|
-
const cellBorder = colors.
|
|
7
|
+
const cellBorder = colors.boxborder[200];
|
|
7
8
|
const data = [
|
|
8
9
|
{
|
|
9
10
|
contact: "John Doe",
|
|
@@ -9,6 +9,6 @@ const DeactivateConfirmModal = ({ isOpen, onClose, userName, isLoading, onConfir
|
|
|
9
9
|
const { colors } = useCustomTheme();
|
|
10
10
|
const mode = isDarkCanvas(colors.backgroundColor.main) ? "dark" : "light";
|
|
11
11
|
const errorTone = resolveStatusTone(colors.semantic.error, mode);
|
|
12
|
-
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [_jsxs(ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], display: "flex", alignItems: "center", gap: 3, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: errorTone.bg, color: errorTone.fg, children: _jsx(AlertTriangle, { size: 18 }) }), _jsx(Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.confirmDeactivation })] }), _jsx(ModalCloseButton, {}), _jsx(ModalBody, { py: 6, children: _jsxs(VStack, { spacing: 4, align: "stretch", children: [_jsx(Text, { fontSize: "md", fontWeight: 500, color: colors.text[900], children: labels.deactivateConfirmQuestion }), _jsx(Box, { bg: colors.
|
|
12
|
+
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [_jsxs(ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], display: "flex", alignItems: "center", gap: 3, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: errorTone.bg, color: errorTone.fg, children: _jsx(AlertTriangle, { size: 18 }) }), _jsx(Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.confirmDeactivation })] }), _jsx(ModalCloseButton, {}), _jsx(ModalBody, { py: 6, children: _jsxs(VStack, { spacing: 4, align: "stretch", children: [_jsx(Text, { fontSize: "md", fontWeight: 500, color: colors.text[900], children: labels.deactivateConfirmQuestion }), _jsx(Box, { bg: colors.background[50], borderRadius: "lg", p: 4, border: "1px solid", borderColor: colors.boxborder[200], children: _jsxs(Text, { color: colors.textMuted, fontSize: "sm", children: [userName ? `${userName} ` : "", labels.deactivateConfirmDescription] }) }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, pt: 2, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", size: "sm", colorScheme: "gray" }), _jsx(Button, { label: labels.deactivateUser, onClick: onConfirm, colorScheme: "red", size: "sm", isLoading: isLoading, leftIcon: _jsx(Trash2, { size: 16 }) })] })] }) })] })] }));
|
|
13
13
|
};
|
|
14
14
|
export default DeactivateConfirmModal;
|
|
@@ -5,6 +5,7 @@ import { ChevronLeft, RefreshCw, Send, Shield, Trash2, UserPlus, Users, UserRoun
|
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
6
|
import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
7
7
|
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
8
|
+
import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
|
|
8
9
|
import EmptyState from "../EmptyState/EmptyState.js";
|
|
9
10
|
import AddUserModal from "./AddUserModal.js";
|
|
10
11
|
import ChangeRoleModal from "./ChangeRoleModal.js";
|
|
@@ -46,6 +47,7 @@ const DEFAULT_LABELS = {
|
|
|
46
47
|
deactivateConfirmQuestion: "Are you sure you want to deactivate this user?",
|
|
47
48
|
deactivateConfirmDescription: "will no longer have access to the organization. You can reactivate them later if needed.",
|
|
48
49
|
};
|
|
50
|
+
/** Two-pane user directory + detail panel with bundled Add/Change-Role/Deactivate modals. */
|
|
49
51
|
const UserDetails = ({ users, selectedUser, selectedUserId, roleOptions = [], canManageUsers = false, isUsersLoading = false, isInviteLoading = false, isDeactivateLoading = false, isAddUserLoading = false, isChangeRoleLoading = false, onSelectUser, onRefresh, onBack, onAddUserSubmit, onChangeRoleSubmit, onReinvite, onDeactivate, onAddRoleClick, addUserUpgradeNotice, labels: labelOverrides, minHeight = "90vh", }) => {
|
|
50
52
|
const { colors } = useCustomTheme();
|
|
51
53
|
const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
|
|
@@ -55,6 +57,7 @@ const UserDetails = ({ users, selectedUser, selectedUserId, roleOptions = [], ca
|
|
|
55
57
|
const [actionUserId, setActionUserId] = useState(null);
|
|
56
58
|
const border = colors.boxborder[200];
|
|
57
59
|
const surface = colors.background[50];
|
|
60
|
+
const rowBackgrounds = useMemo(() => listRowBackgrounds(colors), [colors]);
|
|
58
61
|
const muted = colors.textMuted;
|
|
59
62
|
const heading = colors.text[900];
|
|
60
63
|
const avatarBg = colors.primary[100];
|
|
@@ -71,10 +74,10 @@ const UserDetails = ({ users, selectedUser, selectedUserId, roleOptions = [], ca
|
|
|
71
74
|
const renderStatusBadge = (isActive) => (_jsx(Badge, { variant: "subtle", colorScheme: isActive ? successScheme : dangerScheme, borderRadius: "full", px: 2, py: 0.5, fontSize: "0.65rem", fontWeight: 600, textTransform: "none", children: isActive ? labels.active : labels.inactive }));
|
|
72
75
|
return (_jsxs(Flex, { backgroundColor: colors.backgroundColor.main, minHeight: minHeight, p: { base: 3, md: 4 }, gap: 3, flexDirection: { base: "column", lg: "row" }, children: [_jsxs(Box, { width: { base: "100%", lg: "300px" }, backgroundColor: surface, borderRadius: "xl", boxShadow: "sm", border: "1px solid", borderColor: border, position: "relative", order: { base: 2, lg: 1 }, overflow: "hidden", display: "flex", flexDirection: "column", children: [_jsxs(Flex, { px: 4, py: 3, borderBottom: "1px solid", borderColor: border, alignItems: "center", justifyContent: "space-between", children: [_jsxs(HStack, { spacing: 2, children: [onBack && (_jsx(IconButton, { "aria-label": "Go back", icon: _jsx(ChevronLeft, { size: 18 }), variant: "ghost", size: "xs", color: muted, onClick: onBack })), _jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.teamMembers }), _jsx(Badge, { colorScheme: "gray", borderRadius: "full", fontSize: "0.65rem", px: 2, children: users.length })] }), onRefresh && (_jsx(IconButton, { "aria-label": labels.refreshList, icon: _jsx(RefreshCw, { size: 15 }), variant: "ghost", size: "xs", color: muted, onClick: onRefresh, isLoading: isUsersLoading }))] }), _jsx(Box, { flex: 1, overflowY: "auto", maxHeight: { base: "380px", lg: `calc(${minHeight} - 80px)` }, children: isUsersLoading ? (_jsx(VStack, { spacing: 2, p: 3, children: Array.from({ length: 6 }).map((_, idx) => (_jsxs(Flex, { alignItems: "center", gap: 3, p: 2, w: "100%", children: [_jsx(SkeletonCircle, { size: "9" }), _jsxs(Box, { flex: 1, children: [_jsx(Skeleton, { height: "12px", mb: 2, width: "80%" }), _jsx(Skeleton, { height: "9px", width: "60%" })] })] }, idx))) })) : users.length === 0 ? (_jsx(EmptyState, { icon: Users, title: labels.noUsers, size: "sm", minH: "220px" })) : (_jsx(VStack, { spacing: 1, p: 2, align: "stretch", children: users.map((user) => {
|
|
73
76
|
const isSelected = selectedUserId != null && selectedUserId === user.id;
|
|
74
|
-
return (_jsxs(Flex, { p: 2.5, w: "100%", cursor: "pointer", alignItems: "center", gap: 2.5, backgroundColor: isSelected ?
|
|
77
|
+
return (_jsxs(Flex, { p: 2.5, w: "100%", cursor: "pointer", alignItems: "center", gap: 2.5, backgroundColor: isSelected ? rowBackgrounds.selected : "transparent", _hover: {
|
|
75
78
|
background: isSelected
|
|
76
|
-
?
|
|
77
|
-
:
|
|
79
|
+
? rowBackgrounds.selectedActive
|
|
80
|
+
: rowBackgrounds.active,
|
|
78
81
|
}, transition: "background 0.15s ease", borderRadius: "lg", position: "relative", onClick: () => onSelectUser === null || onSelectUser === void 0 ? void 0 : onSelectUser(user), children: [isSelected && (_jsx(Box, { position: "absolute", left: 0, top: "20%", bottom: "20%", width: "3px", borderRadius: "full", bg: colors.primary[500] })), _jsx(Avatar, { size: "sm", name: `${user.firstName} ${user.lastName}`, src: user.profile, bg: avatarBg, color: avatarColor }), _jsxs(Box, { flex: 1, overflow: "hidden", children: [_jsxs(Text, { fontSize: "sm", fontWeight: 600, noOfLines: 1, color: heading, children: [user.firstName, " ", user.lastName] }), _jsx(Text, { fontSize: "xs", color: muted, noOfLines: 1, children: user.email })] }), renderStatusBadge(user.isActive)] }, user.id));
|
|
79
82
|
}) })) })] }), _jsxs(Box, { flex: 1, backgroundColor: surface, borderRadius: "xl", boxShadow: "sm", border: "1px solid", borderColor: border, display: "flex", flexDirection: "column", order: { base: 1, lg: 2 }, overflow: "hidden", children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "center", px: 4, py: 3, borderBottom: "1px solid", borderColor: border, children: [_jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: selectedUser ? labels.userDetails : labels.selectTeamMember }), canManageUsers && (_jsx(Button, { size: "sm", colorScheme: "primary", fontSize: "xs", leftIcon: _jsx(UserPlus, { size: 15 }), onClick: onAddUserOpen, children: labels.addUser }))] }), _jsx(Box, { flex: 1, overflowY: "auto", children: isUsersLoading ? (_jsxs(VStack, { spacing: 4, p: 4, align: "stretch", children: [_jsxs(Flex, { align: "center", gap: 4, children: [_jsx(SkeletonCircle, { size: "16" }), _jsxs(Box, { flex: 1, children: [_jsx(Skeleton, { height: "18px", width: "50%", mb: 2 }), _jsx(Skeleton, { height: "12px", width: "35%" })] })] }), Array.from({ length: 4 }).map((_, idx) => (_jsxs(Box, { w: "100%", children: [_jsx(Skeleton, { height: "12px", width: "30%", mb: 2 }), _jsx(Skeleton, { height: "10px", width: "80%" })] }, idx)))] })) : selectedUser ? (_jsxs(_Fragment, { children: [_jsxs(Flex, { direction: { base: "column", md: "row" }, alignItems: { base: "flex-start", md: "center" }, justifyContent: "space-between", gap: 4, p: 4, borderBottom: "1px solid", borderColor: border, children: [_jsxs(Flex, { alignItems: "center", gap: 4, children: [_jsxs(Box, { position: "relative", children: [_jsx(Avatar, { size: "lg", name: selectedUser.name, src: selectedUser.profilePhoto, bg: avatarBg, color: avatarColor }), selectedUser.isCurrent && (_jsx(Badge, { position: "absolute", bottom: -1, right: -1, colorScheme: "blue", variant: "solid", fontSize: "0.6rem", borderRadius: "full", px: 2, py: 0.5, boxShadow: "sm", textTransform: "none", children: labels.you }))] }), _jsxs(Box, { children: [_jsx(Heading, { size: "md", mb: 1, color: heading, children: selectedUser.name }), _jsx(Text, { fontSize: "sm", color: muted, mb: 2, children: selectedUser.role }), _jsxs(HStack, { spacing: 2, children: [renderStatusBadge(selectedUser.isActive), selectedUser.isPending && (_jsx(Badge, { variant: "subtle", borderRadius: "full", px: 2, py: 0.5, fontSize: "0.65rem", fontWeight: 600, colorScheme: "orange", textTransform: "none", children: labels.pendingInvitation }))] })] })] }), canManageUsers &&
|
|
80
83
|
!selectedUser.isSuperAdmin && (_jsxs(HStack, { spacing: 2, flexWrap: "wrap", children: [!selectedUser.isCurrent && !selectedUser.isActive && (_jsx(Button, { size: "xs", variant: "outline", colorScheme: "blue", fontSize: "xs", leftIcon: _jsx(Send, { size: 13 }), isLoading: isInviteLoading, onClick: () => selectedUser.userId != null &&
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let active = null;
|
|
2
|
+
export const exclusiveOpen = (id, close) => {
|
|
3
|
+
if (active && active.id !== id) {
|
|
4
|
+
active.close();
|
|
5
|
+
}
|
|
6
|
+
active = { id, close };
|
|
7
|
+
};
|
|
8
|
+
export const exclusiveClose = (id) => {
|
|
9
|
+
if ((active === null || active === void 0 ? void 0 : active.id) === id) {
|
|
10
|
+
active = null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/** Test-only reset — not exported from the package root. */
|
|
14
|
+
export const resetExclusiveOverlay = () => {
|
|
15
|
+
active = null;
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useCallback, useEffect, useId, useRef } from "react";
|
|
2
|
+
import { exclusiveClose, exclusiveOpen } from "./exclusiveOverlay.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register this overlay with the global dismiss coordinator. Call `requestOpen()`
|
|
5
|
+
* immediately before opening; `onClose` is invoked when another overlay opens.
|
|
6
|
+
*/
|
|
7
|
+
export const useExclusiveOverlay = (isOpen, onClose) => {
|
|
8
|
+
const id = useId();
|
|
9
|
+
const onCloseRef = useRef(onClose);
|
|
10
|
+
onCloseRef.current = onClose;
|
|
11
|
+
const requestOpen = useCallback(() => {
|
|
12
|
+
exclusiveOpen(id, () => onCloseRef.current());
|
|
13
|
+
}, [id]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!isOpen) {
|
|
16
|
+
exclusiveClose(id);
|
|
17
|
+
}
|
|
18
|
+
}, [isOpen, id]);
|
|
19
|
+
return requestOpen;
|
|
20
|
+
};
|
|
@@ -2,8 +2,8 @@ const REQUIRED_GROUPS = [
|
|
|
2
2
|
"gradient", "primary", "secondary", "tertiary", "transparent", "black", "white",
|
|
3
3
|
"semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan",
|
|
4
4
|
"purple", "pink", "backgroundColor", "background", "text", "header", "placeholder",
|
|
5
|
-
"boxShadow", "sidebar", "boxborder", "border", "table", "disabled",
|
|
6
|
-
"textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
5
|
+
"boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled",
|
|
6
|
+
"accentText", "textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
7
7
|
];
|
|
8
8
|
export const allPaletteTokensListed = true;
|
|
9
9
|
const NESTED = [
|
|
@@ -14,6 +14,7 @@ const NESTED = [
|
|
|
14
14
|
]],
|
|
15
15
|
["semanticText", ["success", "error", "warning", "info"]],
|
|
16
16
|
["onSemantic", ["success", "error", "warning", "info"]],
|
|
17
|
+
["focusRing", ["ring", "halo"]],
|
|
17
18
|
["backgroundColor", ["main", "base"]],
|
|
18
19
|
["boxShadow", ["primary", "default"]],
|
|
19
20
|
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
|
|
2
2
|
import { menuAnatomy } from "@chakra-ui/anatomy";
|
|
3
|
+
import { listRowBackgrounds } from "../tokens/builders/rowStates.js";
|
|
3
4
|
import { paletteOf } from "./paletteFromTheme.js";
|
|
4
5
|
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(menuAnatomy.keys);
|
|
5
6
|
const $bg = cssVar("menu-bg");
|
|
@@ -21,16 +22,19 @@ const $bg = cssVar("menu-bg");
|
|
|
21
22
|
const $itemBg = cssVar("menu-item-bg");
|
|
22
23
|
const baseStyle = definePartsStyle(({ theme }) => {
|
|
23
24
|
const colors = paletteOf(theme);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
25
|
+
const rowBgs = listRowBackgrounds(colors);
|
|
26
|
+
const hoverBg = rowBgs.active;
|
|
27
|
+
const activeBg = rowBgs.selectedActive;
|
|
26
28
|
return {
|
|
27
29
|
list: {
|
|
28
30
|
[$bg.variable]: colors.backgroundColor.light,
|
|
29
31
|
bg: $bg.reference,
|
|
30
32
|
color: colors.text[900],
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
33
|
+
// A rule at CHROME_RULE weight, not Chakra's gray.200: that default read as a hard edge,
|
|
34
|
+
// which is why this shipped borderless. At 1.31:1 the edge defines the surface instead.
|
|
35
|
+
borderWidth: "1px",
|
|
36
|
+
borderStyle: "solid",
|
|
37
|
+
borderColor: colors.boxborder[200],
|
|
34
38
|
},
|
|
35
39
|
// Own CSS var (`--menu-item-bg`), NOT the list's `--menu-bg` — Chakra's stock item
|
|
36
40
|
// baseStyle rewrites `--menu-bg` itself on hover/focus, so reusing that same var name
|
|
@@ -18,8 +18,12 @@ const baseStyle = definePartsStyle(({ theme }) => {
|
|
|
18
18
|
content: {
|
|
19
19
|
[$popperBg.variable]: colors.backgroundColor.light,
|
|
20
20
|
bg: $popperBg.reference,
|
|
21
|
-
[$arrowShadowColor.variable]: colors.
|
|
21
|
+
[$arrowShadowColor.variable]: colors.boxborder[200],
|
|
22
22
|
color: colors.text[900],
|
|
23
|
+
// Matches Menu: a CHROME_RULE-weight edge, not Chakra's gray.200 hard edge.
|
|
24
|
+
borderWidth: "1px",
|
|
25
|
+
borderStyle: "solid",
|
|
26
|
+
borderColor: colors.boxborder[200],
|
|
23
27
|
},
|
|
24
28
|
};
|
|
25
29
|
});
|
|
@@ -9,6 +9,7 @@ import { Tag } from "../../Components/Tag/Tag.styles.js";
|
|
|
9
9
|
import { Textarea } from "../../Components/InputTextArea/InputTextArea.style.js";
|
|
10
10
|
import { NumberInput } from "../../Components/NumberInput/NumberInput.styles.js";
|
|
11
11
|
import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../tokens/builders/accentText.js";
|
|
12
|
+
import { labelOnFill, solidFillRung } from "../tokens/builders/filledSurface.js";
|
|
12
13
|
import { contrastRatio } from "../tokens/builders/color.js";
|
|
13
14
|
import { resolveHoverTint } from "../tokens/builders/outlineRung.js";
|
|
14
15
|
import { Drawer } from "./Drawer.styles.js";
|
|
@@ -24,6 +25,14 @@ import { Avatar } from "./Avatar.styles.js";
|
|
|
24
25
|
// math (hexToRgb) throws on those on purpose (see color.ts). Guard so those scales fall back to
|
|
25
26
|
// Chakra's own original fixed rung instead of computing contrast on a color it can't parse.
|
|
26
27
|
const isHexColor = (color) => typeof color === "string" && /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(color);
|
|
28
|
+
const solidFillStyle = (palette, swatch) => {
|
|
29
|
+
const rung = solidFillRung(swatch, palette.white);
|
|
30
|
+
const bg = swatch[rung];
|
|
31
|
+
return {
|
|
32
|
+
bg,
|
|
33
|
+
color: isHexColor(bg) ? labelOnFill(bg, palette.white, palette.black) : swatch[800],
|
|
34
|
+
};
|
|
35
|
+
};
|
|
27
36
|
// Badge isn't its own component family (no Components/Badge/), so its style config lives here —
|
|
28
37
|
// Chakra's stock `solid` variant hardcodes a white label on a variable fill, same AA gap Tag had.
|
|
29
38
|
const Badge = {
|
|
@@ -31,11 +40,7 @@ const Badge = {
|
|
|
31
40
|
solid: ({ theme, colorScheme = "gray" }) => {
|
|
32
41
|
const palette = paletteOf(theme);
|
|
33
42
|
const swatch = scaleFor(palette, colorScheme);
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
bg,
|
|
37
|
-
color: isHexColor(bg) ? onFilled(bg, palette.white, palette.black) : swatch[800],
|
|
38
|
-
};
|
|
43
|
+
return solidFillStyle(palette, swatch);
|
|
39
44
|
},
|
|
40
45
|
// Chakra's stock `subtle` picks its bg/color pair via `mode()`, keyed to Chakra's own
|
|
41
46
|
// colorMode — which this app never toggles (dark mode swaps the palette object instead), so
|
|
@@ -87,13 +92,14 @@ const Alert = defineAlertStyles({
|
|
|
87
92
|
variants: {
|
|
88
93
|
solid: defineAlertParts(({ theme, colorScheme = "gray" }) => {
|
|
89
94
|
const palette = paletteOf(theme);
|
|
90
|
-
const
|
|
95
|
+
const swatch = scaleFor(palette, colorScheme);
|
|
96
|
+
const { bg, color } = solidFillStyle(palette, swatch);
|
|
91
97
|
if (!isHexColor(bg))
|
|
92
98
|
return { container: {} };
|
|
93
99
|
return {
|
|
94
100
|
container: {
|
|
95
101
|
[$alertBg.variable]: bg,
|
|
96
|
-
[$alertFg.variable]:
|
|
102
|
+
[$alertFg.variable]: color,
|
|
97
103
|
},
|
|
98
104
|
};
|
|
99
105
|
}),
|
|
@@ -151,8 +157,9 @@ const Skeleton = {
|
|
|
151
157
|
const Radio = {
|
|
152
158
|
baseStyle: ({ theme, colorScheme }) => {
|
|
153
159
|
const palette = paletteOf(theme);
|
|
154
|
-
const
|
|
155
|
-
const
|
|
160
|
+
const swatch = scaleFor(palette, colorScheme);
|
|
161
|
+
const fill = swatch[solidFillRung(swatch, palette.white)];
|
|
162
|
+
const dot = labelOnFill(fill, palette.white, palette.black);
|
|
156
163
|
// A browser probe found the checked radio's hover repeating its own resting `fill` —
|
|
157
164
|
// Chakra's stock checked._hover (inherited from checkbox) lands on the SAME `bg`/`borderColor`
|
|
158
165
|
// keys we do, so extendTheme's merge is a scalar overwrite here, not a coexisting selector;
|
|
@@ -2,8 +2,9 @@ import { extendTheme } from "@chakra-ui/react";
|
|
|
2
2
|
import common from "./common.web.js";
|
|
3
3
|
import fonts from "./fonts.web.js";
|
|
4
4
|
import { componentStyles } from "./componentStyles.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveFilledSurface } from "../tokens/builders/filledSurface.js";
|
|
6
6
|
import { globalScrollbarStyles } from "../tokens/builders/scrollbar.js";
|
|
7
|
+
import { focusRingShadow } from "./focusRing.styles.js";
|
|
7
8
|
/**
|
|
8
9
|
* Builds a Chakra theme from a pure brand palette.
|
|
9
10
|
*
|
|
@@ -21,6 +22,12 @@ export const createBrandTheme = (palette, options = {}) => {
|
|
|
21
22
|
colors: palette,
|
|
22
23
|
...fonts,
|
|
23
24
|
...common,
|
|
25
|
+
// `shadows.outline` is what Chakra's stock `_focusVisible` reaches for on EVERY component it
|
|
26
|
+
// themes. The primitive ships one hardcoded blue (`rgba(66,153,225,.6)`), which measured
|
|
27
|
+
// 1.83:1 on the lavender canvas and 1.38:1 on a primary button — below 1.4.11's 3:1 on all
|
|
28
|
+
// nine brands, in both modes. A primitive cannot know the palette; this is the first place
|
|
29
|
+
// that does, so the palette-derived ring is bound here and every stock focus state inherits it.
|
|
30
|
+
shadows: { ...common.shadows, outline: focusRingShadow(palette) },
|
|
24
31
|
};
|
|
25
32
|
return extendTheme({
|
|
26
33
|
...brand,
|
|
@@ -75,14 +82,20 @@ export const createBrandTheme = (palette, options = {}) => {
|
|
|
75
82
|
// selecting text anywhere (e.g. a table cell) shows a stray white/lavender patch on
|
|
76
83
|
// the dark canvas. Brand it instead, with WCAG-safe ink via the same `onFilled` math
|
|
77
84
|
// used for buttons/badges.
|
|
78
|
-
"::selection": {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
"::selection": (() => {
|
|
86
|
+
const solid = resolveFilledSurface(palette.primary, palette);
|
|
87
|
+
return {
|
|
88
|
+
background: solid.fill,
|
|
89
|
+
color: solid.color,
|
|
90
|
+
};
|
|
91
|
+
})(),
|
|
92
|
+
"::-moz-selection": (() => {
|
|
93
|
+
const solid = resolveFilledSurface(palette.primary, palette);
|
|
94
|
+
return {
|
|
95
|
+
background: solid.fill,
|
|
96
|
+
color: solid.color,
|
|
97
|
+
};
|
|
98
|
+
})(),
|
|
86
99
|
// `color-scheme: dark` gives WebKit/Blink a dark scrollbar by default, but it's the
|
|
87
100
|
// OS's generic dark gray, not brand-aware.
|
|
88
101
|
...globalScrollbarStyles(palette),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WEB binding for the `focusRing` token pair. The colours are derived in
|
|
3
|
+
* `tokens/builders/focusRing.ts` (pure, shared with the mobile library); the CSS shape —
|
|
4
|
+
* box-shadow bands, the forced-colors outline — is web-only and lives here.
|
|
5
|
+
*/
|
|
6
|
+
/** Inner band, in the surface tone: separates the ring from the control's own fill. */
|
|
7
|
+
export const FOCUS_HALO_WIDTH = 2;
|
|
8
|
+
/** Outer edge of the brand band. The band itself is the 2px between halo and ring. */
|
|
9
|
+
export const FOCUS_RING_WIDTH = 4;
|
|
10
|
+
/**
|
|
11
|
+
* The two-tone ring as a single `box-shadow`. Drawn OUTSIDE the border box, so it costs no
|
|
12
|
+
* layout and never resizes the control — the reason this is a shadow and not an outline.
|
|
13
|
+
*/
|
|
14
|
+
export const focusRingShadow = (colors) => `0 0 0 ${FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
15
|
+
`0 0 0 ${FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
16
|
+
/**
|
|
17
|
+
* `:hover`, `:active` and `:focus-visible` all score the same specificity, so which one paints
|
|
18
|
+
* comes down to source order — and in the merged style object Chakra's own Button baseStyle
|
|
19
|
+
* registers `_focusVisible` BEFORE `_hover`. A focused button that is also hovered would then
|
|
20
|
+
* drop the ring for `_hover`'s `boxShadow: "sm"`. Stacking the pseudo-classes raises the
|
|
21
|
+
* specificity above both, so the ring survives whatever else the state repaints.
|
|
22
|
+
*/
|
|
23
|
+
export const FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
24
|
+
/**
|
|
25
|
+
* `:focus-visible`, never `:focus` — a mouse click must not draw a ring.
|
|
26
|
+
*
|
|
27
|
+
* The transparent outline is not decoration: in Windows High Contrast / `forced-colors` mode
|
|
28
|
+
* box-shadows are dropped entirely, and a transparent outline is the one thing the OS repaints
|
|
29
|
+
* in its own focus colour. Without it, forced-colors users get no indicator at all.
|
|
30
|
+
*/
|
|
31
|
+
export const focusVisibleRing = (colors) => ({
|
|
32
|
+
outline: "2px solid transparent",
|
|
33
|
+
outlineOffset: "2px",
|
|
34
|
+
boxShadow: focusRingShadow(colors),
|
|
35
|
+
});
|
|
36
|
+
/** Both selectors a control needs to keep the ring on top of its own hover/active styling. */
|
|
37
|
+
export const focusVisibleStyles = (colors) => {
|
|
38
|
+
const ring = focusVisibleRing(colors);
|
|
39
|
+
return { _focusVisible: ring, [FOCUS_VISIBLE_OVER_STATE]: ring };
|
|
40
|
+
};
|
|
@@ -23,7 +23,10 @@ const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
|
23
23
|
* regardless of which brand/mode is currently active.
|
|
24
24
|
*/
|
|
25
25
|
const brandSwatchColor = (brand) => brandThemes[brand].light.colors.primary[500];
|
|
26
|
-
const BrandSwatch = ({ brand }) =>
|
|
26
|
+
const BrandSwatch = ({ brand }) => {
|
|
27
|
+
const { colors } = useCustomTheme();
|
|
28
|
+
return (_jsx(Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: colors.boxborder[200], flexShrink: 0 }));
|
|
29
|
+
};
|
|
27
30
|
/**
|
|
28
31
|
* Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
|
|
29
32
|
* are read straight from the active theme — no `useColorModeValue` pairing needed here.
|
|
@@ -36,7 +39,7 @@ const useSwitcherColors = () => {
|
|
|
36
39
|
activeColor: colors.primary[500],
|
|
37
40
|
mutedColor: colors.text[600],
|
|
38
41
|
hoverBg: colors.gray[100],
|
|
39
|
-
borderColor: colors.
|
|
42
|
+
borderColor: colors.boxborder[200],
|
|
40
43
|
// NOTE: menuBg lives in Menu.styles.ts — re-pushing it via `sx` flickers on every render.
|
|
41
44
|
menuColor: colors.text[900],
|
|
42
45
|
};
|
|
@@ -22,6 +22,7 @@ import { withSidebarTokens } from "../builders/sidebarAccent.js";
|
|
|
22
22
|
import { buildMutedText } from "../builders/mutedText.js";
|
|
23
23
|
import { buildSemanticText, buildOnSemantic } from "../builders/semanticText.js";
|
|
24
24
|
import { withPlaceholderRung, withTableHoverRung } from "../builders/resolvedRungs.js";
|
|
25
|
+
import { buildFocusRing, withFocusRing } from "../builders/focusRing.js";
|
|
25
26
|
import { withSurfaceRungs } from "../builders/surfaceRungs.js";
|
|
26
27
|
/** Derived, never hand-written: a copied hex goes stale the moment a canvas moves. */
|
|
27
28
|
export const finalizeLightPalette = (source) => ({
|
|
@@ -32,10 +33,14 @@ export const finalizeLightPalette = (source) => ({
|
|
|
32
33
|
semanticText: buildSemanticText(source.semantic, source.backgroundColor.main),
|
|
33
34
|
onPrimary: onFilled(source.primary[500], source.white, source.black),
|
|
34
35
|
onSemantic: buildOnSemantic(source.semantic, source.white, source.black),
|
|
36
|
+
focusRing: buildFocusRing(source),
|
|
35
37
|
});
|
|
36
38
|
export { lavender, meadow, radiant, skyline, slate, emerald, rosewood, storefront, zinc };
|
|
37
39
|
export { lavenderDark, meadowDark, radiantDark, skylineDark, slateDark, emeraldDark, rosewoodDark, storefrontDark, zincDark, };
|
|
38
|
-
|
|
40
|
+
// `withFocusRing` is outermost: it is the only step that reads `primary` and the surfaces
|
|
41
|
+
// TOGETHER, so it must see both after every earlier step — and after a brand file's own
|
|
42
|
+
// post-derivation overrides (zinc dark replaces `primary` and `background` wholesale).
|
|
43
|
+
const resolveRungs = (palette) => withFocusRing(withSurfaceRungs(withTableHoverRung(withPlaceholderRung(withOutlineRung(palette)))));
|
|
39
44
|
const lightBrand = (source) => resolveRungs(finalizeLightPalette(source));
|
|
40
45
|
/** Light palette per brand. `lavender` is the base the other six extend. */
|
|
41
46
|
export const lightPalettes = {
|
|
@@ -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";
|