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,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Icon, Popover, PopoverTrigger, PopoverContent, PopoverBody, Badge, Collapse, Portal, } from "@chakra-ui/react";
|
|
3
|
+
import MenuPopoverContent from "./MenuPopoverContent";
|
|
4
|
+
import { ChevronDown, ChevronRight, LockKeyhole } from "lucide-react";
|
|
5
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme";
|
|
6
|
+
import { isDarkCanvas } from "../../../Theme/tokens/builders/accentText";
|
|
7
|
+
import { useSidebarActiveAccent } from "../sidebarAccentColors";
|
|
8
|
+
import TruncatedTextWithTooltip from "./TextTruncation";
|
|
9
|
+
/**
|
|
10
|
+
* These rows are real `<a href>`s now, so the browser's own gestures have to keep working —
|
|
11
|
+
* cmd/ctrl-click for a new tab, shift for a window, middle-click. Only a plain left click is
|
|
12
|
+
* routed through the in-app handler.
|
|
13
|
+
*/
|
|
14
|
+
const isBrowserNavigationGesture = (e) => e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
|
|
15
|
+
const MenuItemBox = ({ menu, activeMenu, toggle, handleClick, isOpen, onToggle, }) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
17
|
+
const theme = useCustomTheme();
|
|
18
|
+
const isDark = isDarkCanvas((_b = (_a = theme.colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : "#ffffff");
|
|
19
|
+
const activeAccent = useSidebarActiveAccent(theme.colors, isDark);
|
|
20
|
+
const { title, icon, disabled, locked, badge, subMenu, url } = menu;
|
|
21
|
+
const hasSubMenu = !!(subMenu === null || subMenu === void 0 ? void 0 : subMenu.length);
|
|
22
|
+
const submenuPanelId = `submenu-${String((_c = menu.id) !== null && _c !== void 0 ? _c : title)}`;
|
|
23
|
+
// A submenu parent only expands, so it is a button; every other row navigates.
|
|
24
|
+
// Cast: Chakra narrows `as` unions to their *shared* props, which drops `href`.
|
|
25
|
+
const rowAs = (hasSubMenu ? "button" : "a");
|
|
26
|
+
const badgeConfig = typeof badge === "object" && badge !== null ? badge : null;
|
|
27
|
+
const badgeValue = (_d = badgeConfig === null || badgeConfig === void 0 ? void 0 : badgeConfig.count) !== null && _d !== void 0 ? _d : (typeof badge !== "object" ? badge : undefined);
|
|
28
|
+
const hasSubmenuBadge = (_e = subMenu === null || subMenu === void 0 ? void 0 : subMenu.some((sub) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const subCfg = typeof sub.badge === "object" && sub.badge !== null
|
|
31
|
+
? sub.badge
|
|
32
|
+
: null;
|
|
33
|
+
const value = (_a = subCfg === null || subCfg === void 0 ? void 0 : subCfg.count) !== null && _a !== void 0 ? _a : (typeof sub.badge !== "object" ? sub.badge : undefined);
|
|
34
|
+
return value != null;
|
|
35
|
+
})) !== null && _e !== void 0 ? _e : false;
|
|
36
|
+
const isChildActive = subMenu === null || subMenu === void 0 ? void 0 : subMenu.some((sub) => sub.id === activeMenu);
|
|
37
|
+
const isParentActive = activeMenu === menu.id;
|
|
38
|
+
const isAnyActive = isParentActive || isChildActive;
|
|
39
|
+
const handleToggleSubMenu = (e) => {
|
|
40
|
+
if (!disabled && hasSubMenu) {
|
|
41
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(menu, e === null || e === void 0 ? void 0 : e.clientY);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!disabled)
|
|
45
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(menu);
|
|
46
|
+
};
|
|
47
|
+
// Pill-style nav item. The fill is a white overlay, not a brand tint: the sidebar is a
|
|
48
|
+
// near-black surface in BOTH modes, and a `primary.opacity` tint of a dark accent on it is
|
|
49
|
+
// imperceptible for most brands (measured 1.03-1.15 idle->hover) and exactly 1.000 for zinc
|
|
50
|
+
// light, whose primary[500] IS the sidebar colour. Brand identity stays in the accent bar
|
|
51
|
+
// and icon below. See interactionStates.test.ts.
|
|
52
|
+
const commonStyles = {
|
|
53
|
+
// `data-group` rather than `role="group"`: the row is now a real link/button, whose
|
|
54
|
+
// implicit role must not be overridden. Chakra's `_groupHover` accepts either.
|
|
55
|
+
"data-group": "",
|
|
56
|
+
display: "block",
|
|
57
|
+
textAlign: "left",
|
|
58
|
+
textDecoration: "none",
|
|
59
|
+
w: "100%",
|
|
60
|
+
borderRadius: "7px",
|
|
61
|
+
px: "10px",
|
|
62
|
+
py: "7px",
|
|
63
|
+
fontWeight: "medium",
|
|
64
|
+
border: "none",
|
|
65
|
+
borderLeft: "2px solid",
|
|
66
|
+
borderLeftColor: isAnyActive ? theme.colors.primary[500] : "transparent",
|
|
67
|
+
backgroundColor: isAnyActive ? "whiteAlpha.300" : "transparent",
|
|
68
|
+
color: disabled ? "whiteAlpha.400" : "whiteAlpha.700",
|
|
69
|
+
_hover: disabled
|
|
70
|
+
? {}
|
|
71
|
+
: {
|
|
72
|
+
backgroundColor: isAnyActive ? "whiteAlpha.400" : "whiteAlpha.200",
|
|
73
|
+
},
|
|
74
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
75
|
+
opacity: disabled ? 0.6 : 1,
|
|
76
|
+
transition: "background 0.12s",
|
|
77
|
+
};
|
|
78
|
+
const buttonContent = (_jsxs(Flex, { align: "center", gap: "9px", justify: toggle ? "center" : "space-between", children: [_jsxs(Flex, { align: "center", gap: "9px", overflow: "hidden", children: [_jsxs(Box, { position: "relative", display: "flex", alignItems: "center", children: [_jsx(Icon, { as: icon, fontSize: "1rem", verticalAlign: "middle", color: isAnyActive ? activeAccent.icon : "whiteAlpha.800", _groupHover: isAnyActive ? undefined : { color: "white" }, transition: "color 0.12s" }), toggle && (badgeValue != null || hasSubmenuBadge) && (_jsx(Box, { position: "absolute", top: "0", right: "0", w: "0.375rem", h: "0.375rem", borderRadius: "full", bg: theme.colors.red[400] }))] }), !toggle && (_jsx(TruncatedTextWithTooltip
|
|
79
|
+
// open={isOpen}
|
|
80
|
+
, {
|
|
81
|
+
// open={isOpen}
|
|
82
|
+
fontSize: "13px", lineHeight: "1", flex: "1", color: isAnyActive ? activeAccent.label : "whiteAlpha.900", fontWeight: isAnyActive ? 600 : 500, _groupHover: isAnyActive ? undefined : { color: "white" }, children: title }))] }), !toggle && (_jsxs(Flex, { align: "center", gap: "0.375rem", children: [(() => {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
const value = badgeValue;
|
|
85
|
+
const colorScheme = (_a = badgeConfig === null || badgeConfig === void 0 ? void 0 : badgeConfig.color) !== null && _a !== void 0 ? _a : "teal";
|
|
86
|
+
const radius = (_b = badgeConfig === null || badgeConfig === void 0 ? void 0 : badgeConfig.radius) !== null && _b !== void 0 ? _b : "full";
|
|
87
|
+
const variant = (_c = badgeConfig === null || badgeConfig === void 0 ? void 0 : badgeConfig.variant) !== null && _c !== void 0 ? _c : "subtle";
|
|
88
|
+
return value != null ? (_jsx(Badge, { colorScheme: colorScheme, fontSize: "0.625rem", variant: variant, borderRadius: radius, children: value })) : null;
|
|
89
|
+
})(), locked && _jsx(Icon, { as: LockKeyhole, fontSize: "1rem", color: "whiteAlpha.600" }), hasSubMenu && (_jsx(Icon, { as: isOpen ? ChevronDown : ChevronRight, fontSize: "1rem", color: "whiteAlpha.400" }))] }))] }));
|
|
90
|
+
if (toggle) {
|
|
91
|
+
// Collapsed sidebar: show Popover
|
|
92
|
+
return (_jsxs(Popover, { trigger: "hover", placement: "right-start", closeOnBlur: false, isLazy: true, children: [_jsx(PopoverTrigger, { children: _jsx(Box, { ...commonStyles, as: rowAs, type: hasSubMenu ? "button" : undefined, href: hasSubMenu ? undefined : url !== null && url !== void 0 ? url : "#", "aria-label": title, "aria-current": isAnyActive ? "page" : undefined, "aria-disabled": disabled ? true : undefined, onClick: (e) => {
|
|
93
|
+
if (!hasSubMenu && url && isBrowserNavigationGesture(e))
|
|
94
|
+
return;
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
handleToggleSubMenu(e);
|
|
97
|
+
}, "data-menu-id": String((_f = menu.id) !== null && _f !== void 0 ? _f : title), children: buttonContent }) }), _jsx(Portal, { children: _jsx(PopoverContent, { borderRadius: "0.5rem", bg: theme.colors.sidebar.background[200], boxShadow: "lg", minW: "10rem", maxW: "14rem", py: "0.125rem", ml: "-0.5rem", border: 'none', cursor: disabled ? "not-allowed" : "pointer", zIndex: 1500, children: _jsx(PopoverBody, { p: "0.625rem", color: "white", children: _jsx(MenuPopoverContent, { menu: menu, handleMenuClick: handleClick, activeMenu: activeMenu }) }) }) })] }));
|
|
98
|
+
}
|
|
99
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { ...commonStyles, as: rowAs, type: hasSubMenu ? "button" : undefined, href: hasSubMenu ? undefined : url !== null && url !== void 0 ? url : "#", "aria-expanded": hasSubMenu ? !!isOpen : undefined, "aria-controls": hasSubMenu ? submenuPanelId : undefined, "aria-current": isAnyActive ? "page" : undefined, "aria-disabled": disabled ? true : undefined, onClick: (e) => {
|
|
100
|
+
if (!hasSubMenu && url && isBrowserNavigationGesture(e))
|
|
101
|
+
return;
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
handleToggleSubMenu(e);
|
|
104
|
+
}, "data-menu-id": String((_g = menu.id) !== null && _g !== void 0 ? _g : title), children: buttonContent }), hasSubMenu && (_jsx(Collapse, { in: isOpen, animateOpacity: true, children: _jsx(Box, { id: submenuPanelId, "data-collapse": "true", "data-menu-id": String((_h = menu.id) !== null && _h !== void 0 ? _h : title), "data-open": isOpen ? "true" : "false", mt: "0.125rem", sx: {
|
|
105
|
+
transition: "opacity 0.28s ease, transform 0.28s ease",
|
|
106
|
+
opacity: isOpen ? 1 : 0,
|
|
107
|
+
transform: isOpen ? "translateY(0)" : "translateY(-6px)",
|
|
108
|
+
}, children: subMenu.map((sub, sIdx) => {
|
|
109
|
+
var _a, _b, _c;
|
|
110
|
+
const isSubActive = activeMenu === sub.id;
|
|
111
|
+
return (_jsxs(Box, { as: "a", href: (_a = sub.url) !== null && _a !== void 0 ? _a : "#", "data-group": "", "aria-current": isSubActive ? "page" : undefined, "aria-disabled": sub.disabled ? true : undefined, textDecoration: "none", py: "5px", pl: "30px", pr: "10px", borderRadius: "6px", fontSize: "11.5px", backgroundColor: "transparent", _hover: { backgroundColor: "whiteAlpha.100" }, opacity: sub.disabled ? 0.6 : 1, cursor: sub.disabled ? "not-allowed" : "pointer", pointerEvents: sub.disabled ? "none" : "auto", onClick: (e) => {
|
|
112
|
+
if (sub.url && isBrowserNavigationGesture(e))
|
|
113
|
+
return;
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
if (!sub.disabled)
|
|
116
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(sub);
|
|
117
|
+
}, display: "flex", alignItems: "center", justifyContent: "space-between", gap: "0.5rem", transition: "background 0.12s", children: [_jsxs(Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [sub.icon ? (_jsx(Icon, { as: sub.icon, fontSize: "0.95rem", flexShrink: 0, color: isSubActive ? activeAccent.icon : "whiteAlpha.800", _groupHover: isSubActive ? undefined : { color: "white" }, transition: "color 0.12s" })) : (_jsx(Box, { w: "5px", h: "5px", borderRadius: "full", flexShrink: 0, bg: isSubActive ? activeAccent.icon : "whiteAlpha.500", _groupHover: isSubActive ? undefined : { bg: "whiteAlpha.700" }, transition: "background 0.12s" })), _jsx(TruncatedTextWithTooltip, { fontSize: "12px", fontWeight: isSubActive ? 600 : 500, lineHeight: "1",
|
|
118
|
+
// open={isOpen}
|
|
119
|
+
color: isSubActive ? "whiteAlpha.900" : "whiteAlpha.800", _groupHover: isSubActive ? undefined : { color: "white" }, children: sub.title })] }), sub.locked ? (_jsx(Icon, { as: LockKeyhole, fontSize: "1rem", color: "whiteAlpha.600" })) : (() => {
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
|
+
const subCfg = typeof sub.badge === "object" && sub.badge !== null
|
|
122
|
+
? sub.badge
|
|
123
|
+
: null;
|
|
124
|
+
const value = (_a = subCfg === null || subCfg === void 0 ? void 0 : subCfg.count) !== null && _a !== void 0 ? _a : (typeof sub.badge !== "object" ? sub.badge : undefined);
|
|
125
|
+
const colorScheme = (_b = subCfg === null || subCfg === void 0 ? void 0 : subCfg.color) !== null && _b !== void 0 ? _b : "teal";
|
|
126
|
+
const radius = (_c = subCfg === null || subCfg === void 0 ? void 0 : subCfg.radius) !== null && _c !== void 0 ? _c : "full";
|
|
127
|
+
const variant = (_d = subCfg === null || subCfg === void 0 ? void 0 : subCfg.variant) !== null && _d !== void 0 ? _d : "subtle";
|
|
128
|
+
return value != null ? (_jsx(Badge, { colorScheme: colorScheme, fontSize: "0.625rem", variant: variant, borderRadius: radius, children: value })) : null;
|
|
129
|
+
})()] }, `${String((_c = (_b = sub.id) !== null && _b !== void 0 ? _b : sub.title) !== null && _c !== void 0 ? _c : sIdx)}-${sIdx}`));
|
|
130
|
+
}) }) }))] }));
|
|
131
|
+
};
|
|
132
|
+
export default MenuItemBox;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { Box } from "@chakra-ui/react";
|
|
4
|
+
import MenuItemBox from "./MenuItemBox";
|
|
5
|
+
const MenuItems = ({ menus, activeMenu, handleMenuClick, toggle, selectedSubMenu, }) => {
|
|
6
|
+
const [openMenuId, setOpenMenuId] = useState(null);
|
|
7
|
+
const [lastClickY, setLastClickY] = useState(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const parent = menus.find((m) => { var _a; return (_a = m.subMenu) === null || _a === void 0 ? void 0 : _a.some((s) => s.id === activeMenu); });
|
|
10
|
+
if (parent) {
|
|
11
|
+
setOpenMenuId(parent.id);
|
|
12
|
+
}
|
|
13
|
+
else if (menus.some((m) => m.id === activeMenu)) {
|
|
14
|
+
setOpenMenuId(activeMenu);
|
|
15
|
+
}
|
|
16
|
+
}, [activeMenu, menus]);
|
|
17
|
+
const handleToggle = (menu, clickY) => {
|
|
18
|
+
setOpenMenuId((prev) => (prev === menu.id ? null : menu.id));
|
|
19
|
+
if (typeof clickY === "number")
|
|
20
|
+
setLastClickY(clickY);
|
|
21
|
+
};
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (openMenuId == null)
|
|
24
|
+
return;
|
|
25
|
+
const container = document.getElementById("sidebar-scroll-container");
|
|
26
|
+
if (!container)
|
|
27
|
+
return;
|
|
28
|
+
const collapse = container.querySelector(`[data-collapse="true"][data-menu-id="${openMenuId}"][data-open="true"]`);
|
|
29
|
+
const header = container.querySelector(`[data-menu-id="${openMenuId}"]`);
|
|
30
|
+
if (!collapse)
|
|
31
|
+
return;
|
|
32
|
+
const cRect = container.getBoundingClientRect();
|
|
33
|
+
const tRect = collapse.getBoundingClientRect();
|
|
34
|
+
const hRect = header === null || header === void 0 ? void 0 : header.getBoundingClientRect();
|
|
35
|
+
const topGap = 16;
|
|
36
|
+
const bottomGap = 16;
|
|
37
|
+
if (lastClickY != null) {
|
|
38
|
+
if (hRect) {
|
|
39
|
+
const toTop = container.scrollTop + (hRect.top - cRect.top) - topGap;
|
|
40
|
+
container.scrollTo({
|
|
41
|
+
top: Math.max(toTop, 0),
|
|
42
|
+
behavior: "smooth",
|
|
43
|
+
});
|
|
44
|
+
requestAnimationFrame(() => {
|
|
45
|
+
const ncRect = container.getBoundingClientRect();
|
|
46
|
+
const ntRect = collapse.getBoundingClientRect();
|
|
47
|
+
if (ntRect.bottom > ncRect.bottom - bottomGap) {
|
|
48
|
+
container.scrollTo({
|
|
49
|
+
top: container.scrollTop +
|
|
50
|
+
(ntRect.bottom - (ncRect.bottom - bottomGap)),
|
|
51
|
+
behavior: "smooth",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const delta = tRect.bottom - lastClickY;
|
|
58
|
+
if (delta > 0) {
|
|
59
|
+
container.scrollTo({
|
|
60
|
+
top: container.scrollTop + delta + bottomGap,
|
|
61
|
+
behavior: "smooth",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (hRect) {
|
|
68
|
+
container.scrollTo({
|
|
69
|
+
top: container.scrollTop + (hRect.top - cRect.top) - topGap,
|
|
70
|
+
behavior: "smooth",
|
|
71
|
+
});
|
|
72
|
+
requestAnimationFrame(() => {
|
|
73
|
+
const ncRect = container.getBoundingClientRect();
|
|
74
|
+
const ntRect = collapse.getBoundingClientRect();
|
|
75
|
+
if (ntRect.bottom > ncRect.bottom - bottomGap) {
|
|
76
|
+
container.scrollTo({
|
|
77
|
+
top: container.scrollTop +
|
|
78
|
+
(ntRect.bottom - (ncRect.bottom - bottomGap)),
|
|
79
|
+
behavior: "smooth",
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else if (tRect.bottom > cRect.bottom) {
|
|
85
|
+
container.scrollTo({
|
|
86
|
+
top: container.scrollTop + (tRect.bottom - cRect.bottom) + bottomGap,
|
|
87
|
+
behavior: "smooth",
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else if (tRect.top < cRect.top) {
|
|
91
|
+
container.scrollTo({
|
|
92
|
+
top: container.scrollTop - (cRect.top - tRect.top) - topGap,
|
|
93
|
+
behavior: "smooth",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, [openMenuId, lastClickY]);
|
|
98
|
+
// Derive section labels from the optional `group` field on menu items: a label
|
|
99
|
+
// is rendered the first time a new group value appears, with a divider before
|
|
100
|
+
// every group after the first (the label hides when collapsed, the divider stays).
|
|
101
|
+
let lastGroup;
|
|
102
|
+
let groupCount = 0;
|
|
103
|
+
return (_jsx(Box, { display: "flex", flexDirection: "column", gap: "2px", children: menus.map((menu, idx) => {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
const showGroup = !!menu.group && menu.group !== lastGroup;
|
|
106
|
+
const isFirstGroup = showGroup && groupCount === 0;
|
|
107
|
+
if (showGroup) {
|
|
108
|
+
lastGroup = menu.group;
|
|
109
|
+
groupCount += 1;
|
|
110
|
+
}
|
|
111
|
+
return (_jsxs(React.Fragment, { children: [showGroup && !isFirstGroup && (_jsx(Box, { h: "1px", bg: "whiteAlpha.100", mx: "8px", my: "5px" })), showGroup && !toggle && (_jsx(Box, { "aria-hidden": "true", px: "10px", pt: "10px", pb: "3px", fontSize: "9.5px", fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.1em", color: "whiteAlpha.600", whiteSpace: "nowrap", overflow: "hidden", children: menu.group })), _jsx(MenuItemBox, { menu: menu, activeMenu: activeMenu, toggle: toggle, handleClick: handleMenuClick, selectedSubMenu: selectedSubMenu, isOpen: openMenuId === menu.id, onToggle: handleToggle })] }, `${String((_c = (_b = (_a = menu.id) !== null && _a !== void 0 ? _a : menu.url) !== null && _b !== void 0 ? _b : menu.title) !== null && _c !== void 0 ? _c : idx)}-${idx}`));
|
|
112
|
+
}) }));
|
|
113
|
+
};
|
|
114
|
+
export default MenuItems;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Icon, Flex, Badge } from "@chakra-ui/react";
|
|
3
|
+
import { LockKeyhole } from "lucide-react";
|
|
4
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme";
|
|
5
|
+
import { isDarkCanvas } from "../../../Theme/tokens/builders/accentText";
|
|
6
|
+
import { useSidebarActiveAccent } from "../sidebarAccentColors";
|
|
7
|
+
import TruncatedTextWithTooltip from "./TextTruncation";
|
|
8
|
+
const MenuPopoverContent = ({ menu, handleMenuClick, activeMenu, }) => {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
const theme = useCustomTheme();
|
|
11
|
+
const isDark = isDarkCanvas((_b = (_a = theme.colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : "#ffffff");
|
|
12
|
+
const activeAccent = useSidebarActiveAccent(theme.colors, isDark);
|
|
13
|
+
const { title, icon, subMenu, badge, locked } = menu;
|
|
14
|
+
const hasSubMenu = !!(subMenu === null || subMenu === void 0 ? void 0 : subMenu.length);
|
|
15
|
+
const isParentActive = activeMenu === menu.id;
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: (hasSubMenu ? "div" : "a"), href: hasSubMenu ? undefined : (_c = menu.url) !== null && _c !== void 0 ? _c : "#", "aria-current": !hasSubMenu && isParentActive ? "page" : undefined, textDecoration: "none", align: "center", gap: "8px", px: "8px", py: hasSubMenu ? "6px" : "8px", mb: hasSubMenu ? "4px" : 0, borderBottom: hasSubMenu ? "1px solid" : undefined, borderColor: hasSubMenu ? "whiteAlpha.100" : undefined, borderRadius: hasSubMenu ? 0 : "7px", bg: !hasSubMenu && isParentActive ? theme.colors.primary.opacity[16] : "transparent", _hover: !hasSubMenu ? { bg: "whiteAlpha.100" } : undefined, onClick: (e) => {
|
|
17
|
+
if (!hasSubMenu) {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
handleMenuClick === null || handleMenuClick === void 0 ? void 0 : handleMenuClick(menu);
|
|
20
|
+
}
|
|
21
|
+
}, cursor: !hasSubMenu ? "pointer" : "default", children: [_jsx(Icon, { as: icon, fontSize: "1rem", flexShrink: 0, color: !hasSubMenu && isParentActive ? activeAccent.icon : "whiteAlpha.700" }), _jsx(TruncatedTextWithTooltip, { fontWeight: 600, fontSize: "13px", flex: "1", color: "whiteAlpha.900", children: title }), (() => {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
const cfg = typeof badge === "object" && badge !== null
|
|
24
|
+
? badge
|
|
25
|
+
: null;
|
|
26
|
+
const value = (_a = cfg === null || cfg === void 0 ? void 0 : cfg.count) !== null && _a !== void 0 ? _a : (typeof badge !== "object" ? badge : undefined);
|
|
27
|
+
const colorScheme = (_b = cfg === null || cfg === void 0 ? void 0 : cfg.color) !== null && _b !== void 0 ? _b : "teal";
|
|
28
|
+
const radius = (_c = cfg === null || cfg === void 0 ? void 0 : cfg.radius) !== null && _c !== void 0 ? _c : "full";
|
|
29
|
+
const variant = (_d = cfg === null || cfg === void 0 ? void 0 : cfg.variant) !== null && _d !== void 0 ? _d : "subtle";
|
|
30
|
+
return value != null ? (_jsx(Badge, { colorScheme: colorScheme, fontSize: "0.625rem", variant: variant, borderRadius: radius, children: value })) : null;
|
|
31
|
+
})(), locked && _jsx(Icon, { as: LockKeyhole, fontSize: "1rem", color: "whiteAlpha.600" })] }), subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((sub) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const isSubActive = activeMenu === sub.id;
|
|
34
|
+
return (_jsxs(Flex, { as: "a", href: (_a = sub.url) !== null && _a !== void 0 ? _a : "#", "data-group": "", "aria-current": isSubActive ? "page" : undefined, "aria-disabled": sub.disabled ? true : undefined, textDecoration: "none", onClick: (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
if (!sub.disabled)
|
|
37
|
+
handleMenuClick === null || handleMenuClick === void 0 ? void 0 : handleMenuClick(sub);
|
|
38
|
+
}, px: "8px", py: "7px", mb: "2px", borderRadius: "7px", align: "center", justify: "space-between", gap: "8px", borderLeft: "2px solid", borderLeftColor: isSubActive ? theme.colors.primary[500] : "transparent", bg: isSubActive ? theme.colors.primary.opacity[16] : "transparent", _hover: {
|
|
39
|
+
bg: !sub.disabled ? "whiteAlpha.100" : "transparent",
|
|
40
|
+
cursor: !sub.disabled ? "pointer" : "not-allowed",
|
|
41
|
+
}, opacity: sub.disabled ? 0.5 : 1, pointerEvents: sub.disabled ? "none" : "auto", transition: "background 0.12s", children: [_jsxs(Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [_jsx(Icon, { as: sub.icon, fontSize: "0.95rem", flexShrink: 0, color: isSubActive ? activeAccent.icon : "whiteAlpha.800", _groupHover: isSubActive ? undefined : { color: "white" }, transition: "color 0.12s" }), _jsx(TruncatedTextWithTooltip, { fontSize: "12.5px", fontWeight: isSubActive ? 600 : 500, flex: 1, color: isSubActive ? activeAccent.label : "whiteAlpha.900", _groupHover: isSubActive ? undefined : { color: "white" }, children: sub.title })] }), sub.locked ? (_jsx(Icon, { as: LockKeyhole, fontSize: "1rem", color: "whiteAlpha.600" })) : (() => {
|
|
42
|
+
var _a, _b, _c, _d;
|
|
43
|
+
const cfg = typeof sub.badge === "object" && sub.badge !== null
|
|
44
|
+
? sub.badge
|
|
45
|
+
: null;
|
|
46
|
+
const value = (_a = cfg === null || cfg === void 0 ? void 0 : cfg.count) !== null && _a !== void 0 ? _a : (typeof sub.badge !== "object" ? sub.badge : undefined);
|
|
47
|
+
const colorScheme = (_b = cfg === null || cfg === void 0 ? void 0 : cfg.color) !== null && _b !== void 0 ? _b : "teal";
|
|
48
|
+
const radius = (_c = cfg === null || cfg === void 0 ? void 0 : cfg.radius) !== null && _c !== void 0 ? _c : "full";
|
|
49
|
+
const variant = (_d = cfg === null || cfg === void 0 ? void 0 : cfg.variant) !== null && _d !== void 0 ? _d : "subtle";
|
|
50
|
+
return value != null ? (_jsx(Badge, { colorScheme: colorScheme, fontSize: "0.625rem", variant: variant, borderRadius: radius, children: value })) : null;
|
|
51
|
+
})()] }, sub.id || sub.title));
|
|
52
|
+
})] }));
|
|
53
|
+
};
|
|
54
|
+
export default MenuPopoverContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Text, Popover, PopoverTrigger, PopoverContent, PopoverBody, Portal, } from "@chakra-ui/react";
|
|
3
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme";
|
|
4
|
+
const OtherApps = ({ toggle, otherApps }) => {
|
|
5
|
+
const theme = useCustomTheme();
|
|
6
|
+
if (!otherApps || otherApps.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
const appIcon = (app) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return (_jsx(Box, { display: "flex", alignItems: "center", justifyContent: "center", color: "whiteAlpha.500", fontSize: "15px", flexShrink: 0, children: (_a = app.icon) !== null && _a !== void 0 ? _a : (_jsx(Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, boxShadow: `0 0 5px ${app.color}`, flexShrink: 0 })) }));
|
|
11
|
+
};
|
|
12
|
+
// Grid cell: icon on top, truncated label below (label hidden when collapsed).
|
|
13
|
+
const appCell = (app) => (_jsxs(Flex, { as: "button", type: "button", direction: "column", align: "center", justify: "center", gap: "3px", px: "2px", py: "6px", borderRadius: "6px", cursor: "pointer", border: "none", bg: "transparent", w: "100%", _hover: { backgroundColor: "whiteAlpha.100" }, transition: "background 0.12s", onClick: app.onClick, children: [appIcon(app), !toggle && (_jsx(Text, { fontSize: "9.5px", color: "whiteAlpha.500", textAlign: "center", maxW: "44px", isTruncated: true, children: app.name }))] }));
|
|
14
|
+
const flyoutBody = (app) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { alignItems: "center", gap: "0.5rem", mb: "0.25rem", onClick: app.onClick, children: [(_a = app.icon) !== null && _a !== void 0 ? _a : (_jsx(Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, boxShadow: `0 0 5px ${app.color}`, flexShrink: 0 })), _jsx(Text, { fontSize: "0.875rem", fontWeight: 700, color: theme.colors.white, children: app.name })] }), app.description && (_jsx(Text, { fontSize: "0.75rem", color: "whiteAlpha.600", children: app.description }))] }));
|
|
17
|
+
};
|
|
18
|
+
return (_jsxs(Box, { borderTop: "1px solid", borderColor: "whiteAlpha.100", p: toggle ? "6px" : "8px 6px", flexShrink: 0, children: [!toggle && (_jsx(Text, { fontSize: "9.5px", fontWeight: 600, color: "whiteAlpha.400", letterSpacing: "0.1em", textTransform: "uppercase", px: "8px", pt: "2px", pb: "5px", children: "Switch app" })), _jsx(Box, { display: "grid", gridTemplateColumns: toggle ? "1fr" : "repeat(4, 1fr)", gap: "3px", children: otherApps.map((app) => toggle ? (_jsxs(Popover, { trigger: "hover", placement: "right-start", closeOnBlur: false, isLazy: true, children: [_jsx(PopoverTrigger, { children: _jsx(Box, { w: "100%", children: appCell(app) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { borderRadius: "0.5rem", bg: theme.colors.sidebar.background[200], boxShadow: "lg", minW: "10rem", maxW: "14rem", py: "0.125rem", ml: "-0.5rem", border: "none", cursor: "pointer", zIndex: 1500, color: "white", children: _jsx(PopoverBody, { p: "0.75rem", children: flyoutBody(app) }) }) })] }, app.name)) : (_jsx(Box, { w: "100%", children: appCell(app) }, app.name))) })] }));
|
|
19
|
+
};
|
|
20
|
+
export default OtherApps;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from "react";
|
|
3
|
+
import { Box, Text } from "@chakra-ui/react";
|
|
4
|
+
import ToolTip from "../../ToolTip/ToolTip";
|
|
5
|
+
const OverflowTooltipText = ({ children, placement = "bottom", maxWidth = "100%", isTooltipDisabled = false, ...textProps }) => {
|
|
6
|
+
const textRef = useRef(null);
|
|
7
|
+
const shadowRef = useRef(null);
|
|
8
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const checkTruncation = () => {
|
|
11
|
+
const textEl = textRef.current;
|
|
12
|
+
const shadowEl = shadowRef.current;
|
|
13
|
+
if (textEl && shadowEl) {
|
|
14
|
+
const visibleWidth = textEl.offsetWidth;
|
|
15
|
+
const fullTextWidth = shadowEl.scrollWidth;
|
|
16
|
+
setIsTruncated(fullTextWidth > visibleWidth + 1);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
checkTruncation();
|
|
20
|
+
const resizeObserver = new ResizeObserver(checkTruncation);
|
|
21
|
+
if (textRef.current) {
|
|
22
|
+
resizeObserver.observe(textRef.current);
|
|
23
|
+
}
|
|
24
|
+
return () => resizeObserver.disconnect();
|
|
25
|
+
}, [children]);
|
|
26
|
+
const shouldShowTooltip = isTruncated && !isTooltipDisabled;
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: children, isDisabled: !shouldShowTooltip, placement: placement, hasArrow: true, children: _jsx(Text, { ref: textRef, isTruncated: true, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", maxW: maxWidth, ...textProps, children: children }) }), _jsx(Box, { ref: shadowRef, position: "absolute", visibility: "hidden", whiteSpace: "nowrap", fontSize: textProps.fontSize, fontWeight: textProps.fontWeight, fontFamily: textProps.fontFamily, lineHeight: textProps.lineHeight, px: textProps.px, py: textProps.py, children: children })] }));
|
|
28
|
+
};
|
|
29
|
+
export default OverflowTooltipText;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from "react";
|
|
3
|
+
import { Tooltip, Text, Box } from "@chakra-ui/react";
|
|
4
|
+
const TruncatedTextWithTooltip = ({ children, ...props }) => {
|
|
5
|
+
const textRef = useRef(null);
|
|
6
|
+
const shadowRef = useRef(null);
|
|
7
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const checkTruncation = () => {
|
|
10
|
+
const textEl = textRef.current;
|
|
11
|
+
const shadowEl = shadowRef.current;
|
|
12
|
+
if (textEl && shadowEl) {
|
|
13
|
+
const visibleWidth = textEl.offsetWidth;
|
|
14
|
+
const fullTextWidth = shadowEl.scrollWidth;
|
|
15
|
+
setIsTruncated(fullTextWidth > visibleWidth);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
checkTruncation();
|
|
19
|
+
const resizeObserver = new ResizeObserver(checkTruncation);
|
|
20
|
+
if (textRef.current) {
|
|
21
|
+
resizeObserver.observe(textRef.current);
|
|
22
|
+
}
|
|
23
|
+
return () => resizeObserver.disconnect();
|
|
24
|
+
}, [children]);
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { label: children, isDisabled: !isTruncated, hasArrow: true, placement: "right", children: _jsx(Text, { ref: textRef, isTruncated: true, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", maxW: "100%", ...props, children: children }) }), _jsx(Box, { ref: shadowRef, position: "fixed", top: "-9999px", left: "-9999px", visibility: "hidden", whiteSpace: "nowrap", fontSize: props.fontSize, fontWeight: props.fontWeight, fontFamily: props.fontFamily, lineHeight: props.lineHeight, px: props.px, py: props.py, children: children })] }));
|
|
26
|
+
};
|
|
27
|
+
export default TruncatedTextWithTooltip;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useContext, useMemo } from "react";
|
|
2
|
+
import { lightPalettes } from "../../Theme/tokens/brands";
|
|
3
|
+
import { ThemeModeContext } from "../../Theme/provider/PixelizeThemeProvider";
|
|
4
|
+
export const getSidebarActiveAccent = (colors, brand, isDark) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
6
|
+
const fallbackIcon = (_d = (_b = (_a = colors.primary) === null || _a === void 0 ? void 0 : _a[300]) !== null && _b !== void 0 ? _b : (_c = colors.gray) === null || _c === void 0 ? void 0 : _c[300]) !== null && _d !== void 0 ? _d : "#ffffff";
|
|
7
|
+
const fallbackLabel = (_h = (_f = (_e = colors.primary) === null || _e === void 0 ? void 0 : _e[100]) !== null && _f !== void 0 ? _f : (_g = colors.gray) === null || _g === void 0 ? void 0 : _g[100]) !== null && _h !== void 0 ? _h : "#ffffff";
|
|
8
|
+
if (!isDark)
|
|
9
|
+
return { icon: fallbackIcon, label: fallbackLabel };
|
|
10
|
+
const lightPrimary = brand ? (_j = lightPalettes[brand]) === null || _j === void 0 ? void 0 : _j.primary : undefined;
|
|
11
|
+
return {
|
|
12
|
+
icon: (_k = lightPrimary === null || lightPrimary === void 0 ? void 0 : lightPrimary[300]) !== null && _k !== void 0 ? _k : fallbackIcon,
|
|
13
|
+
label: (_l = lightPrimary === null || lightPrimary === void 0 ? void 0 : lightPrimary[100]) !== null && _l !== void 0 ? _l : fallbackLabel,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* `sidebar.background` never inverts across modes (`buildDarkPalette.ts`), but `primary`
|
|
18
|
+
* does — so `primary[300]`/`primary[100]` correctly read as a light accent/label against a
|
|
19
|
+
* dark canvas in light mode, then invert to near-black in dark mode against that SAME
|
|
20
|
+
* permanently-dark canvas. Reusing each rung's own light-mode value in dark mode is the
|
|
21
|
+
* exact pairing already proven legible today.
|
|
22
|
+
*
|
|
23
|
+
* `brand` comes from `PixelizeThemeProvider`'s context, read directly (not via the throwing
|
|
24
|
+
* `useThemeMode()`) so a consumer on a plain `ChakraProvider` — dark mode is opt-in per
|
|
25
|
+
* CLAUDE.md — degrades to the current-mode value instead of crashing.
|
|
26
|
+
*/
|
|
27
|
+
export const useSidebarActiveAccent = (colors, isDark) => {
|
|
28
|
+
const themeMode = useContext(ThemeModeContext);
|
|
29
|
+
const brand = themeMode === null || themeMode === void 0 ? void 0 : themeMode.brand;
|
|
30
|
+
return useMemo(() => getSidebarActiveAccent(colors, brand, isDark), [colors, brand, isDark]);
|
|
31
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Box, Flex, Heading, Skeleton, Table, Tbody, Td, Text, Th, Thead, Tr, VStack, } from "@chakra-ui/react";
|
|
4
|
+
import { MonitorSmartphone } from "lucide-react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
import EmptyState from "../EmptyState/EmptyState";
|
|
7
|
+
const DEFAULT_LABELS = {
|
|
8
|
+
title: "Recent Sign-in Devices",
|
|
9
|
+
browser: "Browser",
|
|
10
|
+
device: "Device",
|
|
11
|
+
recentActivity: "Recent Activity",
|
|
12
|
+
noActivity: "No recent sign-in activity",
|
|
13
|
+
};
|
|
14
|
+
const SignInActivityTable = ({ devices, isLoading = false, labels: labelOverrides, }) => {
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
16
|
+
const { colors } = useCustomTheme();
|
|
17
|
+
const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
|
|
18
|
+
const border = (_d = (_b = (_a = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _a === void 0 ? void 0 : _a[200]) !== null && _b !== void 0 ? _b : (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[200]) !== null && _d !== void 0 ? _d : "#E2E8F0";
|
|
19
|
+
const surface = (_f = (_e = colors === null || colors === void 0 ? void 0 : colors.background) === null || _e === void 0 ? void 0 : _e[50]) !== null && _f !== void 0 ? _f : "#FFFFFF";
|
|
20
|
+
const muted = (_h = (_g = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _g === void 0 ? void 0 : _g[500]) !== null && _h !== void 0 ? _h : "#64748B";
|
|
21
|
+
const heading = (_k = (_j = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _j === void 0 ? void 0 : _j[800]) !== null && _k !== void 0 ? _k : "#1E293B";
|
|
22
|
+
const headBg = (_m = (_l = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _l === void 0 ? void 0 : _l[50]) !== null && _m !== void 0 ? _m : "#F8FAFC";
|
|
23
|
+
const shadow = (_p = (_o = colors === null || colors === void 0 ? void 0 : colors.boxShadow) === null || _o === void 0 ? void 0 : _o.default) !== null && _p !== void 0 ? _p : "#0000000D";
|
|
24
|
+
const thStyle = {
|
|
25
|
+
fontSize: "0.7rem",
|
|
26
|
+
textTransform: "uppercase",
|
|
27
|
+
letterSpacing: "0.04em",
|
|
28
|
+
color: muted,
|
|
29
|
+
borderColor: border,
|
|
30
|
+
py: 3,
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(Box, { mt: 4, backgroundColor: surface, borderRadius: "xl", border: "1px solid", borderColor: border, boxShadow: `0 1px 2px ${shadow}`, overflow: "hidden", children: [_jsx(Flex, { px: 4, py: 3, borderBottom: "1px solid", borderColor: border, alignItems: "center", children: _jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.title }) }), _jsx(Box, { overflowX: "auto", children: isLoading ? (_jsx(VStack, { spacing: 3, p: 4, align: "stretch", children: Array.from({ length: 4 }).map((_, idx) => (_jsx(Skeleton, { height: "18px", borderRadius: "md" }, idx))) })) : devices.length === 0 ? (_jsx(EmptyState, { icon: MonitorSmartphone, title: labels.noActivity, size: "sm", minH: "160px" })) : (_jsxs(Table, { variant: "simple", size: "sm", children: [_jsx(Thead, { bg: headBg, children: _jsxs(Tr, { children: [_jsx(Th, { ...thStyle, children: labels.browser }), _jsx(Th, { ...thStyle, children: labels.device }), _jsx(Th, { ...thStyle, children: labels.recentActivity })] }) }), _jsx(Tbody, { children: devices.map((device, index) => (_jsxs(Tr, { _hover: { bg: headBg }, transition: "background 0.15s ease", children: [_jsx(Td, { borderColor: border, fontSize: "sm", fontWeight: 500, color: heading, children: device.browser || "—" }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: device.device }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: _jsx(Text, { children: device.activity }) })] }, index))) })] })) })] }));
|
|
33
|
+
};
|
|
34
|
+
export default SignInActivityTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
// import Skeletons from './Skeletons'; // adjust the import path as necessary
|
|
4
|
+
// import { ChakraProvider } from '@chakra-ui/react';
|
|
5
|
+
// import { SkeletonProps } from './SkeletonProps'; // adjust the import path as necessary
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton, SkeletonCircle, SkeletonText } from "@chakra-ui/react";
|
|
3
|
+
export default function Skeletons({ startColor, endColor, height = "20px", isLoaded, bg, color, fadeDuration, children, type, speed, size, mt, noOfLines, spacing, skeletonHeight, width, }) {
|
|
4
|
+
return (_jsxs(_Fragment, { children: [type === "skeleton" && (_jsx(Skeleton, { height: height, isLoaded: isLoaded, bg: bg, color: color, fadeDuration: fadeDuration, startColor: startColor, endColor: endColor, speed: speed, width: width, children: children })), type === "circle" && _jsx(SkeletonCircle, { size: size, speed: speed }), type === "text" && (_jsx(SkeletonText, { mt: mt, noOfLines: noOfLines, spacing: spacing, skeletonHeight: skeletonHeight }))] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, useCallback } from "react";
|
|
3
|
+
import { Box, Flex, IconButton, Image, useBreakpointValue, AspectRatio } from "@chakra-ui/react";
|
|
4
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
const Slider = ({ images, interval = 5000, isArrow = false, mobileImages, }) => {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8
|
+
const { colors } = useCustomTheme();
|
|
9
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
10
|
+
const timeoutRef = useRef(null);
|
|
11
|
+
const isMobile = (_a = useBreakpointValue({ base: true, md: false })) !== null && _a !== void 0 ? _a : false;
|
|
12
|
+
const slides = (isMobile && mobileImages && mobileImages.length > 0) ? mobileImages : images;
|
|
13
|
+
const nextSlide = useCallback(() => {
|
|
14
|
+
setCurrentIndex((prev) => (prev + 1) % slides.length);
|
|
15
|
+
}, [slides.length]);
|
|
16
|
+
const prevSlide = useCallback(() => {
|
|
17
|
+
setCurrentIndex((prev) => (prev - 1 + slides.length) % slides.length);
|
|
18
|
+
}, [slides.length]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (interval > 0) {
|
|
21
|
+
timeoutRef.current = setTimeout(nextSlide, interval);
|
|
22
|
+
}
|
|
23
|
+
return () => {
|
|
24
|
+
if (timeoutRef.current)
|
|
25
|
+
clearTimeout(timeoutRef.current);
|
|
26
|
+
};
|
|
27
|
+
}, [currentIndex, interval, nextSlide]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (currentIndex >= slides.length) {
|
|
30
|
+
setCurrentIndex(0);
|
|
31
|
+
}
|
|
32
|
+
// eslint-disable-next-line
|
|
33
|
+
}, [slides.length]);
|
|
34
|
+
const ratio = (_b = useBreakpointValue({ base: 16 / 9, md: 21 / 9, lg: 21 / 9 })) !== null && _b !== void 0 ? _b : 16 / 9;
|
|
35
|
+
return (_jsxs(Box, { position: "relative", w: "100%", h: "auto", overflow: "hidden", children: [_jsx(Flex, { w: `${slides.length * 100}%`, transform: `translateX(-${(currentIndex * 100) / slides.length}%)`, transition: "transform 0.5s ease", children: [...slides]
|
|
36
|
+
.sort((a, b) => a.order - b.order)
|
|
37
|
+
.map((image, idx) => (_jsx(Box, { w: `${100 / slides.length}%`, h: "auto", flexShrink: 0, display: "flex", justifyContent: "center", alignItems: "center", children: _jsx(AspectRatio, { ratio: ratio, w: "100%", children: _jsx(Image, { src: isMobile && image.mobilePreviewUrl
|
|
38
|
+
? image.mobilePreviewUrl
|
|
39
|
+
: image.previewUrl, alt: `Slide ${idx + 1}`, objectFit: "cover", w: "100%", h: "100%", loading: "lazy" }) }) }, image.id))) }), isArrow && (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, { color: (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[800] }), "aria-label": "Previous Slide", onClick: prevSlide, position: "absolute", top: "50%", left: "1rem", transform: "translateY(-50%)", zIndex: 2, variant: "ghost", _hover: { bg: (_d = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _d === void 0 ? void 0 : _d[200] } }), _jsx(IconButton, { icon: _jsx(ChevronRight, { color: (_e = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _e === void 0 ? void 0 : _e[800] }), "aria-label": "Next Slide", onClick: nextSlide, position: "absolute", top: "50%", right: "1rem", transform: "translateY(-50%)", zIndex: 2, variant: "ghost", _hover: { bg: (_f = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _f === void 0 ? void 0 : _f[200] } })] })), slides.length > 1 && (_jsx(Flex, { position: "absolute", bottom: "1rem", left: "50%", transform: "translateX(-50%)", gap: "0.5rem", zIndex: 2, children: slides.map((_, idx) => (_jsx(Box, { w: { base: "0.5rem", md: "0.8rem" }, h: { base: "0.5rem", md: "0.8rem" }, bg: idx === currentIndex ? "white" : "whiteAlpha.600", borderRadius: "full", cursor: "pointer", onClick: () => setCurrentIndex(idx), transition: "all 0.3s" }, idx))) }))] }));
|
|
40
|
+
};
|
|
41
|
+
export default Slider;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { Box, Flex } from "@chakra-ui/react";
|
|
4
|
+
import { Check } from "lucide-react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
import ToolTip from "../ToolTip/ToolTip";
|
|
7
|
+
import { resolveStagePalette, } from "./StageProgressProps";
|
|
8
|
+
const sizeMap = {
|
|
9
|
+
sm: { arrow: 12, minW: "120px", h: "28px", px: 3, font: "0.75rem", icon: 12 },
|
|
10
|
+
md: { arrow: 16, minW: "160px", h: "36px", px: 4, font: "0.875rem", icon: 14 },
|
|
11
|
+
lg: { arrow: 20, minW: "200px", h: "44px", px: 5, font: "1rem", icon: 16 },
|
|
12
|
+
};
|
|
13
|
+
const clipFor = (index, total, a) => {
|
|
14
|
+
const isFirst = index === 0;
|
|
15
|
+
const isLast = index === total - 1;
|
|
16
|
+
if (total === 1)
|
|
17
|
+
return "none";
|
|
18
|
+
if (isFirst)
|
|
19
|
+
return `polygon(0 0, calc(100% - ${a}px) 0, 100% 50%, calc(100% - ${a}px) 100%, 0 100%)`;
|
|
20
|
+
if (isLast)
|
|
21
|
+
return `polygon(0 0, 100% 0, 100% 100%, 0 100%, ${a}px 50%)`;
|
|
22
|
+
return `polygon(0 0, calc(100% - ${a}px) 0, 100% 50%, calc(100% - ${a}px) 100%, 0 100%, ${a}px 50%)`;
|
|
23
|
+
};
|
|
24
|
+
const StageItem = ({ label, index, total, state, variant = "chevron", size = "md", colorScheme = "primary", onClick, isReadOnly = false, disabled = false, showCheck = false, minWidth, scrollIntoViewWhenActive = true, tooltipThreshold = 20, }) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const theme = useCustomTheme();
|
|
27
|
+
const palette = resolveStagePalette(theme, colorScheme);
|
|
28
|
+
const ref = useRef(null);
|
|
29
|
+
const s = sizeMap[size];
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (state === "active" && scrollIntoViewWhenActive && ref.current) {
|
|
32
|
+
ref.current.scrollIntoView({
|
|
33
|
+
behavior: "smooth",
|
|
34
|
+
inline: "center",
|
|
35
|
+
block: "nearest",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [state, scrollIntoViewWhenActive]);
|
|
39
|
+
const bg = state === "active"
|
|
40
|
+
? palette.strong
|
|
41
|
+
: state === "completed"
|
|
42
|
+
? palette.soft
|
|
43
|
+
: palette.muted;
|
|
44
|
+
const color = state === "active"
|
|
45
|
+
? palette.onStrong
|
|
46
|
+
: state === "completed"
|
|
47
|
+
? palette.softText
|
|
48
|
+
: palette.mutedText;
|
|
49
|
+
const interactive = !isReadOnly && !disabled;
|
|
50
|
+
const isFirst = index === 0;
|
|
51
|
+
const isLast = index === total - 1;
|
|
52
|
+
const isChevron = variant === "chevron";
|
|
53
|
+
// Chevron pads extra on the left to clear the inbound notch and on the right
|
|
54
|
+
// to keep text clear of the outgoing arrow point; others are centered.
|
|
55
|
+
const leftPad = isChevron && !isFirst ? s.arrow + s.px * 4 : s.px * 2;
|
|
56
|
+
const rightPad = isChevron ? s.arrow + s.px * 4 : s.px * 2;
|
|
57
|
+
// Chevron overlaps into the previous point, leaving a thin 2px divider.
|
|
58
|
+
const overlap = isChevron && !isFirst ? -(s.arrow - 2) : 0;
|
|
59
|
+
const clipPath = isChevron ? clipFor(index, total, s.arrow) : "none";
|
|
60
|
+
const borderRadius = variant === "pills"
|
|
61
|
+
? "full"
|
|
62
|
+
: variant === "bar"
|
|
63
|
+
? isFirst && isLast
|
|
64
|
+
? "8px"
|
|
65
|
+
: isFirst
|
|
66
|
+
? "8px 2px 2px 8px"
|
|
67
|
+
: isLast
|
|
68
|
+
? "2px 8px 8px 2px"
|
|
69
|
+
: "2px"
|
|
70
|
+
: "0";
|
|
71
|
+
// Upcoming pills read as outlined; other states stay filled.
|
|
72
|
+
const isOutlinePill = variant === "pills" && state === "upcoming";
|
|
73
|
+
const hoverStyles = interactive
|
|
74
|
+
? state === "active"
|
|
75
|
+
? { bg: palette.hover }
|
|
76
|
+
: { bg: palette.strong, color: palette.onStrong, borderColor: palette.strong }
|
|
77
|
+
: undefined;
|
|
78
|
+
const showTooltip = ((_a = label === null || label === void 0 ? void 0 : label.length) !== null && _a !== void 0 ? _a : 0) > tooltipThreshold;
|
|
79
|
+
const content = (_jsx(Box, { ref: ref, as: (interactive ? "button" : "div"), type: interactive ? "button" : undefined, "aria-current": state === "active" ? "step" : undefined, onClick: interactive ? onClick : undefined, flexShrink: 0, minWidth: minWidth || s.minW, height: s.h, ml: `${overlap}px`, pl: `${leftPad}px`, pr: `${rightPad}px`, bg: isOutlinePill ? "transparent" : bg, color: isOutlinePill ? palette.mutedText : color, border: isOutlinePill ? "1px solid" : "none", borderColor: isOutlinePill ? palette.muted : undefined, borderRadius: borderRadius, fontSize: s.font, fontWeight: state === "active" ? 600 : 500, display: "flex", alignItems: "center", justifyContent: isChevron ? "flex-start" : "center", cursor: interactive ? "pointer" : "default", opacity: disabled ? 0.55 : 1, transition: "background 0.18s ease, color 0.18s ease, filter 0.18s ease, border-color 0.18s ease", sx: { clipPath }, _hover: interactive ? { ...hoverStyles, filter: "brightness(0.97)" } : undefined, children: _jsxs(Flex, { align: "center", justify: isChevron ? "flex-start" : "center", gap: "6px", width: "100%", minW: 0, children: [showCheck && state === "completed" && (_jsx(Check, { size: s.icon, style: { flexShrink: 0 } })), _jsx(Box, { as: "span", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", textAlign: "center", flex: "1", children: label })] }) }));
|
|
80
|
+
if (showTooltip) {
|
|
81
|
+
return (_jsx(ToolTip, { label: label, placement: "top", openDelay: 300, children: content }));
|
|
82
|
+
}
|
|
83
|
+
return content;
|
|
84
|
+
};
|
|
85
|
+
export default StageItem;
|