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,289 @@
|
|
|
1
|
+
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "./buildBrandTokens";
|
|
2
|
+
import { contrastRatio, hexToHsl, hslToHex, withLightness } from "./color";
|
|
3
|
+
import { pickAccentText } from "./accentText";
|
|
4
|
+
/**
|
|
5
|
+
* Derives a brand's dark palette from its light palette.
|
|
6
|
+
*
|
|
7
|
+
* Every value is computed from the brand's OWN hue, so each brand keeps its identity in
|
|
8
|
+
* dark mode instead of collapsing onto one shared grey.
|
|
9
|
+
*
|
|
10
|
+
* Three different strategies are used, because a single rule gives wrong results:
|
|
11
|
+
*
|
|
12
|
+
* - **Structural ramps** (surfaces, text, borders) are rebuilt at explicit lightness
|
|
13
|
+
* targets around the brand hue. They are NOT simply reversed: the light ramps bottom out
|
|
14
|
+
* around 35% lightness, which is nowhere near dark enough for a dark-mode canvas.
|
|
15
|
+
* - **Utility hue ramps** (red/green/…) are reversed, so index roles survive: `red.50` is a
|
|
16
|
+
* pale badge background in light and becomes a deep one in dark, while `red.900` flips to
|
|
17
|
+
* near-white for text on it.
|
|
18
|
+
* - **Brand + semantic ramps** are shifted one step lighter, preserving hue while lifting
|
|
19
|
+
* the accent to a legible lightness against a dark canvas.
|
|
20
|
+
*
|
|
21
|
+
* `white`, `black` and `transparent` are deliberately untouched — `white` is a *text* color
|
|
22
|
+
* on filled buttons (see `Button.styles.ts`), not a surface. Components that use `white` as a
|
|
23
|
+
* surface are migrated to a surface token instead.
|
|
24
|
+
*/
|
|
25
|
+
const SCALE_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
26
|
+
const fromTargets = (hueSource, targets, saturation) => {
|
|
27
|
+
const { h } = hexToHsl(hueSource);
|
|
28
|
+
const out = {};
|
|
29
|
+
for (const k of SCALE_KEYS) {
|
|
30
|
+
out[k] = hslToHex({ h, s: saturation, l: targets[k] });
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
};
|
|
34
|
+
/** Mirrors index roles: 50↔900, 100↔800, 200↔700, 300↔600, 400↔500. */
|
|
35
|
+
export const reverseScale = (scale) => ({
|
|
36
|
+
50: scale[900],
|
|
37
|
+
100: scale[800],
|
|
38
|
+
200: scale[700],
|
|
39
|
+
300: scale[600],
|
|
40
|
+
400: scale[500],
|
|
41
|
+
500: scale[400],
|
|
42
|
+
600: scale[300],
|
|
43
|
+
700: scale[200],
|
|
44
|
+
800: scale[100],
|
|
45
|
+
900: scale[50],
|
|
46
|
+
});
|
|
47
|
+
/** Shifts a ramp one step lighter, keeping hue. Used for brand + semantic accents. */
|
|
48
|
+
export const shiftLighter = (scale) => ({
|
|
49
|
+
50: withLightness(scale[50], Math.min(hexToHsl(scale[50]).l + 4, 97)),
|
|
50
|
+
100: scale[50],
|
|
51
|
+
200: scale[100],
|
|
52
|
+
300: scale[200],
|
|
53
|
+
400: scale[300],
|
|
54
|
+
500: scale[400],
|
|
55
|
+
600: scale[500],
|
|
56
|
+
700: scale[600],
|
|
57
|
+
800: scale[700],
|
|
58
|
+
900: scale[800],
|
|
59
|
+
});
|
|
60
|
+
/** WCAG AA for normal text — the bar for a solid button's white label. */
|
|
61
|
+
const WHITE_LABEL_TARGET = 4.5;
|
|
62
|
+
const MAX_ACCENT_LIGHTNESS = 85;
|
|
63
|
+
const LIGHTNESS_STEP = 0.5;
|
|
64
|
+
/**
|
|
65
|
+
* How much lighter this accent can go in dark mode.
|
|
66
|
+
*
|
|
67
|
+
* An accent faces two opposing constraints: lighter reads better against a dark canvas, but
|
|
68
|
+
* worse under the white label of a solid button. There is no single rung that satisfies both
|
|
69
|
+
* for all seven brands, so this maximizes canvas contrast subject to keeping the white label
|
|
70
|
+
* legible.
|
|
71
|
+
*
|
|
72
|
+
* The floor is `min(AA, whatLightModeAlreadyShips)`: emerald and rosewood already ship white
|
|
73
|
+
* labels below AA in light mode, so demanding AA here would force their brand color to change.
|
|
74
|
+
* Dark is held to "no worse than light", never stricter.
|
|
75
|
+
*/
|
|
76
|
+
export const accentLightnessDelta = (accent500, white) => {
|
|
77
|
+
const originalL = hexToHsl(accent500).l;
|
|
78
|
+
const floor = Math.min(WHITE_LABEL_TARGET, contrastRatio(white, accent500));
|
|
79
|
+
let best = originalL;
|
|
80
|
+
// Contrast against white falls monotonically as lightness rises, so stop at the first miss.
|
|
81
|
+
for (let l = originalL; l <= MAX_ACCENT_LIGHTNESS; l += LIGHTNESS_STEP) {
|
|
82
|
+
if (contrastRatio(white, withLightness(accent500, l)) < floor)
|
|
83
|
+
break;
|
|
84
|
+
best = l;
|
|
85
|
+
}
|
|
86
|
+
return best - originalL;
|
|
87
|
+
};
|
|
88
|
+
/** Raises every rung by the same lightness delta, preserving the ramp's shape and hue. */
|
|
89
|
+
export const liftScale = (scale, delta) => {
|
|
90
|
+
const out = {};
|
|
91
|
+
for (const k of SCALE_KEYS) {
|
|
92
|
+
out[k] = withLightness(scale[k], Math.min(hexToHsl(scale[k]).l + delta, 97));
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Dark-ramp endpoints for a brand/semantic scale.
|
|
98
|
+
*
|
|
99
|
+
* `[50]`/`[100]` are the SUBTLE TINT rungs — chips, avatars, ghost hovers. On a dark canvas they
|
|
100
|
+
* must be dark, not near-white. `[800]`/`[900]` are the STRONG rungs and get read as text, so on
|
|
101
|
+
* a dark canvas they must be light. Both roles invert versus light mode.
|
|
102
|
+
*/
|
|
103
|
+
const BRAND_DARK_MIN_L = 12;
|
|
104
|
+
const BRAND_DARK_MAX_L = 93;
|
|
105
|
+
/** Rung order, used to interpolate lightness on each side of the pinned accent. */
|
|
106
|
+
const RUNG_ORDER = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
107
|
+
const ACCENT_INDEX = RUNG_ORDER.indexOf(500);
|
|
108
|
+
/**
|
|
109
|
+
* Rebuild a scale as a proper DARK ramp: monotonically dark -> light across 50 -> 900, with `[500]`
|
|
110
|
+
* pinned to the accent.
|
|
111
|
+
*
|
|
112
|
+
* Replaces a flat lift for brand/semantic scales. A flat lift adds the same delta to every rung, so
|
|
113
|
+
* `[50]` stayed near-white (it clamps at L97) and `[600]`+ stayed DARKER than the accent — which is
|
|
114
|
+
* wrong in both directions on a dark canvas: the tint rungs painted white chips, and components
|
|
115
|
+
* that use `[600]` as text (e.g. Accordion) rendered dark-on-dark at ~1.3 contrast.
|
|
116
|
+
*
|
|
117
|
+
* Interpolating around the pinned accent (rather than using fixed lightness targets) keeps the ramp
|
|
118
|
+
* monotonic for every brand, whatever lightness that brand's accent lands on. Hue and saturation are
|
|
119
|
+
* taken from the light scale's OWN matching rung, so each brand keeps its character and its tint
|
|
120
|
+
* rungs stay as desaturated as they were designed to be.
|
|
121
|
+
*/
|
|
122
|
+
const toDarkRamp = (scale, accentHex) => {
|
|
123
|
+
const accentL = hexToHsl(accentHex).l;
|
|
124
|
+
const out = {};
|
|
125
|
+
RUNG_ORDER.forEach((key, i) => {
|
|
126
|
+
let l;
|
|
127
|
+
if (i === ACCENT_INDEX) {
|
|
128
|
+
l = accentL;
|
|
129
|
+
}
|
|
130
|
+
else if (i < ACCENT_INDEX) {
|
|
131
|
+
// 50 -> just below the accent.
|
|
132
|
+
const t = i / ACCENT_INDEX;
|
|
133
|
+
l = BRAND_DARK_MIN_L + (accentL - BRAND_DARK_MIN_L) * t;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// Just above the accent -> 900.
|
|
137
|
+
const t = (i - ACCENT_INDEX) / (RUNG_ORDER.length - 1 - ACCENT_INDEX);
|
|
138
|
+
l = accentL + (BRAND_DARK_MAX_L - accentL) * t;
|
|
139
|
+
}
|
|
140
|
+
const { s } = hexToHsl(scale[key]);
|
|
141
|
+
out[key] = hslToHex({ h: hexToHsl(accentHex).h, s, l });
|
|
142
|
+
});
|
|
143
|
+
return out;
|
|
144
|
+
};
|
|
145
|
+
/** Dark accent scale: accent pinned as light as the white label allows, ramp rebuilt around it. */
|
|
146
|
+
const liftAccent = (scale, white) => {
|
|
147
|
+
const accent = withLightness(scale[500], hexToHsl(scale[500]).l + accentLightnessDelta(scale[500], white));
|
|
148
|
+
return { ...toDarkRamp(scale, accent), 500: accent };
|
|
149
|
+
};
|
|
150
|
+
const liftBrand = (brand, white) => {
|
|
151
|
+
const lifted = liftAccent(brand, white);
|
|
152
|
+
return { ...lifted, opacity: buildPrimaryOpacity(lifted[500]) };
|
|
153
|
+
};
|
|
154
|
+
// Lightness targets per structural ramp. Index roles match light mode; only lightness flips.
|
|
155
|
+
const SURFACE_TARGETS = {
|
|
156
|
+
50: 7, 100: 9, 200: 11, 300: 14, 400: 17, 500: 21, 600: 30, 700: 45, 800: 60, 900: 75,
|
|
157
|
+
};
|
|
158
|
+
const TEXT_TARGETS = {
|
|
159
|
+
50: 30, 100: 38, 200: 45, 300: 55, 400: 62, 500: 70, 600: 76, 700: 82, 800: 88, 900: 95,
|
|
160
|
+
};
|
|
161
|
+
const PLACEHOLDER_TARGETS = {
|
|
162
|
+
50: 25, 100: 30, 200: 35, 300: 42, 400: 48, 500: 54, 600: 60, 700: 66, 800: 72, 900: 80,
|
|
163
|
+
};
|
|
164
|
+
// Rung 200 is the default hairline. At L18 it sat 5 points off a card at L13 — below the
|
|
165
|
+
// perceptible step, so dark cards read as edgeless. L22 draws the same 1.2x edge the light
|
|
166
|
+
// ramp does, which is what makes a card look like a card in either mode.
|
|
167
|
+
const BORDER_TARGETS = {
|
|
168
|
+
50: 14, 100: 18, 200: 22, 300: 24, 400: 26, 500: 27, 600: 33, 700: 42, 800: 52, 900: 62,
|
|
169
|
+
};
|
|
170
|
+
const DISABLED_TARGETS = {
|
|
171
|
+
50: 14, 100: 18, 200: 22, 300: 26, 400: 30, 500: 34, 600: 42, 700: 52, 800: 62, 900: 72,
|
|
172
|
+
};
|
|
173
|
+
const TABLE_HOVER_TARGETS = {
|
|
174
|
+
50: 9, 100: 11, 200: 13, 300: 15, 400: 17, 500: 19, 600: 24, 700: 32, 800: 42, 900: 52,
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* `gray[500]` is the library's de-facto muted-text token (~43 call sites), so its rung is set by
|
|
178
|
+
* contrast, not by an even ramp — and it must clear AA against the LIGHTEST named surface it can
|
|
179
|
+
* land on, not merely against the canvas. Tuning it to the canvas alone is what shipped the first
|
|
180
|
+
* two misses: L48 measured 4.18 on the canvas, then L52 cleared the canvas (4.81) but still failed
|
|
181
|
+
* on every surface above `secondary` (3.39 on `muted`). L64 clears all of them (5.66 worst case).
|
|
182
|
+
*
|
|
183
|
+
* That lands on shadcn's own answer independently: its dark `muted-foreground` is zinc-400
|
|
184
|
+
* (#a1a1aa, L65) against a near-black canvas. Ours is #a49ea9 — same lightness, brand hue kept.
|
|
185
|
+
* Rungs at/below 400 stay decorative (borders, dividers, disabled) and are not held to text AA.
|
|
186
|
+
*/
|
|
187
|
+
const GRAY_TARGETS = {
|
|
188
|
+
50: 10, 100: 14, 200: 22, 300: 32, 400: 48, 500: 64, 600: 72, 700: 79, 800: 86, 900: 93,
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Named surface lightness. Elevation INVERTS versus light mode: in light, `muted`/`accent`
|
|
192
|
+
* are the strongest tints away from white; in dark, "stronger" means lighter than the canvas.
|
|
193
|
+
*
|
|
194
|
+
* The top of the ramp is deliberately compressed (accent 18->17, muted 20->18): dark elevation
|
|
195
|
+
* reads through small lightness steps plus borders, so a wide spread just looks washed out rather
|
|
196
|
+
* than layered. `light`/`tertiary` share a rung by design (they are aliases); no other pair may,
|
|
197
|
+
* or that step of elevation silently disappears.
|
|
198
|
+
*/
|
|
199
|
+
const NAMED_SURFACE_L = {
|
|
200
|
+
main: 7,
|
|
201
|
+
base: 8,
|
|
202
|
+
subtle: 10,
|
|
203
|
+
secondary: 11,
|
|
204
|
+
tableHeader: 12,
|
|
205
|
+
light: 13,
|
|
206
|
+
tertiary: 13,
|
|
207
|
+
medium: 14,
|
|
208
|
+
neutral: 15,
|
|
209
|
+
quaternary: 16,
|
|
210
|
+
accent: 17,
|
|
211
|
+
muted: 18,
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Surfaces are hue-NEUTRAL in dark: every brand shares one canvas, so switching theme recolors the
|
|
215
|
+
* accents and nothing else. Tinting them instead (this was 14) made a full-screen wash — Meadow's
|
|
216
|
+
* whole app read green — which reads as a different product per brand rather than a different
|
|
217
|
+
* accent. Light mode keeps its tinted canvas; there the tint is a hint on white, not the whole
|
|
218
|
+
* screen. Brand identity in dark lives in `primary`/semantic/text, which stay hued.
|
|
219
|
+
*/
|
|
220
|
+
const SURFACE_SAT = 0;
|
|
221
|
+
const TEXT_SAT = 12;
|
|
222
|
+
const PLACEHOLDER_SAT = 10;
|
|
223
|
+
const BORDER_SAT = 12;
|
|
224
|
+
const DISABLED_SAT = 8;
|
|
225
|
+
// Neutral for the same reason as SURFACE_SAT — gray's low rungs ARE surfaces, and a tinted ramp
|
|
226
|
+
// on a neutral canvas reads as a mismatch. It also buys back the contrast the neutral canvas
|
|
227
|
+
// cost: `gray[400]` on `muted` was 2.99 on lavender/zinc at sat 6, and is 3.16 at 0.
|
|
228
|
+
const GRAY_SAT = 0;
|
|
229
|
+
export function buildDarkPalette(light) {
|
|
230
|
+
const hueSource = light.primary[500];
|
|
231
|
+
const { h } = hexToHsl(hueSource);
|
|
232
|
+
const namedSurfaces = Object.fromEntries(Object.entries(NAMED_SURFACE_L).map(([key, l]) => [
|
|
233
|
+
key,
|
|
234
|
+
hslToHex({ h, s: SURFACE_SAT, l }),
|
|
235
|
+
]));
|
|
236
|
+
const white = light.white;
|
|
237
|
+
const primary = liftBrand(light.primary, white);
|
|
238
|
+
return {
|
|
239
|
+
...light,
|
|
240
|
+
// Brand identity: hue preserved, accent lifted as far as the white label allows.
|
|
241
|
+
primary,
|
|
242
|
+
secondary: liftBrand(light.secondary, white),
|
|
243
|
+
tertiary: liftBrand(light.tertiary, white),
|
|
244
|
+
gradient: light.gradient,
|
|
245
|
+
semantic: {
|
|
246
|
+
success: liftAccent(light.semantic.success, white),
|
|
247
|
+
error: liftAccent(light.semantic.error, white),
|
|
248
|
+
warning: liftAccent(light.semantic.warning, white),
|
|
249
|
+
info: liftAccent(light.semantic.info, white),
|
|
250
|
+
},
|
|
251
|
+
// `white` stays white on purpose: it is the label color on filled buttons.
|
|
252
|
+
transparent: light.transparent,
|
|
253
|
+
black: light.black,
|
|
254
|
+
white: light.white,
|
|
255
|
+
// Utility hues keep their meaning; only the light/dark role of each index flips.
|
|
256
|
+
gray: fromTargets(hueSource, GRAY_TARGETS, GRAY_SAT),
|
|
257
|
+
red: reverseScale(light.red),
|
|
258
|
+
orange: reverseScale(light.orange),
|
|
259
|
+
yellow: reverseScale(light.yellow),
|
|
260
|
+
green: reverseScale(light.green),
|
|
261
|
+
teal: reverseScale(light.teal),
|
|
262
|
+
blue: reverseScale(light.blue),
|
|
263
|
+
cyan: reverseScale(light.cyan),
|
|
264
|
+
purple: reverseScale(light.purple),
|
|
265
|
+
pink: reverseScale(light.pink),
|
|
266
|
+
backgroundColor: namedSurfaces,
|
|
267
|
+
background: fromTargets(hueSource, SURFACE_TARGETS, SURFACE_SAT),
|
|
268
|
+
text: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT),
|
|
269
|
+
header: fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT + 2),
|
|
270
|
+
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
271
|
+
border: fromTargets(hueSource, BORDER_TARGETS, BORDER_SAT),
|
|
272
|
+
boxborder: fromTargets(hueSource, BORDER_TARGETS, BORDER_SAT),
|
|
273
|
+
// Neutral: a row hover is a surface fill, and across a full table its tint is exactly the
|
|
274
|
+
// brand wash the canvas was changed to avoid.
|
|
275
|
+
table: { hover: fromTargets(hueSource, TABLE_HOVER_TARGETS, SURFACE_SAT) },
|
|
276
|
+
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
277
|
+
// Derived from the LIFTED accent against the dark canvas: the lift stops at the white-label
|
|
278
|
+
// floor (~4.55), which leaves primary[500] short of AA as text, so text needs its own rung.
|
|
279
|
+
accentText: pickAccentText(primary, namedSurfaces.main, "dark"),
|
|
280
|
+
// Sidebar is already near-black in light mode, so it needs no inversion.
|
|
281
|
+
sidebar: light.sidebar,
|
|
282
|
+
boxShadow: {
|
|
283
|
+
primary: buildPrimaryShadowTint(primary[500]),
|
|
284
|
+
error: light.boxShadow.error,
|
|
285
|
+
default: "#00000080",
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
export default buildDarkPalette;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Default multi-series palette for Apex charts (strings required by ApexCharts). */
|
|
2
|
+
export function getDefaultSeriesColors(colors) {
|
|
3
|
+
return [
|
|
4
|
+
colors.primary[500],
|
|
5
|
+
colors.semantic.error[500],
|
|
6
|
+
colors.semantic.success[500],
|
|
7
|
+
colors.orange[500],
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
export function mergeChartTitleStyle(colors, titleStyle) {
|
|
11
|
+
return {
|
|
12
|
+
fontSize: "16px",
|
|
13
|
+
fontWeight: 600,
|
|
14
|
+
fontFamily: "Arial",
|
|
15
|
+
color: colors.primary[500],
|
|
16
|
+
...titleStyle,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function chartAxisLabelColor(colors) {
|
|
20
|
+
return colors.gray[700];
|
|
21
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure color math. No dependencies, no platform APIs — safe for the mobile port.
|
|
3
|
+
*
|
|
4
|
+
* Used by `buildDarkPalette` to derive dark ramps from each brand's own light colors,
|
|
5
|
+
* and to assert contrast in tests.
|
|
6
|
+
*/
|
|
7
|
+
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
8
|
+
/**
|
|
9
|
+
* Accepts `#rgb` or `#rrggbb` only. An `#rrggbbaa` throws ON PURPOSE.
|
|
10
|
+
*
|
|
11
|
+
* The old version silently dropped the alpha and returned the fully-opaque rgb. That made
|
|
12
|
+
* `contrastRatio` score a 16%-alpha hover tint as if it were solid — a measured 4.18 for a fill that
|
|
13
|
+
* actually renders at 1.17 over the canvas, a 3.6x overstatement — with a doc comment saying "alpha
|
|
14
|
+
* ignored" that made it look handled. Alpha over an unknown backdrop has no defined luminance, so the
|
|
15
|
+
* only correct move is to refuse it: composite it first with `compositeOver`, then measure the result.
|
|
16
|
+
*/
|
|
17
|
+
export function hexToRgb(hex) {
|
|
18
|
+
let h = hex.trim().replace(/^#/, "");
|
|
19
|
+
if (h.length === 3)
|
|
20
|
+
h = h.split("").map((c) => c + c).join("");
|
|
21
|
+
if (!/^[0-9a-fA-F]{6}$/.test(h)) {
|
|
22
|
+
throw new Error(`hexToRgb needs an opaque #rgb/#rrggbb color, got "${hex}". ` +
|
|
23
|
+
`If this is an #rrggbbaa tint, composite it over its backdrop first (compositeOver).`);
|
|
24
|
+
}
|
|
25
|
+
const int = parseInt(h, 16);
|
|
26
|
+
return { r: (int >> 16) & 255, g: (int >> 8) & 255, b: int & 255 };
|
|
27
|
+
}
|
|
28
|
+
/** Alpha in 0..1. `#rgb`/`#rrggbb` read as fully opaque (`a: 1`); `#rgba`/`#rrggbbaa` carry their alpha. */
|
|
29
|
+
export function hexToRgba(hex) {
|
|
30
|
+
let h = hex.trim().replace(/^#/, "");
|
|
31
|
+
if (h.length === 4)
|
|
32
|
+
h = h.split("").map((c) => c + c).join("");
|
|
33
|
+
if (h.length === 8) {
|
|
34
|
+
const a = parseInt(h.slice(6, 8), 16) / 255;
|
|
35
|
+
return { ...hexToRgb(`#${h.slice(0, 6)}`), a };
|
|
36
|
+
}
|
|
37
|
+
return { ...hexToRgb(`#${h}`), a: 1 };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Flatten a translucent foreground onto an opaque backdrop — the ONLY way to get a real color for a
|
|
41
|
+
* tint before measuring contrast. `contrastRatio(tint, canvas)` now throws; the correct call is
|
|
42
|
+
* `contrastRatio(compositeOver(tint, canvas), canvas)`.
|
|
43
|
+
*/
|
|
44
|
+
export function compositeOver(foreground, backdrop) {
|
|
45
|
+
const f = hexToRgba(foreground);
|
|
46
|
+
const b = hexToRgb(backdrop);
|
|
47
|
+
return rgbToHex({
|
|
48
|
+
r: f.r * f.a + b.r * (1 - f.a),
|
|
49
|
+
g: f.g * f.a + b.g * (1 - f.a),
|
|
50
|
+
b: f.b * f.a + b.b * (1 - f.a),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function rgbToHex({ r, g, b }) {
|
|
54
|
+
const to = (n) => clamp(Math.round(n), 0, 255).toString(16).padStart(2, "0");
|
|
55
|
+
return `#${to(r)}${to(g)}${to(b)}`;
|
|
56
|
+
}
|
|
57
|
+
export function rgbToHsl({ r, g, b }) {
|
|
58
|
+
const rn = r / 255;
|
|
59
|
+
const gn = g / 255;
|
|
60
|
+
const bn = b / 255;
|
|
61
|
+
const max = Math.max(rn, gn, bn);
|
|
62
|
+
const min = Math.min(rn, gn, bn);
|
|
63
|
+
const l = (max + min) / 2;
|
|
64
|
+
const d = max - min;
|
|
65
|
+
if (d === 0)
|
|
66
|
+
return { h: 0, s: 0, l: l * 100 };
|
|
67
|
+
const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
68
|
+
let h;
|
|
69
|
+
if (max === rn)
|
|
70
|
+
h = ((gn - bn) / d + (gn < bn ? 6 : 0)) / 6;
|
|
71
|
+
else if (max === gn)
|
|
72
|
+
h = ((bn - rn) / d + 2) / 6;
|
|
73
|
+
else
|
|
74
|
+
h = ((rn - gn) / d + 4) / 6;
|
|
75
|
+
return { h: h * 360, s: s * 100, l: l * 100 };
|
|
76
|
+
}
|
|
77
|
+
export function hslToRgb({ h, s, l }) {
|
|
78
|
+
const hn = ((h % 360) + 360) % 360 / 360;
|
|
79
|
+
const sn = clamp(s, 0, 100) / 100;
|
|
80
|
+
const ln = clamp(l, 0, 100) / 100;
|
|
81
|
+
if (sn === 0) {
|
|
82
|
+
const v = ln * 255;
|
|
83
|
+
return { r: v, g: v, b: v };
|
|
84
|
+
}
|
|
85
|
+
const q = ln < 0.5 ? ln * (1 + sn) : ln + sn - ln * sn;
|
|
86
|
+
const p = 2 * ln - q;
|
|
87
|
+
const channel = (t) => {
|
|
88
|
+
let tn = t;
|
|
89
|
+
if (tn < 0)
|
|
90
|
+
tn += 1;
|
|
91
|
+
if (tn > 1)
|
|
92
|
+
tn -= 1;
|
|
93
|
+
if (tn < 1 / 6)
|
|
94
|
+
return p + (q - p) * 6 * tn;
|
|
95
|
+
if (tn < 1 / 2)
|
|
96
|
+
return q;
|
|
97
|
+
if (tn < 2 / 3)
|
|
98
|
+
return p + (q - p) * (2 / 3 - tn) * 6;
|
|
99
|
+
return p;
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
r: channel(hn + 1 / 3) * 255,
|
|
103
|
+
g: channel(hn) * 255,
|
|
104
|
+
b: channel(hn - 1 / 3) * 255,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export const hexToHsl = (hex) => rgbToHsl(hexToRgb(hex));
|
|
108
|
+
export const hslToHex = (hsl) => rgbToHex(hslToRgb(hsl));
|
|
109
|
+
/** Re-lights a color while keeping its hue (and, unless overridden, its saturation). */
|
|
110
|
+
export function withLightness(hex, lightness, saturation) {
|
|
111
|
+
const { h, s } = hexToHsl(hex);
|
|
112
|
+
return hslToHex({ h, s: saturation !== null && saturation !== void 0 ? saturation : s, l: clamp(lightness, 0, 100) });
|
|
113
|
+
}
|
|
114
|
+
/** Linear RGB blend. `weight` is how much of `b` to take (0 → a, 1 → b). */
|
|
115
|
+
export function mix(a, b, weight) {
|
|
116
|
+
const ca = hexToRgb(a);
|
|
117
|
+
const cb = hexToRgb(b);
|
|
118
|
+
const w = clamp(weight, 0, 1);
|
|
119
|
+
return rgbToHex({
|
|
120
|
+
r: ca.r + (cb.r - ca.r) * w,
|
|
121
|
+
g: ca.g + (cb.g - ca.g) * w,
|
|
122
|
+
b: ca.b + (cb.b - ca.b) * w,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/** WCAG 2.1 relative luminance. */
|
|
126
|
+
export function relativeLuminance(hex) {
|
|
127
|
+
const { r, g, b } = hexToRgb(hex);
|
|
128
|
+
const channel = (v) => {
|
|
129
|
+
const c = v / 255;
|
|
130
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
131
|
+
};
|
|
132
|
+
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
133
|
+
}
|
|
134
|
+
/** WCAG 2.1 contrast ratio, 1–21. AA body text needs >= 4.5. */
|
|
135
|
+
export function contrastRatio(a, b) {
|
|
136
|
+
const la = relativeLuminance(a);
|
|
137
|
+
const lb = relativeLuminance(b);
|
|
138
|
+
const light = Math.max(la, lb);
|
|
139
|
+
const dark = Math.min(la, lb);
|
|
140
|
+
return (light + 0.05) / (dark + 0.05);
|
|
141
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, withLightness } from "./color";
|
|
2
|
+
import { isDarkCanvas } from "./accentText";
|
|
3
|
+
/**
|
|
4
|
+
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
5
|
+
* all — same value the SideBar ladder, Accordion, and NavigationBar hover states are held to.
|
|
6
|
+
* A "hover" a user cannot perceive is not a hover.
|
|
7
|
+
*/
|
|
8
|
+
export const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
9
|
+
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
10
|
+
export const AA_NON_TEXT = 3;
|
|
11
|
+
/**
|
|
12
|
+
* Walks a hex toward `target` contrast against `backdrop`, keeping its hue and saturation so the
|
|
13
|
+
* result still reads as the same colour. Darkens when `mode` is light, lightens when dark, and
|
|
14
|
+
* stops at the FIRST passing step so nothing overshoots to black or white.
|
|
15
|
+
*/
|
|
16
|
+
export function liftToContrast(hex, backdrop, mode, target = AA_NON_TEXT) {
|
|
17
|
+
if (contrastRatio(hex, backdrop) >= target)
|
|
18
|
+
return hex;
|
|
19
|
+
const { s } = hexToHsl(hex);
|
|
20
|
+
const step = mode === "dark" ? 1 : -1;
|
|
21
|
+
let { l } = hexToHsl(hex);
|
|
22
|
+
while (l > 0 && l < 100) {
|
|
23
|
+
l += step;
|
|
24
|
+
const next = withLightness(hex, l, s);
|
|
25
|
+
if (contrastRatio(next, backdrop) >= target)
|
|
26
|
+
return next;
|
|
27
|
+
}
|
|
28
|
+
return withLightness(hex, mode === "dark" ? 100 : 0, s);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
32
|
+
* pickers, the editor's inputs). It was authored as a decorative value — measured 1.30-2.56:1
|
|
33
|
+
* across brands, so those controls rendered effectively borderless in BOTH modes. Resolved here
|
|
34
|
+
* rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
35
|
+
*
|
|
36
|
+
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
37
|
+
* and outside 1.4.11.
|
|
38
|
+
*/
|
|
39
|
+
export function withOutlineRung(palette, mode) {
|
|
40
|
+
const current = palette.boxborder[500];
|
|
41
|
+
// The border sits between the control's fill and the surface behind it; hold it to the
|
|
42
|
+
// harder of the two.
|
|
43
|
+
const backdrop = contrastRatio(current, palette.backgroundColor.main) <=
|
|
44
|
+
contrastRatio(current, palette.background[50])
|
|
45
|
+
? palette.backgroundColor.main
|
|
46
|
+
: palette.background[50];
|
|
47
|
+
const resolved = liftToContrast(current, backdrop, mode);
|
|
48
|
+
if (resolved === current)
|
|
49
|
+
return palette;
|
|
50
|
+
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A hover/active tint resolved against the surface it actually sits on, guaranteed to clear
|
|
54
|
+
* `MIN_PERCEPTIBLE_STEP`. Written for the recurring shape found across NavigationBar, UserDetails
|
|
55
|
+
* and Accordion: a pale `primary[50]`/`gray[50]` tint that measures near-1.0 on a near-white
|
|
56
|
+
* surface — invisible — with no dark-mode branch, so the same call site is wrong in both modes at
|
|
57
|
+
* once. `restSurface` is required rather than assumed white/black: a menu item's hover sits on
|
|
58
|
+
* its OWN list background, not necessarily the page canvas.
|
|
59
|
+
*/
|
|
60
|
+
export function resolveHoverTint(seed, restSurface) {
|
|
61
|
+
const mode = isDarkCanvas(restSurface) ? "dark" : "light";
|
|
62
|
+
return liftToContrast(seed, restSurface, mode, MIN_PERCEPTIBLE_STEP);
|
|
63
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { contrastRatio } from "./color";
|
|
2
|
+
import { AA_NORMAL_TEXT } from "./accentText";
|
|
3
|
+
import { AA_NON_TEXT, liftToContrast } from "./outlineRung";
|
|
4
|
+
/**
|
|
5
|
+
* Status chips (open / in-progress / resolved …) were authored as `X.500` text on an `X.100`
|
|
6
|
+
* tint, which measures 3.3-4.4:1 — under the 4.5:1 body-text bar in BOTH modes. The ink is
|
|
7
|
+
* resolved from the scale's own hue instead of pinned, so every brand and both modes land on the
|
|
8
|
+
* lightest ink that still passes rather than a hand-copied hex that goes stale.
|
|
9
|
+
*
|
|
10
|
+
* `reverseScale` flips the utility ramps in dark, so `X.100` is already a dark tint there and the
|
|
11
|
+
* ink walks lighter instead of darker — hence the mode argument.
|
|
12
|
+
*/
|
|
13
|
+
export function resolveStatusTone(scale, mode) {
|
|
14
|
+
const bg = scale[100];
|
|
15
|
+
const inkSeed = mode === "dark" ? scale[300] : scale[700];
|
|
16
|
+
const edgeSeed = mode === "dark" ? scale[400] : scale[300];
|
|
17
|
+
return {
|
|
18
|
+
bg,
|
|
19
|
+
fg: liftToContrast(inkSeed, bg, mode, AA_NORMAL_TEXT),
|
|
20
|
+
border: liftToContrast(edgeSeed, bg, mode, AA_NON_TEXT),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Avatar initials are drawn white on a generated fill. The seed hues in use measured 1.92:1
|
|
25
|
+
* (`#eab308`), 2.54:1 (`#10b981`) and 3.76:1 (`#ef4444`) — failing in light mode too, not just
|
|
26
|
+
* dark. Darkening the fill keeps the intended hue and the white-initials look while clearing AA.
|
|
27
|
+
*/
|
|
28
|
+
export function resolveAvatarFill(hex, target = AA_NORMAL_TEXT) {
|
|
29
|
+
// "light" walks downward in lightness — i.e. darken until white ink clears the bar.
|
|
30
|
+
return liftToContrast(hex, "#ffffff", "light", target);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Hue set for generated avatars. Values are seeds, not final fills — always pass them through
|
|
34
|
+
* `resolveAvatarFill` so the white initials stay legible.
|
|
35
|
+
*/
|
|
36
|
+
export const AVATAR_SEEDS = [
|
|
37
|
+
"#ef4444",
|
|
38
|
+
"#f97316",
|
|
39
|
+
"#eab308",
|
|
40
|
+
"#22c55e",
|
|
41
|
+
"#10b981",
|
|
42
|
+
"#06b6d4",
|
|
43
|
+
"#3b82f6",
|
|
44
|
+
"#8b5cf6",
|
|
45
|
+
"#ec4899",
|
|
46
|
+
];
|
|
47
|
+
/** Stable per-name avatar fill: same name always yields the same accessible colour. */
|
|
48
|
+
export function avatarFillFor(seedText) {
|
|
49
|
+
let hash = 0;
|
|
50
|
+
for (let i = 0; i < seedText.length; i++) {
|
|
51
|
+
hash = (hash * 31 + seedText.charCodeAt(i)) >>> 0;
|
|
52
|
+
}
|
|
53
|
+
return resolveAvatarFill(AVATAR_SEEDS[hash % AVATAR_SEEDS.length]);
|
|
54
|
+
}
|
|
55
|
+
/** True when `fg` clears the body-text bar on `bg` — exported for consumer assertions. */
|
|
56
|
+
export const meetsBodyText = (fg, bg) => contrastRatio(fg, bg) >= AA_NORMAL_TEXT;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pixelize design tokens — the portable core of the design system.
|
|
3
|
+
*
|
|
4
|
+
* PURITY CONTRACT: nothing in this folder imports Chakra, React, or CSS. It is plain
|
|
5
|
+
* TypeScript data + pure functions, so the mobile design library can consume this
|
|
6
|
+
* folder as-is. Keep it that way — a single Chakra/CSS import here breaks the mobile port.
|
|
7
|
+
*
|
|
8
|
+
* Web-only concerns (Chakra `extendTheme`, `cssVarPrefix`, the Inter font-face CSS import)
|
|
9
|
+
* live in `Theme/chakra/` instead.
|
|
10
|
+
*/
|
|
11
|
+
export * from "./types";
|
|
12
|
+
export * from "./primitives";
|
|
13
|
+
export * from "./brands";
|
|
14
|
+
export * from "./builders";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as space } from "./space";
|
|
2
|
+
export { default as sizes } from "./sizes";
|
|
3
|
+
export { default as radii } from "./radii";
|
|
4
|
+
export { default as shadows } from "./shadows";
|
|
5
|
+
export { default as zIndices } from "./zIndices";
|
|
6
|
+
export { default as breakpoints } from "./breakpoints";
|
|
7
|
+
export { default as lineHeights } from "./lineHeights";
|
|
8
|
+
export { default as letterSpacings } from "./letterSpacings";
|
|
9
|
+
export { default as typography, fonts, fontSizes, fontWeights } from "./typography";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const lineHeights = {
|
|
2
|
+
normal: "normal",
|
|
3
|
+
none: 1,
|
|
4
|
+
shorter: 1.25,
|
|
5
|
+
short: 1.375,
|
|
6
|
+
base: 1.5,
|
|
7
|
+
tall: 1.625,
|
|
8
|
+
taller: "2",
|
|
9
|
+
"3": ".75rem",
|
|
10
|
+
"4": "1rem",
|
|
11
|
+
"5": "1.25rem",
|
|
12
|
+
"6": "1.5rem",
|
|
13
|
+
"7": "1.75rem",
|
|
14
|
+
"8": "2rem",
|
|
15
|
+
"9": "2.25rem",
|
|
16
|
+
"10": "2.5rem",
|
|
17
|
+
};
|
|
18
|
+
export default lineHeights;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Light-mode shadow ramp. Dark mode deepens these — see `builders/buildDarkShadows`. */
|
|
2
|
+
const shadows = {
|
|
3
|
+
xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
|
|
4
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
5
|
+
base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
6
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
|
7
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
8
|
+
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
|
|
9
|
+
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
10
|
+
outline: "0 0 0 3px rgba(66, 153, 225, 0.6)",
|
|
11
|
+
inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)",
|
|
12
|
+
none: "none",
|
|
13
|
+
darkLg: "0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5)",
|
|
14
|
+
};
|
|
15
|
+
export default shadows;
|