pixelize-design-library 2.4.1-beta.11 → 2.4.1-beta.13
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/dist/App.d.ts +4 -0
- package/dist/App.js +95 -0
- package/dist/Components/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/Components/AlertDialog/AlertDialog.js +1 -1
- package/dist/Components/Button/Button.d.ts +1 -1
- package/dist/Components/Button/Button.d.ts.map +1 -1
- package/dist/Components/Button/Button.js +2 -2
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/Button/ButtonProps.d.ts.map +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.d.ts.map +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -2
- package/dist/Components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/Checkbox/Checkbox.js +2 -2
- package/dist/Components/Checkbox/CheckboxProps.d.ts +1 -1
- package/dist/Components/Checkbox/CheckboxProps.d.ts.map +1 -1
- package/dist/Components/Common/ErrorMessage.d.ts +2 -1
- package/dist/Components/Common/ErrorMessage.d.ts.map +1 -1
- package/dist/Components/Common/ErrorMessage.js +4 -2
- package/dist/Components/Common/FormLabel.d.ts +1 -1
- package/dist/Components/Common/FormLabel.d.ts.map +1 -1
- package/dist/Components/Common/FormLabel.js +15 -2
- package/dist/Components/Common/Label.d.ts +3 -1
- package/dist/Components/Common/Label.d.ts.map +1 -1
- package/dist/Components/Common/Label.js +2 -2
- package/dist/Components/Dropdown/DropDown.d.ts.map +1 -1
- package/dist/Components/Dropdown/DropDown.js +132 -14
- package/dist/Components/Dropdown/DropdownProps.d.ts +2 -0
- package/dist/Components/Dropdown/DropdownProps.d.ts.map +1 -1
- package/dist/Components/Editor/EditorProps.d.ts +1 -1
- package/dist/Components/Editor/EditorProps.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -2
- package/dist/Components/KanbanBoard/MeasuredItem.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/MeasuredItem.js +4 -2
- package/dist/Components/NavigationBar/NavigationBar.d.ts.map +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +3 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.d.ts.map +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +40 -3
- package/dist/Components/ProductCard/ProductPrice.d.ts.map +1 -1
- package/dist/Components/ProductCard/ProductPrice.js +13 -7
- package/dist/Components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/Components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/Components/ProgressBar/ProgressBar.js +2 -2
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts +1 -1
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts.map +1 -1
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts.map +1 -1
- package/dist/Components/ScrollToTop/ScrollToTop.js +8 -3
- package/dist/Components/SearchSelect/SearchSelect.d.ts.map +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +213 -18
- package/dist/Components/SelectSearch/SelectSearch.d.ts.map +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +89 -4
- package/dist/Components/SelectV2/SelectV2.d.ts.map +1 -1
- package/dist/Components/SelectV2/SelectV2.js +116 -29
- package/dist/Components/SideBar/SecondaryBar.d.ts.map +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +15 -7
- package/dist/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/Components/SideBar/SideBar.js +36 -5
- package/dist/Components/SideBar/components/MenuItemBox.d.ts.map +1 -1
- package/dist/Components/SideBar/components/MenuItemBox.js +44 -15
- package/dist/Components/SideBar/components/MenuPopoverContent.d.ts.map +1 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +9 -3
- package/dist/Components/StageProgress/StageItem.d.ts.map +1 -1
- package/dist/Components/StageProgress/StageItem.js +1 -1
- package/dist/Components/StageProgress/StepperStage.d.ts.map +1 -1
- package/dist/Components/StageProgress/StepperStage.js +1 -1
- package/dist/Components/Table/Table.d.ts.map +1 -1
- package/dist/Components/Table/Table.js +1 -1
- package/dist/Components/Table/components/HeaderActions.d.ts.map +1 -1
- package/dist/Components/Table/components/HeaderActions.js +3 -1
- package/dist/Components/Table/components/TableActions.d.ts.map +1 -1
- package/dist/Components/Table/components/TableActions.js +3 -3
- package/dist/Components/Table/components/TableBody.d.ts.map +1 -1
- package/dist/Components/Table/components/TableBody.js +74 -48
- package/dist/Components/Table/components/TableGroupRow.d.ts +1 -0
- package/dist/Components/Table/components/TableGroupRow.d.ts.map +1 -1
- package/dist/Components/Table/components/TableGroupRow.js +2 -2
- package/dist/Components/Table/components/TableHeader.d.ts.map +1 -1
- package/dist/Components/Table/components/TableHeader.js +35 -42
- package/dist/Components/Table/components/TableSearch.d.ts.map +1 -1
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/CompactSelect.d.ts.map +1 -1
- package/dist/Components/Table/filters/CompactSelect.js +33 -1
- package/dist/Components/Table/filters/LeftFilterPane.d.ts.map +1 -1
- package/dist/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/Components/Table/hooks/useTable.d.ts.map +1 -1
- package/dist/Components/Table/hooks/useTable.js +6 -2
- package/dist/Components/Table/settings/ManageColumns.d.ts.map +1 -1
- package/dist/Components/Table/settings/ManageColumns.js +13 -4
- package/dist/Components/Table/settings/TableSettings.d.ts.map +1 -1
- package/dist/Components/Table/settings/TableSettings.js +2 -2
- package/dist/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/Components/Tag/Tag.js +5 -8
- package/dist/Components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Components/Timeline/Timeline.js +202 -202
- package/dist/Components/Toaster/Toaster.d.ts.map +1 -1
- package/dist/Components/Toaster/Toaster.js +19 -11
- package/dist/Hooks/usePreferences.d.ts.map +1 -1
- package/dist/Hooks/usePreferences.js +6 -1
- package/dist/Layout.d.ts +3 -0
- package/dist/Layout.js +286 -0
- package/dist/Pages/TInput.d.ts +3 -0
- package/dist/Pages/TInput.d.ts.map +1 -0
- package/dist/Pages/TInput.js +20 -0
- package/dist/Pages/accordion.d.ts +3 -0
- package/dist/Pages/accordion.d.ts.map +1 -0
- package/dist/Pages/accordion.js +21 -0
- package/dist/Pages/alertdialog.d.ts +3 -0
- package/dist/Pages/alertdialog.d.ts.map +1 -0
- package/dist/Pages/alertdialog.js +53 -0
- package/dist/Pages/button.d.ts +3 -0
- package/dist/Pages/button.d.ts.map +1 -0
- package/dist/Pages/button.js +32 -0
- package/dist/Pages/card.d.ts +3 -0
- package/dist/Pages/card.d.ts.map +1 -0
- package/dist/Pages/card.js +102 -0
- package/dist/Pages/chart.d.ts +4 -0
- package/dist/Pages/chart.d.ts.map +1 -0
- package/dist/Pages/chart.js +25 -0
- package/dist/Pages/checkbox.d.ts +3 -0
- package/dist/Pages/checkbox.d.ts.map +1 -0
- package/dist/Pages/checkbox.js +11 -0
- package/dist/Pages/contactForm.d.ts +3 -0
- package/dist/Pages/contactForm.d.ts.map +1 -0
- package/dist/Pages/contactForm.js +15 -0
- package/dist/Pages/customModulesTable.d.ts +4 -0
- package/dist/Pages/customModulesTable.d.ts.map +1 -0
- package/dist/Pages/customModulesTable.js +25 -0
- package/dist/Pages/datePick.d.ts +3 -0
- package/dist/Pages/datePick.d.ts.map +1 -0
- package/dist/Pages/datePick.js +49 -0
- package/dist/Pages/drawer.d.ts +3 -0
- package/dist/Pages/drawer.d.ts.map +1 -0
- package/dist/Pages/drawer.js +53 -0
- package/dist/Pages/dropdown.d.ts +3 -0
- package/dist/Pages/dropdown.d.ts.map +1 -0
- package/dist/Pages/dropdown.js +21 -0
- package/dist/Pages/editor.d.ts +3 -0
- package/dist/Pages/editor.d.ts.map +1 -0
- package/dist/Pages/editor.js +13 -0
- package/dist/Pages/feedback.d.ts +2 -0
- package/dist/Pages/feedback.d.ts.map +1 -0
- package/dist/Pages/feedback.js +12 -0
- package/dist/Pages/fileUpload.d.ts +2 -0
- package/dist/Pages/fileUpload.d.ts.map +1 -0
- package/dist/Pages/fileUpload.js +36 -0
- package/dist/Pages/input.d.ts +3 -0
- package/dist/Pages/input.d.ts.map +1 -0
- package/dist/Pages/input.js +48 -0
- package/dist/Pages/kanbanboard.d.ts +3 -0
- package/dist/Pages/kanbanboard.d.ts.map +1 -0
- package/dist/Pages/kanbanboard.js +182 -0
- package/dist/Pages/modal.d.ts +3 -0
- package/dist/Pages/modal.d.ts.map +1 -0
- package/dist/Pages/modal.js +61 -0
- package/dist/Pages/multiSelect.d.ts +3 -0
- package/dist/Pages/multiSelect.d.ts.map +1 -0
- package/dist/Pages/multiSelect.js +22 -0
- package/dist/Pages/noteArea.d.ts +3 -0
- package/dist/Pages/noteArea.d.ts.map +1 -0
- package/dist/Pages/noteArea.js +26 -0
- package/dist/Pages/notification.d.ts +3 -0
- package/dist/Pages/notification.d.ts.map +1 -0
- package/dist/Pages/notification.js +37 -0
- package/dist/Pages/numberInput.d.ts +3 -0
- package/dist/Pages/numberInput.d.ts.map +1 -0
- package/dist/Pages/numberInput.js +16 -0
- package/dist/Pages/orgSwitcher.d.ts +4 -0
- package/dist/Pages/orgSwitcher.d.ts.map +1 -0
- package/dist/Pages/orgSwitcher.js +36 -0
- package/dist/Pages/organizationDetails.d.ts +4 -0
- package/dist/Pages/organizationDetails.d.ts.map +1 -0
- package/dist/Pages/organizationDetails.js +80 -0
- package/dist/Pages/photoViewer.d.ts +3 -0
- package/dist/Pages/photoViewer.d.ts.map +1 -0
- package/dist/Pages/photoViewer.js +12 -0
- package/dist/Pages/pinInputs.d.ts +3 -0
- package/dist/Pages/pinInputs.d.ts.map +1 -0
- package/dist/Pages/pinInputs.js +11 -0
- package/dist/Pages/productCaard.d.ts +3 -0
- package/dist/Pages/productCaard.d.ts.map +1 -0
- package/dist/Pages/productCaard.js +311 -0
- package/dist/Pages/productDetailCard.d.ts +3 -0
- package/dist/Pages/productDetailCard.d.ts.map +1 -0
- package/dist/Pages/productDetailCard.js +78 -0
- package/dist/Pages/productFilter.d.ts +3 -0
- package/dist/Pages/productFilter.d.ts.map +1 -0
- package/dist/Pages/productFilter.js +148 -0
- package/dist/Pages/progressbar.d.ts +3 -0
- package/dist/Pages/progressbar.d.ts.map +1 -0
- package/dist/Pages/progressbar.js +11 -0
- package/dist/Pages/radioButton.d.ts +3 -0
- package/dist/Pages/radioButton.d.ts.map +1 -0
- package/dist/Pages/radioButton.js +18 -0
- package/dist/Pages/rolesPermission.d.ts +4 -0
- package/dist/Pages/rolesPermission.d.ts.map +1 -0
- package/dist/Pages/rolesPermission.js +144 -0
- package/dist/Pages/search.d.ts +3 -0
- package/dist/Pages/search.d.ts.map +1 -0
- package/dist/Pages/search.js +21 -0
- package/dist/Pages/searchSelect.d.ts +3 -0
- package/dist/Pages/searchSelect.d.ts.map +1 -0
- package/dist/Pages/searchSelect.js +97 -0
- package/dist/Pages/select.d.ts +3 -0
- package/dist/Pages/select.d.ts.map +1 -0
- package/dist/Pages/select.js +20 -0
- package/dist/Pages/selectSearch.d.ts +3 -0
- package/dist/Pages/selectSearch.d.ts.map +1 -0
- package/dist/Pages/selectSearch.js +58 -0
- package/dist/Pages/signInActivityTable.d.ts +4 -0
- package/dist/Pages/signInActivityTable.d.ts.map +1 -0
- package/dist/Pages/signInActivityTable.js +17 -0
- package/dist/Pages/skeleton.d.ts +3 -0
- package/dist/Pages/skeleton.d.ts.map +1 -0
- package/dist/Pages/skeleton.js +12 -0
- package/dist/Pages/stageProgress.d.ts +4 -0
- package/dist/Pages/stageProgress.d.ts.map +1 -0
- package/dist/Pages/stageProgress.js +31 -0
- package/dist/Pages/switch.d.ts +3 -0
- package/dist/Pages/switch.d.ts.map +1 -0
- package/dist/Pages/switch.js +17 -0
- package/dist/Pages/table.d.ts +3 -0
- package/dist/Pages/table.d.ts.map +1 -0
- package/dist/Pages/table.js +182 -0
- package/dist/Pages/tag.d.ts +3 -0
- package/dist/Pages/tag.d.ts.map +1 -0
- package/dist/Pages/tag.js +27 -0
- package/dist/Pages/textArea.d.ts +3 -0
- package/dist/Pages/textArea.d.ts.map +1 -0
- package/dist/Pages/textArea.js +14 -0
- package/dist/Pages/tier1.d.ts +4 -0
- package/dist/Pages/tier1.d.ts.map +1 -0
- package/dist/Pages/tier1.js +86 -0
- package/dist/Pages/timeline.d.ts +3 -0
- package/dist/Pages/timeline.d.ts.map +1 -0
- package/dist/Pages/timeline.js +73 -0
- package/dist/Pages/tooltip.d.ts +3 -0
- package/dist/Pages/tooltip.d.ts.map +1 -0
- package/dist/Pages/tooltip.js +11 -0
- package/dist/Pages/toster.d.ts +3 -0
- package/dist/Pages/toster.d.ts.map +1 -0
- package/dist/Pages/toster.js +53 -0
- package/dist/Pages/upgradeButton.d.ts +4 -0
- package/dist/Pages/upgradeButton.d.ts.map +1 -0
- package/dist/Pages/upgradeButton.js +17 -0
- package/dist/Pages/userDetails.d.ts +4 -0
- package/dist/Pages/userDetails.d.ts.map +1 -0
- package/dist/Pages/userDetails.js +79 -0
- package/dist/Pages/verifyEmail.d.ts +3 -0
- package/dist/Pages/verifyEmail.d.ts.map +1 -0
- package/dist/Pages/verifyEmail.js +17 -0
- package/dist/Theme/index.d.ts.map +1 -1
- package/dist/Theme/index.js +25 -9
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts.map +1 -1
- package/dist/Theme/provider/PixelizeThemeProvider.js +17 -7
- package/dist/Utils/rafThrottle.d.ts +15 -0
- package/dist/Utils/rafThrottle.d.ts.map +1 -0
- package/dist/Utils/rafThrottle.js +34 -0
- package/dist/Utils/table.d.ts.map +1 -1
- package/dist/Utils/table.js +16 -5
- package/dist/bootstrap.d.ts +2 -0
- package/dist/bootstrap.js +16 -0
- package/dist/esm/App.js +90 -0
- package/dist/esm/Assets/defaultLogo.js +5 -0
- package/dist/esm/Components/Accordion/Accordion.js +34 -0
- package/dist/esm/Components/Accordion/AccordionProps.js +1 -0
- package/dist/esm/Components/Accordion/accordionColors.js +30 -0
- package/dist/esm/Components/AlertDialog/AlertDialog.js +9 -0
- package/dist/esm/Components/AlertDialog/AlertDialogProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChart.js +71 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +149 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +161 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +79 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarChartsProps.js +1 -0
- package/dist/esm/Components/Breadcrumbs/Breadcrumbs.js +9 -0
- package/dist/esm/Components/Breadcrumbs/Breadcrumbs.stories.js +5 -0
- package/dist/esm/Components/Breadcrumbs/BreadcrumbsProps.js +1 -0
- package/dist/esm/Components/Button/Button.js +7 -0
- package/dist/esm/Components/Button/Button.stories.js +5 -0
- package/dist/esm/Components/Button/Button.styles.js +204 -0
- package/dist/esm/Components/Button/ButtonProps.js +1 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGoupIconProps.js +1 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +98 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.stories.js +5 -0
- package/dist/esm/Components/Buttons/Buttons.js +5 -0
- package/dist/esm/Components/Buttons/ButtonsProps.js +1 -0
- package/dist/esm/Components/Card/Card.js +5 -0
- package/dist/esm/Components/Card/CardProps.js +1 -0
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +65 -0
- package/dist/esm/Components/Card/PaymentCard/PaymentCardProps.js +1 -0
- package/dist/esm/Components/Checkbox/Checkbox.js +28 -0
- package/dist/esm/Components/Checkbox/Checkbox.stories.js +6 -0
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +69 -0
- package/dist/esm/Components/Checkbox/CheckboxProps.js +1 -0
- package/dist/esm/Components/Common/ErrorComponent.js +15 -0
- package/dist/esm/Components/Common/ErrorMessage.js +17 -0
- package/dist/esm/Components/Common/FormLabel.js +32 -0
- package/dist/esm/Components/Common/FormattedDescription.js +57 -0
- package/dist/esm/Components/Common/HelperText.js +8 -0
- package/dist/esm/Components/Common/Label.js +13 -0
- package/dist/esm/Components/Common/fieldStyles.js +34 -0
- package/dist/esm/Components/ContactForm/ContactForm.js +112 -0
- package/dist/esm/Components/ContactForm/ContactFormProps.js +1 -0
- package/dist/esm/Components/CopyButton/CopyButton.js +44 -0
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +63 -0
- package/dist/esm/Components/CustomModulesTable/CustomModulesTableProps.js +1 -0
- package/dist/esm/Components/CustomModulesTable/DeleteModuleModal.js +11 -0
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +20 -0
- package/dist/esm/Components/DatePicker/CalendarPanel.js +133 -0
- package/dist/esm/Components/DatePicker/DatePicker.js +252 -0
- package/dist/esm/Components/DatePicker/DatePickerProps.js +1 -0
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +206 -0
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +972 -0
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +27 -0
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +78 -0
- package/dist/esm/Components/DatePicker/TimePicker.js +70 -0
- package/dist/esm/Components/DatePicker/TimePickerInput.js +412 -0
- package/dist/esm/Components/Divider/Divider.js +9 -0
- package/dist/esm/Components/Drawer/Drawer.js +24 -0
- package/dist/esm/Components/Drawer/DrawerProps.js +1 -0
- package/dist/esm/Components/Dropdown/DropDown.js +249 -0
- package/dist/esm/Components/Dropdown/DropdownProps.js +1 -0
- package/dist/esm/Components/Editor/Editor.js +38 -0
- package/dist/esm/Components/Editor/EditorProps.js +1 -0
- package/dist/esm/Components/Editor/joditThemeVars.js +75 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +15 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.js +1 -0
- package/dist/esm/Components/EmptyState/EmptyState.js +40 -0
- package/dist/esm/Components/EmptyState/EmptyStateProps.js +1 -0
- package/dist/esm/Components/FeedbackForm/FeedbackForm.js +65 -0
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +33 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +79 -0
- package/dist/esm/Components/FilePreview/FilePreviewProps.js +1 -0
- package/dist/esm/Components/FileUpload/FileUpload.js +82 -0
- package/dist/esm/Components/FileUpload/FileUploadProps.js +1 -0
- package/dist/esm/Components/FileUpload/constants.js +24 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +78 -0
- package/dist/esm/Components/FileUploader/FileUploaderProps.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +258 -0
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +10 -0
- package/dist/esm/Components/Form/FormWrapper.js +9 -0
- package/dist/esm/Components/Header/Header.js +55 -0
- package/dist/esm/Components/Header/HeaderActions.js +24 -0
- package/dist/esm/Components/Header/HeaderProps.js +1 -0
- package/dist/esm/Components/Header/components/desktopMenu.js +43 -0
- package/dist/esm/Components/Header/components/mobileMenu.js +37 -0
- package/dist/esm/Components/Input/Input/Input.js +40 -0
- package/dist/esm/Components/Input/Input/InputProps.js +1 -0
- package/dist/esm/Components/Input/PhoneNumberInput.js +62 -0
- package/dist/esm/Components/Input/PhoneNumberInputProps.js +1 -0
- package/dist/esm/Components/Input/Switch/InputSwitch.js +21 -0
- package/dist/esm/Components/Input/TextInput.js +16 -0
- package/dist/esm/Components/Input/TextInput.stories.js +7 -0
- package/dist/esm/Components/Input/TextInput.styles.js +101 -0
- package/dist/esm/Components/Input/TextInputProps.js +1 -0
- package/dist/esm/Components/Input/textInputIconSize.js +36 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.js +8 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +77 -0
- package/dist/esm/Components/InputTextArea/InputTextAreaProps.js +1 -0
- package/dist/esm/Components/KanbanBoard/AccountCard.js +22 -0
- package/dist/esm/Components/KanbanBoard/AccountRow.js +10 -0
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +13 -0
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +453 -0
- package/dist/esm/Components/KanbanBoard/KanbanBoardProps.js +1 -0
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +54 -0
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +10 -0
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +40 -0
- package/dist/esm/Components/LimitReachedModal/LimitReachedModalProps.js +1 -0
- package/dist/esm/Components/LimitReachedModal/limitReachedCopy.js +50 -0
- package/dist/esm/Components/Loading/Loading.js +24 -0
- package/dist/esm/Components/Loading/Loading.stories.js +6 -0
- package/dist/esm/Components/Loading/LoadingProps.js +1 -0
- package/dist/esm/Components/Modal/Modal.js +30 -0
- package/dist/esm/Components/Modal/Modal.stories.js +6 -0
- package/dist/esm/Components/Modal/ModalProps.js +1 -0
- package/dist/esm/Components/MoreItems/MoreItems.js +22 -0
- package/dist/esm/Components/MoreItems/MoreItemsProps.js +1 -0
- package/dist/esm/Components/MultiSelect/MultiSelect.js +70 -0
- package/dist/esm/Components/MultiSelect/MultiSelectProps.js +1 -0
- package/dist/esm/Components/NavigationBar/NavBar.stories.js +2 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +57 -0
- package/dist/esm/Components/NavigationBar/NavigationBarProps.js +1 -0
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +142 -0
- package/dist/esm/Components/NoteTextArea/NoteTextAreaProps.js +1 -0
- package/dist/esm/Components/Notification/Notification.js +106 -0
- package/dist/esm/Components/Notification/NotificationProps.js +1 -0
- package/dist/esm/Components/NumberInput/NumberInput.js +6 -0
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +85 -0
- package/dist/esm/Components/NumberInput/NumberInputProps.js +1 -0
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +116 -0
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +34 -0
- package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +57 -0
- package/dist/esm/Components/OrganizationDetails/DeleteOrgModal.js +11 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +165 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetailsProps.js +1 -0
- package/dist/esm/Components/PdfViewer/PdfViewer.js +10 -0
- package/dist/esm/Components/PinInput/PinInput.js +15 -0
- package/dist/esm/Components/PinInput/PinInput.stories.js +5 -0
- package/dist/esm/Components/PinInput/PinInputProps.js +1 -0
- package/dist/esm/Components/PinInputs/PinInputs.js +48 -0
- package/dist/esm/Components/PinInputs/PinInputsProps.js +1 -0
- package/dist/esm/Components/PlanBadge/PlanBadge.js +17 -0
- package/dist/esm/Components/PlanBadge/PlanBadgeProps.js +1 -0
- package/dist/esm/Components/PlanPill/PlanPill.js +40 -0
- package/dist/esm/Components/PlanPill/PlanPillProps.js +1 -0
- package/dist/esm/Components/PlanPill/planPillGradient.js +17 -0
- package/dist/esm/Components/ProductCard/ProductCard.js +62 -0
- package/dist/esm/Components/ProductCard/ProductCardProps.js +1 -0
- package/dist/esm/Components/ProductCard/ProductLabel.js +18 -0
- package/dist/esm/Components/ProductCard/ProductPrice.js +110 -0
- package/dist/esm/Components/ProductCard/ProductReview.js +19 -0
- package/dist/esm/Components/ProductCard/ProductTags.js +48 -0
- package/dist/esm/Components/ProductDetails/ProductDetails.js +40 -0
- package/dist/esm/Components/ProductDetails/ProductDetailsProps.js +1 -0
- package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +22 -0
- package/dist/esm/Components/ProductDetails/ProductImageSlider.js +188 -0
- package/dist/esm/Components/ProfileCard/ProfileCard.js +34 -0
- package/dist/esm/Components/ProfileCard/ProfileCard.stories.js +5 -0
- package/dist/esm/Components/ProfileCard/ProfileCardProps.js +1 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +70 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.js +5 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.js +1 -0
- package/dist/esm/Components/ProgressBar/ProgressBar.js +6 -0
- package/dist/esm/Components/ProgressBar/ProgressBar.stories.js +6 -0
- package/dist/esm/Components/ProgressBar/ProgressBarProps.js +1 -0
- package/dist/esm/Components/RadioButton/RadioButton.js +25 -0
- package/dist/esm/Components/RadioButton/RadioButton.stories.js +6 -0
- package/dist/esm/Components/RadioButton/RadioButtonProps.js +1 -0
- package/dist/esm/Components/Reorder/Reorder.js +22 -0
- package/dist/esm/Components/Reorder/ReorderProps.js +1 -0
- package/dist/esm/Components/RolesPermission/DeleteRoleModal.js +13 -0
- package/dist/esm/Components/RolesPermission/RolesPermission.js +121 -0
- package/dist/esm/Components/RolesPermission/RolesPermissionProps.js +1 -0
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +67 -0
- package/dist/esm/Components/Search/Search.js +29 -0
- package/dist/esm/Components/Search/SearchProps.js +1 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +518 -0
- package/dist/esm/Components/SearchSelect/SearchSelectProps.js +1 -0
- package/dist/esm/Components/SearchSelect/SelectTruncatedLabel.js +17 -0
- package/dist/esm/Components/SearchSelect/searchSelectSize.js +93 -0
- package/dist/esm/Components/Select/Select.js +24 -0
- package/dist/esm/Components/Select/Select.stories.js +7 -0
- package/dist/esm/Components/Select/Select.styles.js +108 -0
- package/dist/esm/Components/Select/SelectProps.js +1 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +270 -0
- package/dist/esm/Components/SelectSearch/SelectSearchProps.js +1 -0
- package/dist/esm/Components/SelectV2/SelectV2.js +233 -0
- package/dist/esm/Components/SelectV2/SelectV2Props.js +1 -0
- package/dist/esm/Components/SideBar/SecondaryBar.js +67 -0
- package/dist/esm/Components/SideBar/SideBar.js +237 -0
- package/dist/esm/Components/SideBar/SideBarProps.js +1 -0
- package/dist/esm/Components/SideBar/Sidebar.stories.js +6 -0
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +132 -0
- package/dist/esm/Components/SideBar/components/MenuItems.js +114 -0
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +54 -0
- package/dist/esm/Components/SideBar/components/OtherApps.js +20 -0
- package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +29 -0
- package/dist/esm/Components/SideBar/components/TextTruncation.js +27 -0
- package/dist/esm/Components/SideBar/sidebarAccentColors.js +31 -0
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +34 -0
- package/dist/esm/Components/SignInActivityTable/SignInActivityTableProps.js +1 -0
- package/dist/esm/Components/Skeletons/Skeleton.stories.js +6 -0
- package/dist/esm/Components/Skeletons/SkeletonProps.js +1 -0
- package/dist/esm/Components/Skeletons/Skeletons.js +5 -0
- package/dist/esm/Components/Slider/Slider.js +41 -0
- package/dist/esm/Components/StageProgress/StageItem.js +85 -0
- package/dist/esm/Components/StageProgress/StageProgress.js +47 -0
- package/dist/esm/Components/StageProgress/StageProgressProps.js +29 -0
- package/dist/esm/Components/StageProgress/StepperStage.js +38 -0
- package/dist/esm/Components/Switch/Switch.js +11 -0
- package/dist/esm/Components/Switch/SwitchProps.js +1 -0
- package/dist/esm/Components/Table/Table.js +430 -0
- package/dist/esm/Components/Table/Table.stories.js +8 -0
- package/dist/esm/Components/Table/TableProps.js +1 -0
- package/dist/esm/Components/Table/components/HeaderActions.js +47 -0
- package/dist/esm/Components/Table/components/Pagination.js +19 -0
- package/dist/esm/Components/Table/components/TableActions.js +55 -0
- package/dist/esm/Components/Table/components/TableBody.js +337 -0
- package/dist/esm/Components/Table/components/TableGroupRow.js +11 -0
- package/dist/esm/Components/Table/components/TableHeader.js +100 -0
- package/dist/esm/Components/Table/components/TableLoading.js +11 -0
- package/dist/esm/Components/Table/components/TableSearch.js +31 -0
- package/dist/esm/Components/Table/components/tableRowHoverStyle.js +22 -0
- package/dist/esm/Components/Table/filterTypes.js +1 -0
- package/dist/esm/Components/Table/filters/ActiveFilters.js +63 -0
- package/dist/esm/Components/Table/filters/CompactSelect.js +55 -0
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +174 -0
- package/dist/esm/Components/Table/filters/SelectOperationControls.js +5 -0
- package/dist/esm/Components/Table/filters/TableFilters.js +45 -0
- package/dist/esm/Components/Table/filters/TextOperationControls.js +16 -0
- package/dist/esm/Components/Table/hooks/useDebounce.js +22 -0
- package/dist/esm/Components/Table/hooks/useTable.js +227 -0
- package/dist/esm/Components/Table/settings/ManageColumns.js +105 -0
- package/dist/esm/Components/Table/settings/TableSettings.js +82 -0
- package/dist/esm/Components/Tag/Tag.js +18 -0
- package/dist/esm/Components/Tag/Tag.styles.js +91 -0
- package/dist/esm/Components/Tag/TagProps.js +1 -0
- package/dist/esm/Components/Timeline/Timeline.js +250 -0
- package/dist/esm/Components/Timeline/TimelineProps.js +1 -0
- package/dist/esm/Components/Toaster/Toaster.js +120 -0
- package/dist/esm/Components/Toaster/Toaster.stories.js +7 -0
- package/dist/esm/Components/Toaster/ToasterProps.js +1 -0
- package/dist/esm/Components/Toggle/TableToggle.js +39 -0
- package/dist/esm/Components/Toggle/TableToggleProps.js +1 -0
- package/dist/esm/Components/ToolTip/OverflowToolTip.js +20 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +35 -0
- package/dist/esm/Components/ToolTip/ToolTip.stories.js +6 -0
- package/dist/esm/Components/ToolTip/ToolTipProps.js +1 -0
- package/dist/esm/Components/Trail/EditableCell.js +27 -0
- package/dist/esm/Components/Trail/SelectAllCheckbox.js +5 -0
- package/dist/esm/Components/Trail/TrailWorks.js +54 -0
- package/dist/esm/Components/Trail/data.js +26 -0
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +79 -0
- package/dist/esm/Components/UpgradeButton/UpgradeButtonProps.js +1 -0
- package/dist/esm/Components/UserDetails/AddUserModal.js +101 -0
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +56 -0
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +14 -0
- package/dist/esm/Components/UserDetails/UserDetails.js +109 -0
- package/dist/esm/Components/UserDetails/UserDetailsProps.js +1 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +83 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +61 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindowProps.js +1 -0
- package/dist/esm/Constants/Sidebar.js +39 -0
- package/dist/esm/Hooks/useIsTruncated.js +54 -0
- package/dist/esm/Hooks/usePreferences.js +74 -0
- package/dist/esm/Hooks/useSidebarPrefs.js +68 -0
- package/dist/esm/Layout.js +281 -0
- package/dist/esm/Pages/TInput.js +15 -0
- package/dist/esm/Pages/accordion.js +16 -0
- package/dist/esm/Pages/alertdialog.js +15 -0
- package/dist/esm/Pages/button.js +27 -0
- package/dist/esm/Pages/card.js +64 -0
- package/dist/esm/Pages/chart.js +20 -0
- package/dist/esm/Pages/checkbox.js +6 -0
- package/dist/esm/Pages/contactForm.js +10 -0
- package/dist/esm/Pages/customModulesTable.js +20 -0
- package/dist/esm/Pages/datePick.js +44 -0
- package/dist/esm/Pages/drawer.js +15 -0
- package/dist/esm/Pages/dropdown.js +16 -0
- package/dist/esm/Pages/editor.js +8 -0
- package/dist/esm/Pages/feedback.js +6 -0
- package/dist/esm/Pages/fileUpload.js +29 -0
- package/dist/esm/Pages/input.js +43 -0
- package/dist/esm/Pages/kanbanboard.js +177 -0
- package/dist/esm/Pages/modal.js +23 -0
- package/dist/esm/Pages/multiSelect.js +17 -0
- package/dist/esm/Pages/noteArea.js +21 -0
- package/dist/esm/Pages/notification.js +32 -0
- package/dist/esm/Pages/numberInput.js +11 -0
- package/dist/esm/Pages/orgSwitcher.js +31 -0
- package/dist/esm/Pages/organizationDetails.js +75 -0
- package/dist/esm/Pages/photoViewer.js +7 -0
- package/dist/esm/Pages/pinInputs.js +6 -0
- package/dist/esm/Pages/productCaard.js +306 -0
- package/dist/esm/Pages/productDetailCard.js +73 -0
- package/dist/esm/Pages/productFilter.js +143 -0
- package/dist/esm/Pages/progressbar.js +6 -0
- package/dist/esm/Pages/radioButton.js +16 -0
- package/dist/esm/Pages/rolesPermission.js +139 -0
- package/dist/esm/Pages/search.js +16 -0
- package/dist/esm/Pages/searchSelect.js +92 -0
- package/dist/esm/Pages/select.js +15 -0
- package/dist/esm/Pages/selectSearch.js +53 -0
- package/dist/esm/Pages/signInActivityTable.js +12 -0
- package/dist/esm/Pages/skeleton.js +7 -0
- package/dist/esm/Pages/stageProgress.js +26 -0
- package/dist/esm/Pages/switch.js +12 -0
- package/dist/esm/Pages/table.js +175 -0
- package/dist/esm/Pages/tag.js +22 -0
- package/dist/esm/Pages/textArea.js +9 -0
- package/dist/esm/Pages/tier1.js +48 -0
- package/dist/esm/Pages/timeline.js +68 -0
- package/dist/esm/Pages/tooltip.js +6 -0
- package/dist/esm/Pages/toster.js +48 -0
- package/dist/esm/Pages/upgradeButton.js +12 -0
- package/dist/esm/Pages/userDetails.js +74 -0
- package/dist/esm/Pages/verifyEmail.js +12 -0
- package/dist/esm/Theme/chakra/Avatar.styles.js +25 -0
- package/dist/esm/Theme/chakra/Drawer.styles.js +23 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +47 -0
- package/dist/esm/Theme/chakra/Modal.styles.js +23 -0
- package/dist/esm/Theme/chakra/Popover.styles.js +27 -0
- package/dist/esm/Theme/chakra/Slider.styles.js +22 -0
- package/dist/esm/Theme/chakra/Switch.styles.js +21 -0
- package/dist/esm/Theme/chakra/Tabs.styles.js +38 -0
- package/dist/esm/Theme/chakra/common.web.js +22 -0
- package/dist/esm/Theme/chakra/componentStyles.js +221 -0
- package/dist/esm/Theme/chakra/createBrandTheme.js +118 -0
- package/dist/esm/Theme/chakra/fonts.web.js +10 -0
- package/dist/esm/Theme/index.js +63 -0
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +204 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +107 -0
- package/dist/esm/Theme/provider/colorModeStorage.js +99 -0
- package/dist/esm/Theme/provider/index.js +3 -0
- package/dist/esm/Theme/provider/useThemeMode.js +9 -0
- package/dist/esm/Theme/themeProps.js +1 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +130 -0
- package/dist/esm/Theme/tokens/brands/index.js +73 -0
- package/dist/esm/Theme/tokens/brands/lavender/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +321 -0
- package/dist/esm/Theme/tokens/brands/meadow/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +128 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +130 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +134 -0
- package/dist/esm/Theme/tokens/brands/skyline/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +128 -0
- package/dist/esm/Theme/tokens/brands/slate/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +132 -0
- package/dist/esm/Theme/tokens/brands/storefront/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +122 -0
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +202 -0
- package/dist/esm/Theme/tokens/brands/zinc/palette.light.js +381 -0
- package/dist/esm/Theme/tokens/builders/accentText.js +83 -0
- package/dist/esm/Theme/tokens/builders/buildBrandTokens.js +28 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +289 -0
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +21 -0
- package/dist/esm/Theme/tokens/builders/color.js +141 -0
- package/dist/esm/Theme/tokens/builders/index.js +5 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +63 -0
- package/dist/esm/Theme/tokens/builders/statusTone.js +56 -0
- package/dist/esm/Theme/tokens/index.js +14 -0
- package/dist/esm/Theme/tokens/primitives/breakpoints.js +8 -0
- package/dist/esm/Theme/tokens/primitives/index.js +9 -0
- package/dist/esm/Theme/tokens/primitives/letterSpacings.js +9 -0
- package/dist/esm/Theme/tokens/primitives/lineHeights.js +18 -0
- package/dist/esm/Theme/tokens/primitives/radii.js +12 -0
- package/dist/esm/Theme/tokens/primitives/shadows.js +15 -0
- package/dist/esm/Theme/tokens/primitives/sizes.js +34 -0
- package/dist/esm/Theme/tokens/primitives/space.js +33 -0
- package/dist/esm/Theme/tokens/primitives/typography.js +40 -0
- package/dist/esm/Theme/tokens/primitives/zIndices.js +16 -0
- package/dist/esm/Theme/tokens/types.js +7 -0
- package/dist/esm/Theme/useCustomTheme.js +4 -0
- package/dist/esm/Utils/accountHandoff.js +139 -0
- package/dist/esm/Utils/functions.js +7 -0
- package/dist/esm/Utils/mergeRefs.js +16 -0
- package/dist/esm/Utils/planBadge.js +105 -0
- package/dist/esm/Utils/planExpiry.js +109 -0
- package/dist/esm/Utils/rafThrottle.js +30 -0
- package/dist/esm/Utils/table.js +321 -0
- package/dist/esm/bootstrap.js +11 -0
- package/dist/esm/index.js +133 -0
- package/dist/esm/services/feedback.js +15 -0
- package/dist/esm/withTheme.js +9 -0
- package/package.json +13 -6
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { cssVar } from "@chakra-ui/react";
|
|
2
|
+
import { Button } from "../../Components/Button/Button.styles";
|
|
3
|
+
import { Checkbox } from "../../Components/Checkbox/Checkbox.styles";
|
|
4
|
+
import { Input } from "../../Components/Input/TextInput.styles";
|
|
5
|
+
import { Select } from "../../Components/Select/Select.styles";
|
|
6
|
+
import { Tag } from "../../Components/Tag/Tag.styles";
|
|
7
|
+
import { Textarea } from "../../Components/InputTextArea/InputTextArea.style";
|
|
8
|
+
import { NumberInput } from "../../Components/NumberInput/NumberInput.styles";
|
|
9
|
+
import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../tokens/builders/accentText";
|
|
10
|
+
import { contrastRatio } from "../tokens/builders/color";
|
|
11
|
+
import { resolveHoverTint } from "../tokens/builders/outlineRung";
|
|
12
|
+
import { Drawer } from "./Drawer.styles";
|
|
13
|
+
import { Menu } from "./Menu.styles";
|
|
14
|
+
import { Modal } from "./Modal.styles";
|
|
15
|
+
import { Popover } from "./Popover.styles";
|
|
16
|
+
import { Slider } from "./Slider.styles";
|
|
17
|
+
import { Switch } from "./Switch.styles";
|
|
18
|
+
import { Tabs } from "./Tabs.styles";
|
|
19
|
+
import { Avatar } from "./Avatar.styles";
|
|
20
|
+
// `colorScheme` accepts any Chakra scale, including built-ins we never themed (blackAlpha,
|
|
21
|
+
// whiteAlpha) whose rungs are translucent `rgba(...)` strings, not opaque hex — our contrast
|
|
22
|
+
// math (hexToRgb) throws on those on purpose (see color.ts). Guard so those scales fall back to
|
|
23
|
+
// Chakra's own original fixed rung instead of computing contrast on a color it can't parse.
|
|
24
|
+
const isHexColor = (color) => typeof color === "string" && /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(color);
|
|
25
|
+
// Badge isn't its own component family (no Components/Badge/), so its style config lives here —
|
|
26
|
+
// Chakra's stock `solid` variant hardcodes a white label on a variable fill, same AA gap Tag had.
|
|
27
|
+
const Badge = {
|
|
28
|
+
variants: {
|
|
29
|
+
solid: ({ theme, colorScheme = "gray" }) => {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31
|
+
const swatch = (_d = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a[colorScheme]) !== null && _b !== void 0 ? _b : (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray) !== null && _d !== void 0 ? _d : {};
|
|
32
|
+
const bg = swatch === null || swatch === void 0 ? void 0 : swatch[500];
|
|
33
|
+
const white = (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.white) !== null && _f !== void 0 ? _f : "#fff";
|
|
34
|
+
const black = (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.black) !== null && _h !== void 0 ? _h : "#000";
|
|
35
|
+
return {
|
|
36
|
+
bg,
|
|
37
|
+
color: isHexColor(bg) ? onFilled(bg, white, black) : swatch === null || swatch === void 0 ? void 0 : swatch[800],
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
// Chakra's stock `subtle` picks its bg/color pair via `mode()`, keyed to Chakra's own
|
|
41
|
+
// colorMode — which this app never toggles (dark mode swaps the palette object instead), so
|
|
42
|
+
// it always takes the light-mode branch. Applied to our mode-reversed dark scales, that
|
|
43
|
+
// branch's fixed rung pair (100/800) measures 4.06 in dark mode, just under AA.
|
|
44
|
+
subtle: ({ theme, colorScheme = "gray" }) => {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46
|
+
const swatch = (_d = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a[colorScheme]) !== null && _b !== void 0 ? _b : (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray) !== null && _d !== void 0 ? _d : {};
|
|
47
|
+
const bg = (_e = swatch === null || swatch === void 0 ? void 0 : swatch[100]) !== null && _e !== void 0 ? _e : swatch === null || swatch === void 0 ? void 0 : swatch[50];
|
|
48
|
+
if (!isHexColor(bg))
|
|
49
|
+
return { bg, color: swatch === null || swatch === void 0 ? void 0 : swatch[800] };
|
|
50
|
+
// accentTextOnCanvas keeps brand hue by trying this scale's own rungs first, but some
|
|
51
|
+
// narrow-gamut hues (e.g. yellow) don't reach far enough at either end to clear AA against
|
|
52
|
+
// every bg they can land on in dark mode (measured 4.42 for a reversed-yellow badge) — its
|
|
53
|
+
// own doc admits it falls back to "the most extreme rung" rather than guaranteeing AA. Verify
|
|
54
|
+
// the candidate actually clears AA; if not, drop brand hue for the guaranteed white/black ink
|
|
55
|
+
// (onFilled is provably >=4.5 against any bg) rather than ship a near-miss.
|
|
56
|
+
const accent = accentTextOnCanvas(swatch, bg);
|
|
57
|
+
if (contrastRatio(accent, bg) >= 4.5)
|
|
58
|
+
return { bg, color: accent };
|
|
59
|
+
const white = (_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.white) !== null && _g !== void 0 ? _g : "#fff";
|
|
60
|
+
const black = (_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.black) !== null && _j !== void 0 ? _j : "#000";
|
|
61
|
+
return { bg, color: onFilled(bg, white, black) };
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
defaultProps: {
|
|
65
|
+
variant: "subtle",
|
|
66
|
+
colorScheme: "gray",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
// Chakra's stock FormErrorMessage hardcodes `colors.red.500` (our own `red[500]`, since
|
|
70
|
+
// `createBrandTheme` sets `theme.colors = palette`) — same AA gap as our own ErrorMessage/
|
|
71
|
+
// ErrorComponent, fixed the same way rather than leaving Chakra's raw usage (e.g. FeedbackForm)
|
|
72
|
+
// unfixed.
|
|
73
|
+
const FormError = {
|
|
74
|
+
baseStyle: ({ theme }) => {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
|
+
// `icon` (FormErrorIcon) shares the same AA gap as `text` — both must be fixed together or
|
|
77
|
+
// the icon stays on Chakra's raw `red.500`.
|
|
78
|
+
const color = accentTextOnCanvas((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.red, (_d = (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.backgroundColor) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : "#ffffff");
|
|
79
|
+
return {
|
|
80
|
+
text: { color },
|
|
81
|
+
icon: { color },
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const $tooltipBg = cssVar("tooltip-bg");
|
|
86
|
+
const $tooltipFg = cssVar("tooltip-fg");
|
|
87
|
+
/**
|
|
88
|
+
* Chakra's own Tooltip baseStyle hardcodes `--tooltip-bg`/`--tooltip-fg` to `colors.gray.700`/
|
|
89
|
+
* `colors.whiteAlpha.900` (gated behind `_dark`, which this theme-swap app never triggers — see
|
|
90
|
+
* Menu.styles.ts / createBrandTheme's colorMode comment). Our reversed dark gray ramp makes
|
|
91
|
+
* `gray.700` LIGHT (~L79), so every bare `<Tooltip>` renders a near-white bubble with near-white
|
|
92
|
+
* text on the dark canvas — invisible. A tooltip floats over arbitrary content in either mode, so
|
|
93
|
+
* unlike Menu/Modal/Drawer (which follow the canvas) it needs a FIXED high-contrast chip that
|
|
94
|
+
* doesn't invert with the palette — `black`/`white` are exactly the two tokens `buildDarkPalette`
|
|
95
|
+
* deliberately never remaps, so they stay a stable dark-bg/white-text pair in both modes.
|
|
96
|
+
*/
|
|
97
|
+
const Tooltip = {
|
|
98
|
+
baseStyle: ({ theme }) => {
|
|
99
|
+
var _a, _b, _c, _d;
|
|
100
|
+
return ({
|
|
101
|
+
[$tooltipBg.variable]: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.black) !== null && _b !== void 0 ? _b : "colors.gray.700",
|
|
102
|
+
[$tooltipFg.variable]: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.white) !== null && _d !== void 0 ? _d : "colors.whiteAlpha.900",
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
const $skeletonStart = cssVar("skeleton-start-color");
|
|
107
|
+
const $skeletonEnd = cssVar("skeleton-end-color");
|
|
108
|
+
/**
|
|
109
|
+
* Chakra's own Skeleton baseStyle hardcodes `--skeleton-start-color`/`--skeleton-end-color` to
|
|
110
|
+
* `colors.gray.100`/`colors.gray.400` the same `_dark`-gated way Menu/Popover did (Wave G/H), so
|
|
111
|
+
* every bare `<Skeleton>` shimmers between two near-white tones on the dark canvas. Fixed at the
|
|
112
|
+
* theme level rather than in `Skeletons.tsx`: Chakra's `Skeleton` only writes these vars from its
|
|
113
|
+
* `startColor`/`endColor` PROPS when a caller actually passes them (`useToken` on an empty string
|
|
114
|
+
* resolves to `undefined`, so the prop-driven `cssVarStyles` object stays empty) — an explicit
|
|
115
|
+
* prop still wins via that mechanism, this only supplies the default the base style already owns.
|
|
116
|
+
*/
|
|
117
|
+
const Skeleton = {
|
|
118
|
+
baseStyle: ({ theme }) => {
|
|
119
|
+
var _a, _b, _c, _d, _e, _f;
|
|
120
|
+
return ({
|
|
121
|
+
[$skeletonStart.variable]: (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray) === null || _b === void 0 ? void 0 : _b[100]) !== null && _c !== void 0 ? _c : "colors.gray.100",
|
|
122
|
+
[$skeletonEnd.variable]: (_f = (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[300]) !== null && _f !== void 0 ? _f : "colors.gray.400",
|
|
123
|
+
background: $skeletonStart.reference,
|
|
124
|
+
borderColor: $skeletonEnd.reference,
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
// Chakra's `extendTheme` does not REPLACE a component's stock baseStyle when ours is also a
|
|
129
|
+
// function — it calls BOTH and deep-merges the two returned plain objects, key by key. Chakra's
|
|
130
|
+
// own stock Radio (@chakra-ui/theme radio.mjs) writes its checked dot with the shorthand style
|
|
131
|
+
// props `bg`/`w`/`h`/`pos`; an earlier version of this override used the full CSS property names
|
|
132
|
+
// (`background`/`width`/`height`/`position`). A deep merge treats those as DIFFERENT keys, so
|
|
133
|
+
// both survived into the final style object instead of one cleanly overwriting the other — and
|
|
134
|
+
// in practice Chakra's own `bg: "currentColor"` rung won, leaving a hardcoded-black dot. Using
|
|
135
|
+
// the exact same keys Chakra's stock style uses makes every one of ours a scalar overwrite, and
|
|
136
|
+
// `!important` on the two colour-bearing declarations removes any remaining doubt about which
|
|
137
|
+
// value survives serialization — verified against the actual rendered cascade, not just this
|
|
138
|
+
// function's return value (see componentStyles.radioDotMerge.test.ts, which asserts the merge
|
|
139
|
+
// behavior directly rather than only the function output).
|
|
140
|
+
const Radio = {
|
|
141
|
+
baseStyle: ({ theme, colorScheme }) => {
|
|
142
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
143
|
+
const swatch = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a[colorScheme];
|
|
144
|
+
const fill = (_b = swatch === null || swatch === void 0 ? void 0 : swatch[500]) !== null && _b !== void 0 ? _b : (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[500];
|
|
145
|
+
const white = (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.white) !== null && _f !== void 0 ? _f : "#ffffff";
|
|
146
|
+
const black = (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.black) !== null && _h !== void 0 ? _h : "#000000";
|
|
147
|
+
const dot = onFilled(fill, white, black);
|
|
148
|
+
// A browser probe found the checked radio's hover repeating its own resting `fill` —
|
|
149
|
+
// Chakra's stock checked._hover (inherited from checkbox) lands on the SAME `bg`/`borderColor`
|
|
150
|
+
// keys we do, so extendTheme's merge is a scalar overwrite here, not a coexisting selector;
|
|
151
|
+
// ours must supply a value that actually differs from resting, same fix shape as
|
|
152
|
+
// NavigationBar/OrgSwitcher's "hand a fill its own resting bg as the backdrop" pattern.
|
|
153
|
+
const hoverFill = resolveHoverTint(fill, fill);
|
|
154
|
+
return {
|
|
155
|
+
control: {
|
|
156
|
+
borderColor: (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.boxborder) === null || _k === void 0 ? void 0 : _k[500],
|
|
157
|
+
_checked: {
|
|
158
|
+
bg: `${fill} !important`,
|
|
159
|
+
borderColor: `${fill} !important`,
|
|
160
|
+
color: `${dot} !important`,
|
|
161
|
+
_before: {
|
|
162
|
+
content: `""`,
|
|
163
|
+
display: "inline-block",
|
|
164
|
+
pos: "relative",
|
|
165
|
+
w: "50%",
|
|
166
|
+
h: "50%",
|
|
167
|
+
borderRadius: "50%",
|
|
168
|
+
bg: `${dot} !important`,
|
|
169
|
+
},
|
|
170
|
+
_hover: { bg: `${hoverFill} !important`, borderColor: `${hoverFill} !important` },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
defaultProps: { colorScheme: "primary" },
|
|
176
|
+
};
|
|
177
|
+
const $closeButtonBg = cssVar("close-button-bg");
|
|
178
|
+
/**
|
|
179
|
+
* Chakra's stock CloseButton hover/active wash (`blackAlpha.100`/`.200`) only swaps to
|
|
180
|
+
* `whiteAlpha.100`/`.200` under `_dark` — dead in this app (see createBrandTheme's colorMode
|
|
181
|
+
* comment) — so a CloseButton on a dark canvas keeps the light-mode blackAlpha wash, which reads
|
|
182
|
+
* as almost no affordance against a dark surface. The light-mode values themselves also measure
|
|
183
|
+
* borderline against `background[50]` (1.14/1.19, under `MIN_PERCEPTIBLE_STEP`). Branch on the
|
|
184
|
+
* palette's own actual canvas (`isDarkCanvas`), not Chakra's dead colorMode, and step one rung up
|
|
185
|
+
* each scale (`.200`/`.300`) — verified >=1.19 across all 9 brands x both modes
|
|
186
|
+
* (closeButtonHover.test.ts).
|
|
187
|
+
*/
|
|
188
|
+
const CloseButton = {
|
|
189
|
+
baseStyle: ({ theme }) => {
|
|
190
|
+
var _a, _b, _c, _d, _e;
|
|
191
|
+
const dark = isDarkCanvas((_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.main) !== null && _c !== void 0 ? _c : "#ffffff");
|
|
192
|
+
const alpha = dark ? (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.whiteAlpha : (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.blackAlpha;
|
|
193
|
+
return {
|
|
194
|
+
_hover: { [$closeButtonBg.variable]: alpha === null || alpha === void 0 ? void 0 : alpha[200] },
|
|
195
|
+
_active: { [$closeButtonBg.variable]: alpha === null || alpha === void 0 ? void 0 : alpha[300] },
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
export const componentStyles = {
|
|
200
|
+
Checkbox,
|
|
201
|
+
Radio,
|
|
202
|
+
Input,
|
|
203
|
+
Button,
|
|
204
|
+
Select,
|
|
205
|
+
Tag,
|
|
206
|
+
Textarea,
|
|
207
|
+
NumberInput,
|
|
208
|
+
Badge,
|
|
209
|
+
FormError,
|
|
210
|
+
Drawer,
|
|
211
|
+
Menu,
|
|
212
|
+
Modal,
|
|
213
|
+
Popover,
|
|
214
|
+
Slider,
|
|
215
|
+
Switch,
|
|
216
|
+
Tabs,
|
|
217
|
+
Avatar,
|
|
218
|
+
Skeleton,
|
|
219
|
+
Tooltip,
|
|
220
|
+
CloseButton,
|
|
221
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { extendTheme } from "@chakra-ui/react";
|
|
2
|
+
import common from "./common.web";
|
|
3
|
+
import fonts from "./fonts.web";
|
|
4
|
+
import { componentStyles } from "./componentStyles";
|
|
5
|
+
import { onFilled } from "../tokens/builders/accentText";
|
|
6
|
+
/**
|
|
7
|
+
* Builds a Chakra theme from a pure brand palette.
|
|
8
|
+
*
|
|
9
|
+
* Replaces the seven byte-identical `<Brand>/theme.ts` files — they differed only in
|
|
10
|
+
* which palette they imported.
|
|
11
|
+
*
|
|
12
|
+
* Dark mode works by swapping which palette the theme carries: `componentStyles` variants
|
|
13
|
+
* are functions of `({ theme })` and `useCustomTheme()` reads `theme.colors`, so both follow
|
|
14
|
+
* the palette automatically without any per-component `_dark` overrides.
|
|
15
|
+
*/
|
|
16
|
+
export const createBrandTheme = (palette, options = {}) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const colorMode = (_a = options.colorMode) !== null && _a !== void 0 ? _a : "light";
|
|
19
|
+
const brand = {
|
|
20
|
+
colors: palette,
|
|
21
|
+
...fonts,
|
|
22
|
+
...common,
|
|
23
|
+
};
|
|
24
|
+
return extendTheme({
|
|
25
|
+
...brand,
|
|
26
|
+
config: {
|
|
27
|
+
...common.config,
|
|
28
|
+
// Deliberately ALWAYS "light", even for the dark theme — this is not a bug.
|
|
29
|
+
//
|
|
30
|
+
// Dark works by swapping the palette, so the palette is ALREADY mode-adapted by the time
|
|
31
|
+
// Chakra sees it. Telling Chakra it is in dark mode makes it adapt a second time: its
|
|
32
|
+
// built-ins carry `_dark` blocks that reach for `gray.700`/`gray.800` assuming a scale where
|
|
33
|
+
// those rungs are dark. Our dark gray ramp runs dark -> light, so those rungs are LIGHT —
|
|
34
|
+
// producing a light Card/Skeleton/Menu on a dark canvas. Adapting twice cancels out.
|
|
35
|
+
//
|
|
36
|
+
// Keeping Chakra on its `_light` branch is what makes the swap work: those defaults are
|
|
37
|
+
// gray-RUNG references (`gray.100`, `gray.200`, `gray.600`), and our reversed ramp already
|
|
38
|
+
// maps each rung to the right value per mode. `semanticTokens` below patches the one default
|
|
39
|
+
// that hardcodes a literal color instead of a rung.
|
|
40
|
+
initialColorMode: "light",
|
|
41
|
+
useSystemColorMode: false,
|
|
42
|
+
},
|
|
43
|
+
// `chakra-body-bg` is the only stock semantic token that resolves to a LITERAL (`white`)
|
|
44
|
+
// rather than a gray rung, so it is the only one the palette swap cannot correct on its own —
|
|
45
|
+
// it is what paints a white Card/Modal/Menu on the dark canvas. `background[50]` is the
|
|
46
|
+
// canvas-following equivalent: byte-identical `#ffffff` in light, the canvas in dark.
|
|
47
|
+
// `chakra-inverse-text` is the same literal-`white` problem in text form.
|
|
48
|
+
semanticTokens: {
|
|
49
|
+
colors: {
|
|
50
|
+
"chakra-body-bg": palette.background[50],
|
|
51
|
+
"chakra-inverse-text": palette.background[50],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
// Light themes intentionally declare no global styles — that is the pre-existing
|
|
55
|
+
// behavior, and adding any would shift every consuming app's light rendering.
|
|
56
|
+
// Dark needs a canvas, otherwise the page stays white behind the components.
|
|
57
|
+
...(colorMode === "dark"
|
|
58
|
+
? {
|
|
59
|
+
styles: {
|
|
60
|
+
global: {
|
|
61
|
+
// Native widgets the page cannot style — the `<select>` dropdown list and the
|
|
62
|
+
// time/date picker popups — are painted by the browser, which defaults to light
|
|
63
|
+
// and produced white popups on the dark canvas. `color-scheme` is the only way to
|
|
64
|
+
// tell it otherwise.
|
|
65
|
+
html: {
|
|
66
|
+
colorScheme: "dark",
|
|
67
|
+
},
|
|
68
|
+
body: {
|
|
69
|
+
bg: palette.backgroundColor.main,
|
|
70
|
+
color: palette.text[900],
|
|
71
|
+
},
|
|
72
|
+
// Text selection is another browser-painted surface `color-scheme` doesn't cover —
|
|
73
|
+
// the UA default `::selection` stays a light highlight regardless of theme, so
|
|
74
|
+
// selecting text anywhere (e.g. a table cell) shows a stray white/lavender patch on
|
|
75
|
+
// the dark canvas. Brand it instead, with WCAG-safe ink via the same `onFilled` math
|
|
76
|
+
// used for buttons/badges.
|
|
77
|
+
"::selection": {
|
|
78
|
+
background: palette.primary[500],
|
|
79
|
+
color: onFilled(palette.primary[500], palette.white, palette.black),
|
|
80
|
+
},
|
|
81
|
+
"::-moz-selection": {
|
|
82
|
+
background: palette.primary[500],
|
|
83
|
+
color: onFilled(palette.primary[500], palette.white, palette.black),
|
|
84
|
+
},
|
|
85
|
+
// `color-scheme: dark` gives WebKit/Blink a dark scrollbar by default, but it's the
|
|
86
|
+
// OS's generic dark gray, not brand-aware — style it explicitly so it matches the
|
|
87
|
+
// canvas instead of floating as a mismatched gray bar.
|
|
88
|
+
"::-webkit-scrollbar": {
|
|
89
|
+
width: "10px",
|
|
90
|
+
height: "10px",
|
|
91
|
+
},
|
|
92
|
+
"::-webkit-scrollbar-track": {
|
|
93
|
+
background: palette.backgroundColor.main,
|
|
94
|
+
},
|
|
95
|
+
"::-webkit-scrollbar-thumb": {
|
|
96
|
+
background: palette.gray[600],
|
|
97
|
+
borderRadius: "6px",
|
|
98
|
+
},
|
|
99
|
+
"::-webkit-scrollbar-thumb:hover": {
|
|
100
|
+
background: palette.gray[500],
|
|
101
|
+
},
|
|
102
|
+
// Chrome/Edge autofill paints its own opaque yellow/white fill behind the input
|
|
103
|
+
// text via `-webkit-box-shadow` (not `background`), so a plain `bg` override never
|
|
104
|
+
// reaches it — a bright light box survives on every dark autofilled field unless
|
|
105
|
+
// overridden with the same trick.
|
|
106
|
+
"input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus": {
|
|
107
|
+
WebkitBoxShadow: `0 0 0px 1000px ${palette.backgroundColor.secondary} inset`,
|
|
108
|
+
WebkitTextFillColor: palette.text[900],
|
|
109
|
+
caretColor: palette.text[900],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
: {}),
|
|
115
|
+
components: componentStyles,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
export default createBrandTheme;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Self-hosted Inter Variable (wght 100–900); required for theme fontWeights to render correctly. */
|
|
2
|
+
import "@fontsource-variable/inter/index.css";
|
|
3
|
+
import typography from "../tokens/primitives/typography";
|
|
4
|
+
/**
|
|
5
|
+
* Web font binding: loads the Inter font face (CSS side-effect) and re-exports the pure
|
|
6
|
+
* typography tokens. The CSS import lives here rather than in `tokens/` so the token
|
|
7
|
+
* layer stays portable to mobile.
|
|
8
|
+
*/
|
|
9
|
+
const fonts = typography;
|
|
10
|
+
export default fonts;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import createBrandTheme from "./chakra/createBrandTheme";
|
|
2
|
+
import { lightPalettes, darkPalettes } from "./tokens/brands";
|
|
3
|
+
/**
|
|
4
|
+
* Chakra themes per brand, built from the pure palettes in `tokens/brands`.
|
|
5
|
+
*
|
|
6
|
+
* These used to be seven near-identical `<Brand>/theme.ts` files that differed only in
|
|
7
|
+
* which palette they imported; `createBrandTheme` is that shared body.
|
|
8
|
+
*/
|
|
9
|
+
const lavender = createBrandTheme(lightPalettes.lavender);
|
|
10
|
+
const meadow = createBrandTheme(lightPalettes.meadow);
|
|
11
|
+
const radiant = createBrandTheme(lightPalettes.radiant);
|
|
12
|
+
const skyline = createBrandTheme(lightPalettes.skyline);
|
|
13
|
+
const slate = createBrandTheme(lightPalettes.slate);
|
|
14
|
+
const emerald = createBrandTheme(lightPalettes.emerald);
|
|
15
|
+
const rosewood = createBrandTheme(lightPalettes.rosewood);
|
|
16
|
+
const storefront = createBrandTheme(lightPalettes.storefront);
|
|
17
|
+
const zinc = createBrandTheme(lightPalettes.zinc);
|
|
18
|
+
export { skyline, meadow, radiant, lavender, slate, emerald, rosewood, storefront, zinc };
|
|
19
|
+
/**
|
|
20
|
+
* Published contract — consumers iterate this to render theme pickers, so both the keys
|
|
21
|
+
* and their order are load-bearing. Stays light-only: these are the exact theme objects
|
|
22
|
+
* apps already pass to `withTheme`, and dark is opt-in via `PixelizeThemeProvider`.
|
|
23
|
+
* `storefront`/`zinc` are appended at the end — additive, doesn't reorder existing entries.
|
|
24
|
+
*/
|
|
25
|
+
export const ThemesList = {
|
|
26
|
+
lavender: lavender,
|
|
27
|
+
meadow: meadow,
|
|
28
|
+
skyline: skyline,
|
|
29
|
+
emerald: emerald,
|
|
30
|
+
rosewood: rosewood,
|
|
31
|
+
slate: slate,
|
|
32
|
+
radiant: radiant,
|
|
33
|
+
storefront: storefront,
|
|
34
|
+
zinc: zinc,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* `dark` is built on first read, not at import. Nine `createBrandTheme` calls measure ~15ms on a
|
|
38
|
+
* dev machine, and a light-only app (tickets, and every app before it opts in) never reads one.
|
|
39
|
+
* A getter — rather than a lazy map — keeps `Object.keys(brandThemes)` and its order intact,
|
|
40
|
+
* which `ThemeSwitcher` iterates to render the brand picker.
|
|
41
|
+
*/
|
|
42
|
+
const withLazyDark = (brand, light) => {
|
|
43
|
+
let dark;
|
|
44
|
+
return {
|
|
45
|
+
light,
|
|
46
|
+
get dark() {
|
|
47
|
+
dark !== null && dark !== void 0 ? dark : (dark = createBrandTheme(darkPalettes[brand], { colorMode: "dark" }));
|
|
48
|
+
return dark;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** Light + dark theme per brand. `PixelizeThemeProvider` swaps between these. */
|
|
53
|
+
export const brandThemes = {
|
|
54
|
+
lavender: withLazyDark("lavender", lavender),
|
|
55
|
+
meadow: withLazyDark("meadow", meadow),
|
|
56
|
+
radiant: withLazyDark("radiant", radiant),
|
|
57
|
+
skyline: withLazyDark("skyline", skyline),
|
|
58
|
+
slate: withLazyDark("slate", slate),
|
|
59
|
+
emerald: withLazyDark("emerald", emerald),
|
|
60
|
+
rosewood: withLazyDark("rosewood", rosewood),
|
|
61
|
+
storefront: withLazyDark("storefront", storefront),
|
|
62
|
+
zinc: withLazyDark("zinc", zinc),
|
|
63
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
3
|
+
import { ChakraProvider, extendTheme } from "@chakra-ui/react";
|
|
4
|
+
import { brandThemes } from "../index";
|
|
5
|
+
import ToasterProvider from "../../Components/Toaster/Toaster";
|
|
6
|
+
import { getSystemColorMode, readStoredTheme, subscribeToSystemColorMode, writeStoredTheme, } from "./colorModeStorage";
|
|
7
|
+
const DEFAULT_BRAND = "lavender";
|
|
8
|
+
const DEFAULT_MODE = "system";
|
|
9
|
+
const DEFAULT_STORAGE_KEY = "pixelize-theme";
|
|
10
|
+
/**
|
|
11
|
+
* Chakra's default `colorModeManager` reads/writes its OWN `localStorage["chakra-ui-color-mode"]`
|
|
12
|
+
* key — entirely separate from this app's `storageKey` above — and that stored value wins over
|
|
13
|
+
* `theme.config.initialColorMode` on every load. `createBrandTheme` sets `initialColorMode: "light"`
|
|
14
|
+
* on every theme object specifically so Chakra's native dark mode (and every un-migrated built-in
|
|
15
|
+
* `_dark:` block — Card's "elevated" variant reaches for `gray.700`, which our reversed dark ramp
|
|
16
|
+
* makes LIGHT) never fires. But a stale `"dark"` value in that key — from Chakra's own toggle ever
|
|
17
|
+
* having been used on this origin, by this app or a prior version of it — silently overrides that
|
|
18
|
+
* default and reintroduces exactly the bug `initialColorMode: "light"` was meant to prevent: a
|
|
19
|
+
* washed-out light Card on an otherwise-correct dark canvas, while everything reading the palette
|
|
20
|
+
* directly (i.e. everything else) stays right. Forcing this manager to always report `"light"` and
|
|
21
|
+
* never persist removes Chakra's native color mode from the equation entirely, so no stray
|
|
22
|
+
* `_dark:` block anywhere (present or future) can ever fire, regardless of what's in storage.
|
|
23
|
+
*/
|
|
24
|
+
const forcedLightColorModeManager = {
|
|
25
|
+
type: "localStorage",
|
|
26
|
+
ssr: false,
|
|
27
|
+
get: () => "light",
|
|
28
|
+
set: () => { },
|
|
29
|
+
};
|
|
30
|
+
export const ThemeModeContext = createContext(undefined);
|
|
31
|
+
/**
|
|
32
|
+
* Chakra's own color mode is deliberately NOT synced to `resolvedMode`, and must not be.
|
|
33
|
+
*
|
|
34
|
+
* This provider adapts for dark by swapping the palette, so `theme.colors` is already correct for
|
|
35
|
+
* the active mode. Putting Chakra into dark mode on top of that adapts a second time: its built-in
|
|
36
|
+
* `_dark` blocks reach for `gray.700`/`gray.800` expecting those rungs to be dark, but our dark
|
|
37
|
+
* ramp runs dark -> light, so they resolve LIGHT — a white Card/Skeleton/Menu on a dark canvas.
|
|
38
|
+
* A previous revision synced it to keep `useColorModeValue()` working and shipped exactly that.
|
|
39
|
+
*
|
|
40
|
+
* Consequence for consumers: `useColorModeValue(light, dark)` always returns its LIGHT argument.
|
|
41
|
+
* That is correct here — the palette has already resolved the mode, so the "light" argument is
|
|
42
|
+
* whatever the active palette says. Read the mode from `useThemeMode()` instead. Existing apps are
|
|
43
|
+
* unaffected: they are light-only, where that argument was always the one returned anyway.
|
|
44
|
+
*/
|
|
45
|
+
export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, onBrandChange, defaultMode = DEFAULT_MODE, onModeChange, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, themeOverrides, }) => {
|
|
46
|
+
const [mode, setModeState] = useState(defaultMode);
|
|
47
|
+
const [brand, setBrandState] = useState(brandProp);
|
|
48
|
+
// Deterministic on the server and on the first client render — the real OS value lands in
|
|
49
|
+
// the effect below, so hydration always matches.
|
|
50
|
+
const [systemMode, setSystemMode] = useState("light");
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setSystemMode(getSystemColorMode());
|
|
53
|
+
return subscribeToSystemColorMode(setSystemMode);
|
|
54
|
+
}, []);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (disablePersistence)
|
|
57
|
+
return;
|
|
58
|
+
const stored = readStoredTheme(storageKey);
|
|
59
|
+
if (stored.mode)
|
|
60
|
+
setModeState(stored.mode);
|
|
61
|
+
if (stored.brand)
|
|
62
|
+
setBrandState(stored.brand);
|
|
63
|
+
}, [disablePersistence, storageKey]);
|
|
64
|
+
// `brandProp` only seeds initial state above, so a consumer that re-renders with a new
|
|
65
|
+
// `brand` prop after mount (e.g. persisting the pick through its own store, like tickets'
|
|
66
|
+
// Settings page dispatching Redux instead of calling `setBrand`) would otherwise never see
|
|
67
|
+
// it applied. Sync it here instead so every consumer gets it for free.
|
|
68
|
+
const isFirstBrandPropRun = useRef(true);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (isFirstBrandPropRun.current) {
|
|
71
|
+
isFirstBrandPropRun.current = false;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// Only re-sync when the prop itself changes — not on every local `setBrand` call (that
|
|
75
|
+
// would fight the user's own in-session brand picking, e.g. via ThemeSwitcher).
|
|
76
|
+
setBrandState(brandProp);
|
|
77
|
+
}, [brandProp]);
|
|
78
|
+
// Same prop-sync for the mode, so an app owning it in its own store no longer needs the
|
|
79
|
+
// `mode` -> store mirror effect that deadlocks against this one.
|
|
80
|
+
const isFirstModePropRun = useRef(true);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (isFirstModePropRun.current) {
|
|
83
|
+
isFirstModePropRun.current = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setModeState(defaultMode);
|
|
87
|
+
}, [defaultMode]);
|
|
88
|
+
// Skipping the mount run keeps the defaults from being written over a stored value before
|
|
89
|
+
// the rehydrate effect above has applied it.
|
|
90
|
+
const isFirstPersistRun = useRef(true);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (isFirstPersistRun.current) {
|
|
93
|
+
isFirstPersistRun.current = false;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (disablePersistence)
|
|
97
|
+
return;
|
|
98
|
+
writeStoredTheme(storageKey, { mode, brand });
|
|
99
|
+
}, [mode, brand, disablePersistence, storageKey]);
|
|
100
|
+
const resolvedMode = mode === "system" ? systemMode : mode;
|
|
101
|
+
/**
|
|
102
|
+
* Native browser UI (the `<select>` dropdown popup chrome, the `<input type="date">` calendar
|
|
103
|
+
* picker) is painted by the browser's own UA stylesheet keyed off the CSS `color-scheme`
|
|
104
|
+
* property, entirely separate from Chakra/React theming — no component style or palette swap
|
|
105
|
+
* above can reach it. Without this, that chrome always renders light, even on an otherwise dark
|
|
106
|
+
* page. Scoped to this provider (not a global stylesheet) so `withTheme` consumers — deliberately
|
|
107
|
+
* light-only, see the module doc's "Key rules" — are untouched.
|
|
108
|
+
*/
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
document.documentElement.style.colorScheme = resolvedMode;
|
|
111
|
+
}, [resolvedMode]);
|
|
112
|
+
// Held in refs so a caller's inline arrow never re-creates `setMode`/`setBrand`, which would
|
|
113
|
+
// invalidate the context value on every render of the consuming app. Written in a layout
|
|
114
|
+
// effect, not during render — a render-phase write is unsafe under StrictMode's double
|
|
115
|
+
// invocation, and this still lands before any click handler can fire.
|
|
116
|
+
const onModeChangeRef = useRef(onModeChange);
|
|
117
|
+
const onBrandChangeRef = useRef(onBrandChange);
|
|
118
|
+
useLayoutEffect(() => {
|
|
119
|
+
onModeChangeRef.current = onModeChange;
|
|
120
|
+
onBrandChangeRef.current = onBrandChange;
|
|
121
|
+
}, [onModeChange, onBrandChange]);
|
|
122
|
+
const setMode = useCallback((next) => {
|
|
123
|
+
var _a;
|
|
124
|
+
setModeState(next);
|
|
125
|
+
(_a = onModeChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onModeChangeRef, next);
|
|
126
|
+
}, []);
|
|
127
|
+
const setBrand = useCallback((next) => {
|
|
128
|
+
var _a;
|
|
129
|
+
setBrandState(next);
|
|
130
|
+
(_a = onBrandChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onBrandChangeRef, next);
|
|
131
|
+
}, []);
|
|
132
|
+
// From "system", flip to the opposite of what the OS currently gives, so a click always
|
|
133
|
+
// visibly changes the UI.
|
|
134
|
+
const toggle = useCallback(() => setMode(resolvedMode === "dark" ? "light" : "dark"), [resolvedMode, setMode]);
|
|
135
|
+
const value = useMemo(() => ({ mode, resolvedMode, setMode, toggle, brand, setBrand }), [mode, resolvedMode, setMode, toggle, brand, setBrand]);
|
|
136
|
+
// `themeOverrides` is caller-supplied, and the idiomatic way to pass it is an inline object
|
|
137
|
+
// literal — a new identity every render. Keying the memo on identity would re-run `extendTheme`
|
|
138
|
+
// and hand `ChakraProvider` a new theme on every render of the consuming app, invalidating
|
|
139
|
+
// emotion's style resolution for everything beneath it. Compare by value instead.
|
|
140
|
+
const overridesKey = themeOverrides ? JSON.stringify(themeOverrides) : "";
|
|
141
|
+
const resolvedTheme = useMemo(() => {
|
|
142
|
+
const base = brandThemes[brand][resolvedMode];
|
|
143
|
+
return themeOverrides ? extendTheme(base, themeOverrides) : base;
|
|
144
|
+
// Keyed on the serialized overrides, not their identity. `brand`/`resolvedMode` must stay:
|
|
145
|
+
// overrides re-layer onto the CURRENT palette (see the prop's doc comment above).
|
|
146
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
147
|
+
}, [brand, resolvedMode, overridesKey]);
|
|
148
|
+
/**
|
|
149
|
+
* The library ships its `var(--color-*)` tokens light-only on `:root` (global.css), so any
|
|
150
|
+
* consumer that styles with those CSS vars rather than Chakra tokens stays light in dark mode —
|
|
151
|
+
* invisible text on the dark canvas, white panels. In dark, re-point every used var at the
|
|
152
|
+
* already-dark-correct resolved palette; in light, clear them so the static `:root` values apply
|
|
153
|
+
* unchanged (so a light-only app is byte-identical to before). Also mirror the mode to
|
|
154
|
+
* `data-mode` for consumers that want to hook their own dark CSS.
|
|
155
|
+
*/
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
158
|
+
const root = document.documentElement;
|
|
159
|
+
root.dataset.mode = resolvedMode;
|
|
160
|
+
const colors = resolvedTheme.colors;
|
|
161
|
+
const sem = (_a = colors.semantic) !== null && _a !== void 0 ? _a : {};
|
|
162
|
+
const gray = colors.gray;
|
|
163
|
+
const HUE_SCALES = [
|
|
164
|
+
"primary", "gray", "red", "orange", "yellow",
|
|
165
|
+
"green", "teal", "blue", "cyan", "purple", "pink",
|
|
166
|
+
];
|
|
167
|
+
const SEMANTIC_SCALES = ["success", "error", "warning", "info"]; // nested under colors.semantic
|
|
168
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
169
|
+
// Single-value semantic vars → palette scale+rung. The dark gray ramp runs dark(50) → light(900),
|
|
170
|
+
// so low rungs read as surfaces and high rungs as text — correct in dark, cleared in light.
|
|
171
|
+
const SEMANTIC_VARS = {
|
|
172
|
+
"text-heading": gray === null || gray === void 0 ? void 0 : gray[900], "text-body": gray === null || gray === void 0 ? void 0 : gray[700],
|
|
173
|
+
"text-subtle": gray === null || gray === void 0 ? void 0 : gray[500], "text-input": gray === null || gray === void 0 ? void 0 : gray[500],
|
|
174
|
+
"bg-main": gray === null || gray === void 0 ? void 0 : gray[50], "bg-secondary": gray === null || gray === void 0 ? void 0 : gray[100], "bg-tertiary": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
175
|
+
"bg-quaternary": gray === null || gray === void 0 ? void 0 : gray[200], "bg-light": gray === null || gray === void 0 ? void 0 : gray[50], "bg-medium": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
176
|
+
"bg-accent": gray === null || gray === void 0 ? void 0 : gray[200], "bg-subtle": gray === null || gray === void 0 ? void 0 : gray[100], "bg-muted": gray === null || gray === void 0 ? void 0 : gray[200],
|
|
177
|
+
"bg-neutral": gray === null || gray === void 0 ? void 0 : gray[100], "bg-base": gray === null || gray === void 0 ? void 0 : gray[50], "bg-table-header": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
178
|
+
"border-default": gray === null || gray === void 0 ? void 0 : gray[200], "border-light": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
179
|
+
"border-dark": gray === null || gray === void 0 ? void 0 : gray[300], "border-input": gray === null || gray === void 0 ? void 0 : gray[300],
|
|
180
|
+
"border-error": (_b = sem.error) === null || _b === void 0 ? void 0 : _b[500], "border-success": (_c = sem.success) === null || _c === void 0 ? void 0 : _c[500],
|
|
181
|
+
"border-warning": (_d = sem.warning) === null || _d === void 0 ? void 0 : _d[500], "border-info": (_e = sem.info) === null || _e === void 0 ? void 0 : _e[500],
|
|
182
|
+
};
|
|
183
|
+
const set = (name, val) => val && root.style.setProperty(`--color-${name}`, val);
|
|
184
|
+
const clear = (name) => root.style.removeProperty(`--color-${name}`);
|
|
185
|
+
const allRampNames = [...HUE_SCALES, ...SEMANTIC_SCALES].flatMap((s) => RUNGS.map((r) => `${s}-${r}`));
|
|
186
|
+
if (resolvedMode === "dark") {
|
|
187
|
+
for (const s of HUE_SCALES)
|
|
188
|
+
for (const r of RUNGS)
|
|
189
|
+
set(`${s}-${r}`, (_f = colors[s]) === null || _f === void 0 ? void 0 : _f[r]);
|
|
190
|
+
for (const s of SEMANTIC_SCALES)
|
|
191
|
+
for (const r of RUNGS)
|
|
192
|
+
set(`${s}-${r}`, (_g = sem[s]) === null || _g === void 0 ? void 0 : _g[r]);
|
|
193
|
+
for (const [name, val] of Object.entries(SEMANTIC_VARS))
|
|
194
|
+
set(name, val);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
for (const name of allRampNames)
|
|
198
|
+
clear(name);
|
|
199
|
+
for (const name of Object.keys(SEMANTIC_VARS))
|
|
200
|
+
clear(name);
|
|
201
|
+
}
|
|
202
|
+
}, [resolvedMode, resolvedTheme]);
|
|
203
|
+
return (_jsx(ThemeModeContext.Provider, { value: value, children: _jsx(ChakraProvider, { theme: resolvedTheme, colorModeManager: forcedLightColorModeManager, children: _jsx(ToasterProvider, { children: children }) }) }));
|
|
204
|
+
};
|