pixelize-design-library 2.4.2-beta.4 → 2.4.2-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENT-GOTCHAS.md +1102 -0
- package/README.md +26 -0
- package/dist/Components/Accordion/Accordion.d.ts +1 -0
- package/dist/Components/Accordion/Accordion.js +4 -1
- package/dist/Components/Accordion/AccordionProps.d.ts +2 -0
- package/dist/Components/AlertDialog/AlertDialog.d.ts +1 -0
- package/dist/Components/AlertDialog/AlertDialog.js +1 -0
- package/dist/Components/AlertDialog/AlertDialogProps.d.ts +2 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +1 -0
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChartProps.d.ts +4 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.js +1 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChartProps.d.ts +6 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +8 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +1 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +6 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +1 -0
- package/dist/Components/Apexcharts/ApexPolarCharts/ApexPolarChartsProps.d.ts +3 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +1 -0
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChartProps.d.ts +3 -0
- package/dist/Components/AppSwitcher/AppMark.d.ts +19 -0
- package/dist/Components/AppSwitcher/AppMark.js +62 -0
- package/dist/Components/AppSwitcher/AppSwitcher.d.ts +4 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +278 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +70 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +86 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.d.ts +3 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.js +31 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -0
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +3 -0
- package/dist/Components/Button/Button.d.ts +2 -2
- package/dist/Components/Button/Button.js +4 -3
- package/dist/Components/Button/Button.styles.js +37 -23
- package/dist/Components/Button/ButtonProps.d.ts +9 -1
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +7 -0
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +2 -4
- package/dist/Components/Buttons/ButtonsProps.d.ts +2 -0
- package/dist/Components/Card/Card.d.ts +1 -1
- package/dist/Components/Card/Card.js +2 -2
- package/dist/Components/Card/CardProps.d.ts +3 -1
- package/dist/Components/Card/PaymentCard/PaymentCard.js +21 -12
- package/dist/Components/Card/PaymentCard/PaymentCardProps.d.ts +6 -0
- package/dist/Components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Components/Checkbox/Checkbox.js +2 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +12 -7
- package/dist/Components/Checkbox/CheckboxProps.d.ts +4 -0
- package/dist/Components/Common/ErrorComponent.d.ts +2 -0
- package/dist/Components/Common/ErrorComponent.js +7 -5
- package/dist/Components/Common/ErrorMessage.js +2 -2
- package/dist/Components/Common/FormLabel.d.ts +4 -0
- package/dist/Components/Common/FormLabel.js +1 -0
- package/dist/Components/Common/FormattedDescription.d.ts +2 -0
- package/dist/Components/Common/FormattedDescription.js +1 -0
- package/dist/Components/Common/HelperText.d.ts +2 -0
- package/dist/Components/Common/HelperText.js +2 -0
- package/dist/Components/Common/Label.d.ts +1 -0
- package/dist/Components/Common/Label.js +1 -0
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/ContactForm/ContactForm.d.ts +1 -0
- package/dist/Components/ContactForm/ContactForm.js +1 -0
- package/dist/Components/ContactForm/ContactFormProps.d.ts +4 -0
- package/dist/Components/CopyButton/CopyButton.d.ts +3 -1
- package/dist/Components/CopyButton/CopyButton.js +9 -3
- package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +8 -0
- package/dist/Components/DatePicker/CalendarPanel.d.ts +6 -0
- package/dist/Components/DatePicker/CalendarPanel.js +37 -15
- package/dist/Components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/DatePicker.js +1 -0
- package/dist/Components/DatePicker/DatePickerProps.d.ts +30 -0
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +30 -5
- package/dist/Components/DatePicker/SingleDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/SingleDatePicker.js +49 -14
- package/dist/Components/DatePicker/ThemeDatePicker.d.ts +1 -0
- package/dist/Components/DatePicker/ThemeDatePicker.js +1 -0
- package/dist/Components/DatePicker/TimeOnlyPicker.d.ts +1 -0
- package/dist/Components/DatePicker/TimeOnlyPicker.js +11 -2
- package/dist/Components/DatePicker/TimePicker.d.ts +1 -0
- package/dist/Components/DatePicker/TimePicker.js +4 -3
- package/dist/Components/DatePicker/TimePickerInput.d.ts +1 -0
- package/dist/Components/DatePicker/TimePickerInput.js +2 -1
- package/dist/Components/DatePicker/dayStates.d.ts +56 -0
- package/dist/Components/DatePicker/dayStates.js +87 -0
- package/dist/Components/Divider/Divider.d.ts +1 -0
- package/dist/Components/Divider/Divider.js +1 -0
- package/dist/Components/Drawer/DrawerProps.d.ts +2 -0
- package/dist/Components/Dropdown/DropDown.d.ts +1 -0
- package/dist/Components/Dropdown/DropDown.js +22 -6
- package/dist/Components/Dropdown/DropdownProps.d.ts +3 -0
- package/dist/Components/Editor/Editor.d.ts +1 -0
- package/dist/Components/Editor/Editor.js +1 -0
- package/dist/Components/Editor/EditorProps.d.ts +2 -0
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -0
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -5
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +4 -0
- package/dist/Components/EmptyState/EmptyState.d.ts +1 -0
- package/dist/Components/EmptyState/EmptyState.js +4 -2
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +3 -0
- package/dist/Components/FeedbackForm/FeedbackForm.d.ts +3 -0
- package/dist/Components/FeedbackForm/FeedbackForm.js +1 -0
- package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +3 -2
- package/dist/Components/FieldSelectModal/FieldSelectModal.js +1 -0
- package/dist/Components/FilePreview/FilePreview.d.ts +1 -0
- package/dist/Components/FilePreview/FilePreview.js +3 -1
- package/dist/Components/FilePreview/FilePreviewProps.d.ts +5 -2
- package/dist/Components/FileUpload/FileUpload.d.ts +1 -0
- package/dist/Components/FileUpload/FileUpload.js +7 -5
- package/dist/Components/FileUpload/FileUploadProps.d.ts +7 -1
- package/dist/Components/FileUpload/constants.js +1 -0
- package/dist/Components/FileUploader/FileUploader.d.ts +1 -0
- package/dist/Components/FileUploader/FileUploader.js +1 -0
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +2 -0
- package/dist/Components/FilterSidebar/FilterSidebar.d.ts +3 -0
- package/dist/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +2 -10
- package/dist/Components/FilterSidebar/filterHoverStyle.js +3 -10
- package/dist/Components/Form/FormWrapper.d.ts +3 -0
- package/dist/Components/Form/FormWrapper.js +2 -1
- package/dist/Components/Header/HeaderProps.d.ts +5 -0
- package/dist/Components/Header/components/mobileMenu.js +12 -3
- package/dist/Components/Input/Input/InputProps.d.ts +2 -0
- package/dist/Components/Input/PhoneNumberInput.d.ts +1 -0
- package/dist/Components/Input/PhoneNumberInput.js +1 -0
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +3 -0
- package/dist/Components/Input/Switch/InputSwitch.d.ts +2 -0
- package/dist/Components/Input/Switch/InputSwitch.js +1 -0
- package/dist/Components/Input/TextInput.js +1 -0
- package/dist/Components/Input/TextInput.styles.js +8 -10
- package/dist/Components/Input/TextInputProps.d.ts +2 -0
- package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -0
- package/dist/Components/InputTextArea/InputTextArea.js +1 -0
- package/dist/Components/InputTextArea/InputTextArea.style.js +7 -6
- package/dist/Components/InputTextArea/InputTextAreaProps.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountCard.d.ts +3 -0
- package/dist/Components/KanbanBoard/AccountCard.js +1 -0
- package/dist/Components/KanbanBoard/AccountRow.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountRow.js +1 -0
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.d.ts +2 -0
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -0
- package/dist/Components/KanbanBoard/KanbanBoard.js +1 -0
- package/dist/Components/KanbanBoard/KanbanBoardProps.d.ts +39 -14
- package/dist/Components/KanbanBoard/MeasuredItem.d.ts +1 -0
- package/dist/Components/KanbanBoard/MeasuredItem.js +1 -0
- package/dist/Components/LazyWrapper/LazyWrapper.d.ts +3 -2
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -0
- package/dist/Components/LimitReachedModal/LimitReachedModalProps.d.ts +4 -1
- package/dist/Components/LimitReachedModal/limitReachedCopy.d.ts +2 -0
- package/dist/Components/LimitReachedModal/limitReachedCopy.js +2 -0
- package/dist/Components/Loading/Loading.d.ts +1 -0
- package/dist/Components/Loading/Loading.js +16 -14
- package/dist/Components/Loading/LoadingProps.d.ts +2 -0
- package/dist/Components/Modal/ModalProps.d.ts +2 -0
- package/dist/Components/MoreItems/MoreItems.d.ts +1 -0
- package/dist/Components/MoreItems/MoreItems.js +4 -1
- package/dist/Components/MoreItems/MoreItemsProps.d.ts +4 -2
- package/dist/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +2 -0
- package/dist/Components/NavigationBar/NavigationBar.js +9 -10
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +3 -0
- package/dist/Components/NoteTextArea/NoteTextArea.d.ts +1 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +10 -4
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +2 -0
- package/dist/Components/Notification/Notification.d.ts +1 -0
- package/dist/Components/Notification/Notification.js +1 -0
- package/dist/Components/Notification/NotificationProps.d.ts +6 -0
- package/dist/Components/NumberInput/NumberInput.d.ts +1 -0
- package/dist/Components/NumberInput/NumberInput.js +4 -1
- package/dist/Components/NumberInput/NumberInput.styles.js +7 -6
- package/dist/Components/NumberInput/NumberInputProps.d.ts +3 -0
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +6 -1
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +1 -0
- package/dist/Components/OrganizationDetails/OrganizationDetails.d.ts +1 -0
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -2
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +17 -4
- package/dist/Components/PdfViewer/PdfViewer.d.ts +2 -1
- package/dist/Components/PdfViewer/PdfViewer.js +7 -1
- package/dist/Components/PinInput/PinInput.d.ts +1 -0
- package/dist/Components/PinInput/PinInput.js +1 -0
- package/dist/Components/PinInput/PinInputProps.d.ts +2 -0
- package/dist/Components/PinInputs/PinInputs.d.ts +1 -0
- package/dist/Components/PinInputs/PinInputs.js +1 -0
- package/dist/Components/PinInputs/PinInputsProps.d.ts +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +2 -0
- package/dist/Components/PlanPill/PlanPillProps.d.ts +2 -0
- package/dist/Components/Primitives/Primitives.d.ts +6 -0
- package/dist/Components/Primitives/Primitives.js +113 -0
- package/dist/Components/ProductCard/ProductCardProps.d.ts +10 -0
- package/dist/Components/ProductCard/ProductReview.d.ts +1 -0
- package/dist/Components/ProductCard/ProductReview.js +6 -1
- package/dist/Components/ProductCard/ProductTags.js +1 -1
- package/dist/Components/ProductDetails/ProductDetailsProps.d.ts +7 -0
- package/dist/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfileCard/ProfileCardProps.d.ts +3 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +1 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +5 -3
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +9 -1
- package/dist/Components/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/Components/ProgressBar/ProgressBar.js +1 -0
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts +2 -0
- package/dist/Components/RadioButton/RadioButton.js +3 -2
- package/dist/Components/RadioButton/RadioButtonProps.d.ts +2 -0
- package/dist/Components/Reorder/Reorder.d.ts +2 -0
- package/dist/Components/Reorder/Reorder.js +1 -0
- package/dist/Components/Reorder/ReorderProps.d.ts +3 -0
- package/dist/Components/RolesPermission/RolesPermission.d.ts +1 -0
- package/dist/Components/RolesPermission/RolesPermission.js +5 -3
- package/dist/Components/RolesPermission/RolesPermissionProps.d.ts +16 -1
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts +3 -2
- package/dist/Components/ScrollToTop/ScrollToTop.js +4 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +7 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +1 -0
- package/dist/Components/Search/Search.d.ts +1 -0
- package/dist/Components/Search/Search.js +3 -2
- package/dist/Components/Search/SearchProps.d.ts +2 -0
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -0
- package/dist/Components/SearchSelect/SearchSelect.js +48 -37
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +23 -0
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/Components/SegmentedControl/SegmentedControl.js +89 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +23 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.js +2 -0
- package/dist/Components/Select/Select.d.ts +1 -1
- package/dist/Components/Select/Select.js +4 -2
- package/dist/Components/Select/Select.styles.js +3 -2
- package/dist/Components/Select/SelectProps.d.ts +6 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/Components/SelectSearch/SelectSearch.js +37 -15
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +5 -0
- package/dist/Components/SelectV2/SelectV2.d.ts +1 -0
- package/dist/Components/SelectV2/SelectV2.js +20 -5
- package/dist/Components/SelectV2/SelectV2Props.d.ts +6 -1
- package/dist/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/Components/SideBar/SideBar.js +5 -3
- package/dist/Components/SideBar/SideBarProps.d.ts +38 -24
- package/dist/Components/SideBar/components/MenuItemBox.js +15 -11
- package/dist/Components/SideBar/components/MenuPopoverContent.js +13 -10
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +3 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +2 -0
- package/dist/Components/Skeletons/Skeletons.d.ts +1 -0
- package/dist/Components/Skeletons/Skeletons.js +1 -0
- package/dist/Components/Slider/Slider.d.ts +3 -0
- package/dist/Components/Slider/Slider.js +9 -1
- package/dist/Components/StageProgress/StageItem.d.ts +1 -0
- package/dist/Components/StageProgress/StageItem.js +1 -0
- package/dist/Components/StageProgress/StageProgress.d.ts +1 -0
- package/dist/Components/StageProgress/StageProgress.js +1 -0
- package/dist/Components/StageProgress/StageProgressProps.d.ts +45 -4
- package/dist/Components/StageProgress/StageProgressProps.js +6 -4
- package/dist/Components/StageProgress/StepperStage.js +2 -2
- package/dist/Components/Switch/Switch.d.ts +1 -0
- package/dist/Components/Switch/Switch.js +1 -0
- package/dist/Components/Switch/SwitchProps.d.ts +1 -0
- package/dist/Components/Table/Table.d.ts +2 -1
- package/dist/Components/Table/Table.js +15 -5
- package/dist/Components/Table/TableProps.d.ts +47 -0
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableActions.js +2 -2
- package/dist/Components/Table/components/TableBody.js +44 -18
- package/dist/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +21 -8
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/CompactSelect.d.ts +1 -0
- package/dist/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +9 -1
- package/dist/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/Components/Table/settings/ManageColumns.js +8 -5
- package/dist/Components/Table/settings/TableSettings.js +6 -4
- package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
- package/dist/Components/Table/variants/TableVariantContext.js +17 -0
- package/dist/Components/Table/variants/classic.d.ts +6 -0
- package/dist/Components/Table/variants/classic.js +47 -0
- package/dist/Components/Table/variants/index.d.ts +7 -0
- package/dist/Components/Table/variants/index.js +27 -0
- package/dist/Components/Table/variants/pillInk.d.ts +6 -0
- package/dist/Components/Table/variants/pillInk.js +21 -0
- package/dist/Components/Table/variants/studio.d.ts +6 -0
- package/dist/Components/Table/variants/studio.js +50 -0
- package/dist/Components/Table/variants/tokens.d.ts +49 -0
- package/dist/Components/Table/variants/tokens.js +2 -0
- package/dist/Components/Tag/Tag.d.ts +1 -0
- package/dist/Components/Tag/Tag.js +1 -0
- package/dist/Components/Tag/Tag.styles.js +16 -11
- package/dist/Components/Tag/TagProps.d.ts +7 -0
- package/dist/Components/Timeline/Timeline.d.ts +1 -0
- package/dist/Components/Timeline/Timeline.js +1 -0
- package/dist/Components/Timeline/TimelineProps.d.ts +8 -0
- package/dist/Components/Toaster/Toaster.d.ts +1 -0
- package/dist/Components/Toaster/Toaster.js +1 -0
- package/dist/Components/Toaster/ToasterProps.d.ts +3 -0
- package/dist/Components/Toggle/TableToggle.d.ts +1 -0
- package/dist/Components/Toggle/TableToggle.js +73 -18
- package/dist/Components/Toggle/TableToggleProps.d.ts +6 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +3 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +19 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.d.ts +13 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.js +2 -0
- package/dist/Components/ToolTip/ToolTip.d.ts +1 -0
- package/dist/Components/ToolTip/ToolTip.js +7 -6
- package/dist/Components/ToolTip/ToolTipProps.d.ts +5 -1
- package/dist/Components/Trail/EditableCell.d.ts +2 -0
- package/dist/Components/Trail/EditableCell.js +2 -1
- package/dist/Components/Trail/SelectAllCheckbox.d.ts +1 -0
- package/dist/Components/Trail/SelectAllCheckbox.js +1 -0
- package/dist/Components/Trail/TrailWorks.d.ts +1 -0
- package/dist/Components/Trail/TrailWorks.js +2 -1
- package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +6 -2
- package/dist/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/Components/UserDetails/UserDetails.d.ts +1 -0
- package/dist/Components/UserDetails/UserDetails.js +6 -3
- package/dist/Components/UserDetails/UserDetailsProps.d.ts +30 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +6 -1
- package/dist/Hooks/exclusiveOverlay.d.ts +4 -0
- package/dist/Hooks/exclusiveOverlay.js +22 -0
- package/dist/Hooks/useExclusiveOverlay.d.ts +5 -0
- package/dist/Hooks/useExclusiveOverlay.js +24 -0
- package/dist/Theme/assertPalette.d.ts +1 -1
- package/dist/Theme/assertPalette.js +3 -2
- package/dist/Theme/chakra/Menu.styles.d.ts +2 -0
- package/dist/Theme/chakra/Menu.styles.js +9 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -0
- package/dist/Theme/chakra/Popover.styles.js +5 -1
- package/dist/Theme/chakra/componentStyles.d.ts +5 -0
- package/dist/Theme/chakra/componentStyles.js +16 -9
- package/dist/Theme/chakra/createBrandTheme.js +22 -9
- package/dist/Theme/chakra/focusRing.styles.d.ts +52 -0
- package/dist/Theme/chakra/focusRing.styles.js +46 -0
- package/dist/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/Theme/tokens/brands/index.js +6 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/Theme/tokens/builders/filledSurface.d.ts +29 -0
- package/dist/Theme/tokens/builders/filledSurface.js +74 -0
- package/dist/Theme/tokens/builders/focusRing.d.ts +52 -0
- package/dist/Theme/tokens/builders/focusRing.js +92 -0
- package/dist/Theme/tokens/builders/index.d.ts +2 -0
- package/dist/Theme/tokens/builders/index.js +2 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +41 -3
- package/dist/Theme/tokens/builders/outlineRung.js +82 -5
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
- package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
- package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/Theme/tokens/builders/rowStates.d.ts +13 -0
- package/dist/Theme/tokens/builders/rowStates.js +19 -0
- package/dist/Theme/tokens/builders/scrollShadow.d.ts +2 -0
- package/dist/Theme/tokens/builders/scrollShadow.js +16 -0
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -2
- package/dist/Theme/tokens/builders/surfaceRungs.js +19 -9
- package/dist/Theme/tokens/types.d.ts +21 -1
- package/dist/Utils/table.d.ts +3 -0
- package/dist/Utils/table.js +49 -3
- package/dist/esm/Components/Accordion/Accordion.js +4 -1
- package/dist/esm/Components/AlertDialog/AlertDialog.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +1 -0
- package/dist/esm/Components/AppSwitcher/AppMark.js +56 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +243 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +78 -0
- package/dist/esm/Components/AppSwitcher/useAppSwitcherShortcut.js +27 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/esm/Components/Button/Button.js +5 -4
- package/dist/esm/Components/Button/Button.styles.js +38 -24
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +2 -4
- package/dist/esm/Components/Card/Card.js +2 -2
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +21 -12
- package/dist/esm/Components/Checkbox/Checkbox.js +2 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +13 -8
- package/dist/esm/Components/Common/ErrorComponent.js +7 -5
- package/dist/esm/Components/Common/ErrorMessage.js +2 -2
- package/dist/esm/Components/Common/FormLabel.js +1 -0
- package/dist/esm/Components/Common/FormattedDescription.js +1 -0
- package/dist/esm/Components/Common/HelperText.js +2 -0
- package/dist/esm/Components/Common/Label.js +1 -0
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -0
- package/dist/esm/Components/CopyButton/CopyButton.js +10 -4
- package/dist/esm/Components/DatePicker/CalendarPanel.js +38 -16
- package/dist/esm/Components/DatePicker/DatePicker.js +1 -0
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +31 -6
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +50 -15
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +1 -0
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +11 -2
- package/dist/esm/Components/DatePicker/TimePicker.js +4 -3
- package/dist/esm/Components/DatePicker/TimePickerInput.js +2 -1
- package/dist/esm/Components/DatePicker/dayStates.js +79 -0
- package/dist/esm/Components/Divider/Divider.js +1 -0
- package/dist/esm/Components/Dropdown/DropDown.js +23 -7
- package/dist/esm/Components/Editor/Editor.js +1 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -5
- package/dist/esm/Components/EmptyState/EmptyState.js +4 -2
- package/dist/esm/Components/FeedbackForm/FeedbackForm.js +1 -0
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +1 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +3 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +8 -6
- package/dist/esm/Components/FileUpload/constants.js +1 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +3 -10
- package/dist/esm/Components/Form/FormWrapper.js +2 -1
- package/dist/esm/Components/Header/components/mobileMenu.js +12 -3
- package/dist/esm/Components/Input/PhoneNumberInput.js +1 -0
- package/dist/esm/Components/Input/Switch/InputSwitch.js +1 -0
- package/dist/esm/Components/Input/TextInput.js +1 -0
- package/dist/esm/Components/Input/TextInput.styles.js +8 -10
- package/dist/esm/Components/InputTextArea/InputTextArea.js +1 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +7 -6
- package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -0
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -0
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +1 -0
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +1 -0
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -0
- package/dist/esm/Components/LimitReachedModal/limitReachedCopy.js +2 -0
- package/dist/esm/Components/Loading/Loading.js +13 -11
- package/dist/esm/Components/MoreItems/MoreItems.js +4 -1
- package/dist/esm/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +9 -10
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +10 -4
- package/dist/esm/Components/Notification/Notification.js +1 -0
- package/dist/esm/Components/NumberInput/NumberInput.js +5 -2
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +7 -6
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +1 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -3
- package/dist/esm/Components/PdfViewer/PdfViewer.js +7 -1
- package/dist/esm/Components/PinInput/PinInput.js +1 -0
- package/dist/esm/Components/PinInputs/PinInputs.js +1 -0
- package/dist/esm/Components/Primitives/Primitives.js +6 -0
- package/dist/esm/Components/ProductCard/ProductReview.js +6 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +1 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +6 -4
- package/dist/esm/Components/ProgressBar/ProgressBar.js +1 -0
- package/dist/esm/Components/RadioButton/RadioButton.js +3 -2
- package/dist/esm/Components/Reorder/Reorder.js +1 -0
- package/dist/esm/Components/RolesPermission/RolesPermission.js +5 -3
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +4 -1
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +1 -0
- package/dist/esm/Components/Search/Search.js +3 -2
- package/dist/esm/Components/SearchSelect/SearchSelect.js +48 -37
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +86 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControlProps.js +1 -0
- package/dist/esm/Components/Select/Select.js +5 -3
- package/dist/esm/Components/Select/Select.styles.js +3 -2
- package/dist/esm/Components/SelectSearch/SelectSearch.js +37 -15
- package/dist/esm/Components/SelectV2/SelectV2.js +20 -5
- package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/esm/Components/SideBar/SideBar.js +5 -3
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +15 -11
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +13 -10
- package/dist/esm/Components/Skeletons/Skeletons.js +1 -0
- package/dist/esm/Components/Slider/Slider.js +9 -1
- package/dist/esm/Components/StageProgress/StageItem.js +1 -0
- package/dist/esm/Components/StageProgress/StageProgress.js +1 -0
- package/dist/esm/Components/StageProgress/StageProgressProps.js +7 -5
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
- package/dist/esm/Components/Switch/Switch.js +1 -0
- package/dist/esm/Components/Table/Table.js +15 -5
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableActions.js +2 -2
- package/dist/esm/Components/Table/components/TableBody.js +44 -18
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +21 -8
- package/dist/esm/Components/Table/components/TableSearch.js +1 -1
- package/dist/esm/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/esm/Components/Table/settings/ManageColumns.js +8 -5
- package/dist/esm/Components/Table/settings/TableSettings.js +7 -5
- package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
- package/dist/esm/Components/Table/variants/classic.js +43 -0
- package/dist/esm/Components/Table/variants/index.js +9 -0
- package/dist/esm/Components/Table/variants/pillInk.js +18 -0
- package/dist/esm/Components/Table/variants/studio.js +46 -0
- package/dist/esm/Components/Table/variants/tokens.js +1 -0
- package/dist/esm/Components/Tag/Tag.js +1 -0
- package/dist/esm/Components/Tag/Tag.styles.js +17 -12
- package/dist/esm/Components/Timeline/Timeline.js +1 -0
- package/dist/esm/Components/Toaster/Toaster.js +1 -0
- package/dist/esm/Components/Toggle/TableToggle.js +72 -17
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +16 -0
- package/dist/esm/Components/ToggleSwitch/ToggleSwitchProps.js +1 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +7 -6
- package/dist/esm/Components/Trail/EditableCell.js +2 -1
- package/dist/esm/Components/Trail/SelectAllCheckbox.js +1 -0
- package/dist/esm/Components/Trail/TrailWorks.js +2 -1
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/esm/Components/UserDetails/UserDetails.js +6 -3
- package/dist/esm/Hooks/exclusiveOverlay.js +16 -0
- package/dist/esm/Hooks/useExclusiveOverlay.js +20 -0
- package/dist/esm/Theme/assertPalette.js +3 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +9 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +5 -1
- package/dist/esm/Theme/chakra/componentStyles.js +16 -9
- package/dist/esm/Theme/chakra/createBrandTheme.js +22 -9
- package/dist/esm/Theme/chakra/focusRing.styles.js +40 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/esm/Theme/tokens/brands/index.js +6 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/filledSurface.js +67 -0
- package/dist/esm/Theme/tokens/builders/focusRing.js +85 -0
- package/dist/esm/Theme/tokens/builders/index.js +2 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +78 -4
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/esm/Theme/tokens/builders/rowStates.js +15 -0
- package/dist/esm/Theme/tokens/builders/scrollShadow.js +13 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -10
- package/dist/esm/Utils/table.js +50 -5
- package/dist/esm/index.js +26 -1
- package/dist/index.d.ts +26 -3
- package/dist/index.js +67 -4
- package/package.json +11 -4
|
@@ -1,39 +1,94 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
3
|
import { Box, IconButton } from "@chakra-ui/react";
|
|
3
4
|
import { Columns3, Table2 } from "lucide-react";
|
|
4
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { AA_NON_TEXT, liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
7
|
+
import { resolveFilledSurface } from "../../Theme/tokens/builders/filledSurface.js";
|
|
5
8
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
6
|
-
const
|
|
9
|
+
const MODES = ["grid", "list"];
|
|
10
|
+
/** Two icon-only IconButtons (Grid/List) with no aria-pressed — selection is shown by color only; shares variant with SegmentedControl (see MODULE.md). */
|
|
11
|
+
const TableToggle = ({ value, onChange, variant = "default" }) => {
|
|
7
12
|
const theme = useCustomTheme();
|
|
13
|
+
const { colors } = theme;
|
|
14
|
+
const isBrandSlide = variant === "brandSlide";
|
|
15
|
+
const isUnderlineSlide = variant === "underlineSlide";
|
|
16
|
+
const hasIndicator = isBrandSlide || isUnderlineSlide;
|
|
17
|
+
const brandFill = resolveFilledSurface(colors.primary, colors);
|
|
18
|
+
const restInk = liftToContrast(colors.background[800], colors.background[600], AA_NON_TEXT);
|
|
19
|
+
const hoverInk = liftToContrast(colors.background[900], colors.background[400], AA_NON_TEXT);
|
|
20
|
+
const trackRef = useRef(null);
|
|
21
|
+
const refs = useRef([]);
|
|
22
|
+
const [pill, setPill] = useState(null);
|
|
23
|
+
const selectedIndex = MODES.indexOf(value);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (!hasIndicator)
|
|
26
|
+
return;
|
|
27
|
+
const track = trackRef.current;
|
|
28
|
+
const node = refs.current[selectedIndex];
|
|
29
|
+
if (!track || !node) {
|
|
30
|
+
setPill(null);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const trackRect = track.getBoundingClientRect();
|
|
34
|
+
const nodeRect = node.getBoundingClientRect();
|
|
35
|
+
setPill({ left: nodeRect.left - trackRect.left, width: nodeRect.width });
|
|
36
|
+
}, [hasIndicator, selectedIndex]);
|
|
8
37
|
const styles = {
|
|
9
38
|
container: {
|
|
10
39
|
display: "flex",
|
|
11
40
|
alignItems: "center",
|
|
12
|
-
bg:
|
|
13
|
-
p: "0.125rem",
|
|
14
|
-
borderRadius: "md",
|
|
41
|
+
bg: isBrandSlide ? colors.primary.opacity[8] : isUnderlineSlide ? "transparent" : colors.background[600],
|
|
42
|
+
p: isUnderlineSlide ? "0" : "0.125rem",
|
|
43
|
+
borderRadius: isUnderlineSlide ? "none" : "md",
|
|
44
|
+
borderBottom: isUnderlineSlide ? `0.0625rem solid ${colors.boxborder[200]}` : undefined,
|
|
15
45
|
height: "2rem",
|
|
16
|
-
gap: "0.125rem",
|
|
46
|
+
gap: isUnderlineSlide ? "0" : "0.125rem",
|
|
17
47
|
width: "6.3rem",
|
|
48
|
+
position: "relative",
|
|
18
49
|
},
|
|
19
50
|
button: (mode) => ({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
51
|
+
position: "relative",
|
|
52
|
+
zIndex: 1,
|
|
53
|
+
bg: hasIndicator ? "transparent" : value === mode ? colors.backgroundColor.light : "transparent",
|
|
54
|
+
boxShadow: hasIndicator ? "none" : value === mode ? "md" : "none",
|
|
55
|
+
color: isBrandSlide
|
|
56
|
+
? value === mode
|
|
57
|
+
? brandFill.color
|
|
58
|
+
: restInk
|
|
59
|
+
: value === mode
|
|
60
|
+
? colors.accentText
|
|
61
|
+
: restInk,
|
|
62
|
+
borderRadius: isUnderlineSlide ? "none" : "base",
|
|
24
63
|
height: "1.75rem",
|
|
25
|
-
border: "0.031rem solid",
|
|
26
|
-
borderColor:
|
|
64
|
+
border: hasIndicator ? "none" : "0.031rem solid",
|
|
65
|
+
borderColor: hasIndicator
|
|
66
|
+
? "transparent"
|
|
67
|
+
: value === mode
|
|
68
|
+
? colors.primary.opacity[32]
|
|
69
|
+
: "transparent",
|
|
27
70
|
padding: "0.313rem 0.813rem",
|
|
28
71
|
_hover: {
|
|
29
|
-
bg:
|
|
30
|
-
?
|
|
31
|
-
:
|
|
32
|
-
|
|
72
|
+
bg: hasIndicator
|
|
73
|
+
? "transparent"
|
|
74
|
+
: value === mode
|
|
75
|
+
? colors.backgroundColor.light
|
|
76
|
+
: colors.background[400],
|
|
77
|
+
color: isBrandSlide
|
|
78
|
+
? value === mode
|
|
79
|
+
? brandFill.color
|
|
80
|
+
: hoverInk
|
|
81
|
+
: value === mode
|
|
82
|
+
? colors.accentText
|
|
83
|
+
: hoverInk,
|
|
33
84
|
},
|
|
34
|
-
transition: "
|
|
85
|
+
transition: "color 0.2s ease-in-out",
|
|
35
86
|
}),
|
|
36
87
|
};
|
|
37
|
-
return (_jsxs(Box, { ...styles.container, children: [_jsx(
|
|
88
|
+
return (_jsxs(Box, { ref: trackRef, ...styles.container, children: [isBrandSlide && pill && (_jsx(Box, { "aria-hidden": "true", position: "absolute", top: "0.125rem", left: 0, h: "1.75rem", w: `${pill.width}px`, borderRadius: "base", bg: brandFill.fill, boxShadow: `0 0.125rem 0.5rem ${colors.boxShadow.primary}`, transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), isUnderlineSlide && pill && (_jsx(Box, { "aria-hidden": "true", position: "absolute", bottom: "-0.0625rem", left: 0, h: "0.125rem", w: `${pill.width}px`, borderRadius: "full", bg: colors.primary[500], transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), _jsx(ToolTip, { label: "Table View", placement: "top", fontSize: 12, hasArrow: true, children: _jsx(IconButton, { ref: (node) => {
|
|
89
|
+
refs.current[0] = node;
|
|
90
|
+
}, "aria-label": "Grid View", icon: _jsx(Table2, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("grid"), ...styles.button("grid") }) }), _jsx(ToolTip, { label: "Kanban View", placement: "top", fontSize: 12, hasArrow: true, children: _jsx(IconButton, { ref: (node) => {
|
|
91
|
+
refs.current[1] = node;
|
|
92
|
+
}, "aria-label": "List View", icon: _jsx(Columns3, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("list"), ...styles.button("list") }) })] }));
|
|
38
93
|
};
|
|
39
94
|
export default TableToggle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@chakra-ui/react";
|
|
3
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
|
+
const SIZES = {
|
|
5
|
+
sm: { w: "2rem", h: "1.125rem", knob: "0.875rem", travel: "0.75rem" },
|
|
6
|
+
md: { w: "2.375rem", h: "1.375rem", knob: "1.125rem", travel: "0.875rem" },
|
|
7
|
+
};
|
|
8
|
+
/** Binary on/off control, role="switch"; always controlled with no internal state — distinct from the two-option Switch/SegmentedControl. */
|
|
9
|
+
export default function ToggleSwitch({ isChecked, onChange, isDisabled = false, size = "md", id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }) {
|
|
10
|
+
const { colors } = useCustomTheme();
|
|
11
|
+
const dims = SIZES[size];
|
|
12
|
+
return (_jsx(Box, { as: "button", type: "button", id: id, role: "switch", "aria-checked": isChecked, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, disabled: isDisabled, onClick: () => onChange(!isChecked), position: "relative", display: "inline-flex", alignItems: "center", flexShrink: 0, w: dims.w, h: dims.h, p: 0, borderRadius: "full", borderWidth: "1px", borderStyle: "solid", borderColor: isChecked ? colors.primary[500] : colors.boxborder[500], bg: isChecked ? colors.primary[500] : colors.background[600], opacity: isDisabled ? 0.5 : 1, cursor: isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, border-color 0.2s ease", _focusVisible: {
|
|
13
|
+
outline: "none",
|
|
14
|
+
boxShadow: `0 0 0 2px ${colors.primary[300]}`,
|
|
15
|
+
}, children: _jsx(Box, { "aria-hidden": "true", position: "absolute", left: "0.125rem", w: dims.knob, h: dims.knob, borderRadius: "full", bg: colors.white, boxShadow: "sm", transition: "transform 0.2s ease", transform: isChecked ? `translateX(${dims.travel})` : "translateX(0)" }) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,18 +4,19 @@ import { Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
|
4
4
|
import { useIsTruncated } from "../../Hooks/useIsTruncated.js";
|
|
5
5
|
import { mergeRefs } from "../../Utils/mergeRefs.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
-
|
|
7
|
+
import { onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
8
|
+
/** Renders a hover/focus-triggered Chakra Tooltip — not a substitute for Toaster's transient, unprompted notifications. */
|
|
9
|
+
export default function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize = "14px", bg, color, isDisabled, overflowOnly = false, isOpen, defaultIsOpen, openDelay = 0, closeDelay = 0, arrowSize = 10, closeOnClick = false, size, width, height, arrowPadding, arrowShadowColor, direction, gutter = 8, onClose, modifiers, closeOnPointerDown, styles, }) {
|
|
8
10
|
// Measure the child for `overflowOnly`. The hook is always called (Rules of
|
|
9
11
|
// Hooks) but is fully inert unless `overflowOnly` is set — no layout reads,
|
|
10
12
|
// no ResizeObserver, no re-renders for ordinary tooltips. Measurement never
|
|
11
13
|
// runs on hover/scroll, so showing the tooltip stays as cheap as before.
|
|
12
14
|
const { ref, isTruncated } = useIsTruncated(label, overflowOnly && isValidElement(children));
|
|
13
|
-
//
|
|
14
|
-
// label. `sidebar.background` is the only ramp `buildDarkPalette` deliberately leaves
|
|
15
|
-
// un-inverted, so it stays near-black in dark mode and the white label stays legible —
|
|
16
|
-
// every other surface ramp flips light and would render the label invisible.
|
|
15
|
+
// `sidebar.background` stays near-black in both modes; ink is computed via `onFilled`.
|
|
17
16
|
const theme = useCustomTheme();
|
|
18
17
|
const surface = theme.colors.sidebar.background[500];
|
|
18
|
+
const resolvedBg = bg !== null && bg !== void 0 ? bg : surface;
|
|
19
|
+
const resolvedColor = color !== null && color !== void 0 ? color : onFilled(resolvedBg, theme.colors.white, theme.colors.black);
|
|
19
20
|
let content = children;
|
|
20
21
|
let effectiveDisabled = isDisabled;
|
|
21
22
|
if (overflowOnly && isValidElement(children)) {
|
|
@@ -26,5 +27,5 @@ export default function ToolTip({ placement = "top", label, children, hasArrow =
|
|
|
26
27
|
});
|
|
27
28
|
effectiveDisabled = Boolean(isDisabled) || !isTruncated;
|
|
28
29
|
}
|
|
29
|
-
return (_jsx(ChakraTooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg:
|
|
30
|
+
return (_jsx(ChakraTooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg: resolvedBg, color: resolvedColor, isDisabled: effectiveDisabled, isOpen: isOpen, defaultIsOpen: defaultIsOpen, openDelay: openDelay, closeDelay: closeDelay, arrowSize: arrowSize, closeOnClick: closeOnClick, size: size, width: width, height: height, arrowPadding: arrowPadding, arrowShadowColor: arrowShadowColor, direction: direction, gutter: gutter, onClose: onClose, modifiers: modifiers, closeOnPointerDown: closeOnPointerDown, style: styles, px: 3, py: 2, borderRadius: "lg", fontWeight: "400", lineHeight: "1.5", maxW: "300px", children: content }));
|
|
30
31
|
}
|
|
@@ -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 = {
|