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,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Text } from "@chakra-ui/react";
|
|
3
|
+
import { AlertCircle, Clock, Sparkles } from "lucide-react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
5
|
+
import { onGradient } from "../../Theme/tokens/builders/accentText";
|
|
6
|
+
import { ACCENT_GRADIENT } from "./planPillGradient";
|
|
7
|
+
const TONE_ICON = {
|
|
8
|
+
normal: Sparkles,
|
|
9
|
+
warning: Clock,
|
|
10
|
+
danger: AlertCircle,
|
|
11
|
+
};
|
|
12
|
+
const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient, maxLabelWidth = "150px", ariaLabel, onClick, }) => {
|
|
13
|
+
const theme = useCustomTheme();
|
|
14
|
+
const c = theme.colors;
|
|
15
|
+
const toneGradient = {
|
|
16
|
+
normal: ACCENT_GRADIENT,
|
|
17
|
+
warning: { from: c.semantic.warning[400], to: c.semantic.warning[600] },
|
|
18
|
+
danger: { from: c.semantic.error[400], to: c.semantic.error[600] },
|
|
19
|
+
};
|
|
20
|
+
const resolved = gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone];
|
|
21
|
+
const ink = onGradient(resolved.from, resolved.to, c.white, c.black);
|
|
22
|
+
// The chip is a translucent inset of the pill itself, so it tints with whichever
|
|
23
|
+
// ink won — a white wash under black text would wash the chip out entirely.
|
|
24
|
+
const onDark = ink === c.white;
|
|
25
|
+
const Icon = icon === undefined ? TONE_ICON[tone] : icon;
|
|
26
|
+
const hasMobile = !!mobileLabel && mobileLabel !== label;
|
|
27
|
+
return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage: `linear-gradient(135deg, ${resolved.from} 0%, ${resolved.to} 100%)`, color: ink, borderRadius: "999px", whiteSpace: "nowrap", cursor: "pointer", transition: "transform 0.2s ease, box-shadow 0.2s ease", _hover: {
|
|
28
|
+
transform: "translateY(-1px)",
|
|
29
|
+
boxShadow: `0 6px 18px ${resolved.from}59`,
|
|
30
|
+
}, _focusVisible: {
|
|
31
|
+
outline: "none",
|
|
32
|
+
boxShadow: `0 0 0 3px ${resolved.from}55`,
|
|
33
|
+
}, sx: {
|
|
34
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
35
|
+
transition: "none",
|
|
36
|
+
_hover: { transform: "none" },
|
|
37
|
+
},
|
|
38
|
+
}, children: [Icon ? _jsx(Icon, { size: 12, strokeWidth: 2.5, "aria-hidden": true }) : null, _jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", overflow: "hidden", textOverflow: "ellipsis", maxW: maxLabelWidth, display: hasMobile ? { base: "none", md: "block" } : "block", children: label }), hasMobile ? (_jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", display: { base: "block", md: "none" }, children: mobileLabel })) : null, status ? (_jsx(Flex, { as: "span", align: "center", px: "8px", borderRadius: "999px", bg: onDark ? "rgba(255,255,255,0.22)" : "rgba(0,0,0,0.12)", border: "1px solid", borderColor: onDark ? "rgba(255,255,255,0.28)" : "rgba(0,0,0,0.08)", fontSize: "11px", fontWeight: "700", lineHeight: "18px", sx: { fontVariantNumeric: "tabular-nums" }, children: status })) : null] }));
|
|
39
|
+
};
|
|
40
|
+
export default PlanPill;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plan badge's `normal` tone is a single fixed accent — not brand-driven, and
|
|
3
|
+
* not mode-dependent.
|
|
4
|
+
*
|
|
5
|
+
* Its tone carries meaning (normal / warning / danger), and a brand gradient can
|
|
6
|
+
* collide with that: rosewood's `#c74962 → #ea0727` is red, so a healthy plan
|
|
7
|
+
* rendered as if it had expired. Greyscale brands failed the other way, sinking
|
|
8
|
+
* the badge into the header chrome.
|
|
9
|
+
*
|
|
10
|
+
* One accent for both color modes is deliberate: a lighter dark-mode variant was
|
|
11
|
+
* tried and flipped `onGradient`'s ink to black, which read as a washed-out candy
|
|
12
|
+
* pill on dark chrome. These stops keep white ink in both modes, so the badge looks
|
|
13
|
+
* like the same component everywhere. Verified at AA (>= 4.5:1) on both stops.
|
|
14
|
+
*
|
|
15
|
+
* Consumers who genuinely want another colour still pass `gradient`.
|
|
16
|
+
*/
|
|
17
|
+
export const ACCENT_GRADIENT = { from: "#8B3FC8", to: "#df187a" };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Box, Image, Badge, VStack, HStack, Text, IconButton } from "@chakra-ui/react";
|
|
4
|
+
import ProductTags from "./ProductTags";
|
|
5
|
+
import ProductPrice from "./ProductPrice";
|
|
6
|
+
import Button from "../Button/Button";
|
|
7
|
+
import ProductLabel from "./ProductLabel";
|
|
8
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
9
|
+
import { Minus, Plus } from "lucide-react";
|
|
10
|
+
import ProductReview from "./ProductReview";
|
|
11
|
+
const ProductCard = ({ id, label, productImage, rating, reviews, tags, options, button, batch, onAddToCart, onNotifyMe, onClick, onOptionChange, addToCart, goToCart, OnGoToCart, size = "sm", notifyMe, isQtyEditable = false, displayRating = true, }) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
13
|
+
const [hover, setHover] = useState(false);
|
|
14
|
+
const theme = useCustomTheme();
|
|
15
|
+
const [selectedOption, setSelectedOption] = useState(options === null || options === void 0 ? void 0 : options[0]);
|
|
16
|
+
const [qty, setQty] = useState(1);
|
|
17
|
+
const handleOptionSelect = (option) => {
|
|
18
|
+
setSelectedOption(option);
|
|
19
|
+
onOptionChange === null || onOptionChange === void 0 ? void 0 : onOptionChange(option);
|
|
20
|
+
};
|
|
21
|
+
const handleIncrement = (e) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
if ((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) && qty < selectedOption.stocks) {
|
|
24
|
+
setQty((prev) => prev + 1);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const handleDecrement = (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
if (qty > 1) {
|
|
30
|
+
setQty((prev) => prev - 1);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const sizeStyles = {
|
|
34
|
+
xs: { cardWidth: "16.25rem", imgHeight: "11.25rem", padding: 3 },
|
|
35
|
+
sm: { cardWidth: "18rem", imgHeight: "13rem", padding: 4 },
|
|
36
|
+
md: { cardWidth: "20rem", imgHeight: "15rem", padding: 5 },
|
|
37
|
+
lg: { cardWidth: "22rem", imgHeight: "17rem", padding: 6 },
|
|
38
|
+
};
|
|
39
|
+
const { cardWidth, imgHeight, padding } = sizeStyles[size];
|
|
40
|
+
const imageList = (_a = productImage === null || productImage === void 0 ? void 0 : productImage.filter((img) => img.isImage !== false)) !== null && _a !== void 0 ? _a : [];
|
|
41
|
+
const isSizeType = (s) => s === "xs" || s === "sm" || s === "md" || s === "lg";
|
|
42
|
+
const safeSize = isSizeType(size) ? size : "md";
|
|
43
|
+
return (_jsxs(Box, { borderWidth: "0.063rem", borderRadius: "lg", overflow: "hidden", w: "full", maxW: cardWidth, h: "full", display: "flex", flexDirection: "column", position: "relative", bg: theme.colors.background[50], boxShadow: "lg", children: [imageList.length > 0 && (_jsxs(Box, { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), h: imgHeight, w: "full", overflow: "hidden", onClick: onClick, cursor: "pointer", children: [_jsx(Image, { src: hover && ((_b = imageList === null || imageList === void 0 ? void 0 : imageList[1]) === null || _b === void 0 ? void 0 : _b.imageUrl) ? imageList[1].imageUrl : (_c = imageList === null || imageList === void 0 ? void 0 : imageList[0]) === null || _c === void 0 ? void 0 : _c.imageUrl, alt: label, w: "full", h: "full", transform: hover ? "scale(1.06)" : "scale(1)", transition: "transform 0.7s cubic-bezier(0.16, 1, 0.3, 1)" }), batch && (_jsx(Badge, { colorScheme: batch.color || "green", position: "absolute", top: 2, right: 2, fontSize: {
|
|
44
|
+
xs: "xs",
|
|
45
|
+
sm: "sm",
|
|
46
|
+
md: "md",
|
|
47
|
+
lg: "lg",
|
|
48
|
+
}[size], px: {
|
|
49
|
+
xs: 1,
|
|
50
|
+
sm: 2,
|
|
51
|
+
md: 3,
|
|
52
|
+
lg: 4,
|
|
53
|
+
}[size], py: {
|
|
54
|
+
xs: 0.5,
|
|
55
|
+
sm: 1,
|
|
56
|
+
md: 1.5,
|
|
57
|
+
lg: 2,
|
|
58
|
+
}[size], children: batch.label }))] })), _jsxs(VStack, { spacing: 2, align: "start", p: padding, flex: "1", w: "full", children: [_jsx(Box, { onClick: onClick, cursor: "pointer", children: _jsx(ProductLabel, { label: label, size: size }) }), tags && _jsx(ProductTags, { tags: tags, size: size }), options && (_jsx(ProductPrice, { options: options, size: size, onSelect: handleOptionSelect, rightSlot: (displayRating && ((rating !== undefined && rating !== null) || (reviews !== undefined && reviews !== null)))
|
|
59
|
+
? _jsx(ProductReview, { rating: rating, reviewCount: reviews })
|
|
60
|
+
: undefined })), _jsxs(VStack, { w: "full", align: "stretch", spacing: 2, mt: "auto", children: [typeof (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) === "number" && ((_d = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _d !== void 0 ? _d : 0) <= 0 && (_jsx(Button, { colorScheme: "gray", size: safeSize, width: "100%", isDisabled: true, children: "Out of Stock" })), addToCart && (((_e = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _e !== void 0 ? _e : 1) > 0) && isQtyEditable && (_jsx(HStack, { w: "full", justify: "space-between", children: _jsxs(HStack, { children: [_jsx(IconButton, { icon: _jsx(Minus, { size: 16 }), "aria-label": "Decrease quantity", size: "xs", onClick: handleDecrement, isDisabled: qty <= 1, isRound: true, variant: "outline", colorScheme: "red" }), _jsx(Text, { fontWeight: "bold", w: 8, textAlign: "center", children: qty }), _jsx(IconButton, { icon: _jsx(Plus, { size: 16 }), "aria-label": "Increase quantity", size: "xs", onClick: handleIncrement, isDisabled: qty >= ((_f = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _f !== void 0 ? _f : 1), isRound: true, variant: "outline", colorScheme: "red" })] }) })), (button === null || button === void 0 ? void 0 : button.onClick) && (_jsx(Button, { colorScheme: "red", size: safeSize, width: "100%", onClick: button === null || button === void 0 ? void 0 : button.onClick, children: (_g = button.label) !== null && _g !== void 0 ? _g : "Add to Cart" })), addToCart && (((_h = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _h !== void 0 ? _h : 1) > 0) && (_jsx(Button, { width: "100%", size: safeSize, onClick: () => (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.var_id) !== undefined && (onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id, selectedOption.var_id, qty)), colorScheme: "red", children: "Add to Cart" })), addToCart && (((_j = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _j !== void 0 ? _j : 1) <= 0) && notifyMe && (_jsx(Button, { width: "100%", size: safeSize, onClick: () => (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.var_id) !== undefined && (onNotifyMe === null || onNotifyMe === void 0 ? void 0 : onNotifyMe(id, selectedOption.var_id)), colorScheme: "red", variant: "outline", children: "Notify Me" })), goToCart && (_jsx(Button, { width: "100%", size: safeSize, onClick: OnGoToCart, colorScheme: "red", children: "Go to Cart" }))] })] })] }));
|
|
61
|
+
};
|
|
62
|
+
export default ProductCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from '@chakra-ui/react';
|
|
3
|
+
const ProductLabel = ({ label, description, size }) => {
|
|
4
|
+
const fontSizes = {
|
|
5
|
+
xs: "md",
|
|
6
|
+
sm: "lg",
|
|
7
|
+
md: "xl",
|
|
8
|
+
lg: "2xl"
|
|
9
|
+
};
|
|
10
|
+
const descriptionSizes = {
|
|
11
|
+
xs: 'xs',
|
|
12
|
+
sm: 'sm',
|
|
13
|
+
md: 'md',
|
|
14
|
+
lg: 'lg',
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(Box, { children: [_jsx(Text, { fontWeight: "bold", fontSize: fontSizes[size], children: label }), description && _jsx(Text, { fontSize: descriptionSizes[size], fontStyle: "italic", children: description })] }));
|
|
17
|
+
};
|
|
18
|
+
export default ProductLabel;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { Box, Text, Portal, useOutsideClick, Flex, Grid, HStack, Badge, useBreakpointValue, } from '@chakra-ui/react';
|
|
4
|
+
import OverflowTooltipText from '../SideBar/components/OverflowTooltipText';
|
|
5
|
+
import { useCustomTheme } from '../../Theme/useCustomTheme';
|
|
6
|
+
import { accentTextOnCanvas } from '../../Theme/tokens/builders/accentText';
|
|
7
|
+
import { rafThrottle } from '../../Utils/rafThrottle';
|
|
8
|
+
const sizeConfig = {
|
|
9
|
+
xs: {
|
|
10
|
+
font: "xs",
|
|
11
|
+
label: "sm",
|
|
12
|
+
price: "sm",
|
|
13
|
+
px: 2,
|
|
14
|
+
py: 1,
|
|
15
|
+
rowHeight: "2rem",
|
|
16
|
+
iconSize: "0.75rem",
|
|
17
|
+
dotSize: "0.375rem",
|
|
18
|
+
},
|
|
19
|
+
sm: {
|
|
20
|
+
font: "sm",
|
|
21
|
+
label: "md",
|
|
22
|
+
price: "md",
|
|
23
|
+
px: 3,
|
|
24
|
+
py: 1.5,
|
|
25
|
+
rowHeight: "2.5rem",
|
|
26
|
+
iconSize: "1rem",
|
|
27
|
+
dotSize: "0.5rem",
|
|
28
|
+
},
|
|
29
|
+
md: {
|
|
30
|
+
font: "md",
|
|
31
|
+
label: "lg",
|
|
32
|
+
price: "lg",
|
|
33
|
+
px: 4,
|
|
34
|
+
py: 2,
|
|
35
|
+
rowHeight: "3rem",
|
|
36
|
+
iconSize: "1.25rem",
|
|
37
|
+
dotSize: "0.625rem",
|
|
38
|
+
},
|
|
39
|
+
lg: {
|
|
40
|
+
font: "lg",
|
|
41
|
+
label: "xl",
|
|
42
|
+
price: "xl",
|
|
43
|
+
px: 5,
|
|
44
|
+
py: 2.5,
|
|
45
|
+
rowHeight: "3.5rem",
|
|
46
|
+
iconSize: "1.5rem",
|
|
47
|
+
dotSize: "0.75rem",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
const ProductPrice = ({ options, size, onSelect, rightSlot }) => {
|
|
51
|
+
const cfg = sizeConfig[size];
|
|
52
|
+
const theme = useCustomTheme();
|
|
53
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
54
|
+
const [selected, setSelected] = useState(options[0]);
|
|
55
|
+
const [dropdownPosition, setDropdownPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
56
|
+
const buttonRef = useRef(null);
|
|
57
|
+
const dropdownRef = useRef(null);
|
|
58
|
+
const isSingleOption = options.length === 1;
|
|
59
|
+
const isMobile = useBreakpointValue({ base: true, md: false });
|
|
60
|
+
useOutsideClick({
|
|
61
|
+
ref: dropdownRef,
|
|
62
|
+
handler: () => setIsOpen(false),
|
|
63
|
+
});
|
|
64
|
+
const getDiscountedPrice = (option) => Math.round(option.price - (option.price * option.offer) / 100);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const updatePosition = () => {
|
|
67
|
+
if (buttonRef.current) {
|
|
68
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
69
|
+
setDropdownPosition({
|
|
70
|
+
top: rect.bottom + 4,
|
|
71
|
+
left: rect.left,
|
|
72
|
+
width: rect.width
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
if (!isOpen)
|
|
77
|
+
return;
|
|
78
|
+
updatePosition();
|
|
79
|
+
const onReposition = rafThrottle(updatePosition);
|
|
80
|
+
window.addEventListener("resize", onReposition);
|
|
81
|
+
window.addEventListener("scroll", onReposition, {
|
|
82
|
+
capture: true, // every scrollable ancestor, not just the window
|
|
83
|
+
passive: true,
|
|
84
|
+
});
|
|
85
|
+
return () => {
|
|
86
|
+
onReposition.cancel();
|
|
87
|
+
window.removeEventListener("resize", onReposition);
|
|
88
|
+
window.removeEventListener("scroll", onReposition, true);
|
|
89
|
+
};
|
|
90
|
+
}, [isOpen]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
|
|
93
|
+
}, [selected, onSelect]);
|
|
94
|
+
return (_jsxs(_Fragment, { children: [isSingleOption ? (_jsx(Box, { border: "0.063rem solid", borderColor: "red.300", bg: "red.50", px: cfg.px,
|
|
95
|
+
// py={cfg.py}
|
|
96
|
+
rounded: "md", display: "inline-block", w: "100%", children: _jsx(Text, { fontSize: cfg.label, fontWeight: "medium", children: options[0].label }) })) : (_jsxs(Box, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), border: "0.063rem solid", borderColor: "red.300", bg: "red.50", px: cfg.px,
|
|
97
|
+
// py={cfg.py}
|
|
98
|
+
rounded: "md", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: cfg.label, fontWeight: "medium", whiteSpace: "nowrap", children: selected.label }) }), _jsx(Text, { fontSize: cfg.font, color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: "\u25BE" })] })), !isSingleOption && isOpen && (_jsx(Portal, { children: _jsx(Box, { ref: dropdownRef, position: "fixed", top: `${dropdownPosition.top}px`, left: `${dropdownPosition.left}px`, width: `${dropdownPosition.width}px`, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: "red.300", borderRadius: "md", overflow: "hidden", maxH: "13rem", overflowY: "auto", shadow: "md", zIndex: 100000, children: options.map((option) => {
|
|
99
|
+
const discounted = getDiscountedPrice(option);
|
|
100
|
+
const isSelected = selected.var_id === option.var_id;
|
|
101
|
+
return (_jsxs(Grid, { px: 1, py: 0.5, cursor: "pointer", bg: isSelected ? 'red.50' : theme.colors.background[50], borderLeft: isSelected ? '0.25rem solid' : '0.25rem solid transparent', borderLeftColor: isSelected ? 'red.300' : 'transparent', _hover: { bg: 'red.100' }, onClick: () => {
|
|
102
|
+
setSelected(option);
|
|
103
|
+
setIsOpen(false);
|
|
104
|
+
}, templateColumns: { base: '1fr auto', md: '1fr auto' },
|
|
105
|
+
// columnGap={{ base: 2, md: 3 }}
|
|
106
|
+
// rowGap={{ base: 1.5, md: 2 }}
|
|
107
|
+
alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: "green.100", color: "green.700", borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: "gray.500", textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? 'red.500' : 'gray.600', bg: theme.colors.background[50], display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "none", children: isSelected && (_jsx(Box, { w: { base: "0.25rem", md: "0.3125rem" }, h: { base: "0.25rem", md: "0.3125rem" }, bg: "red.500", borderRadius: "full" })) })] }, option.var_id));
|
|
108
|
+
}) }) })), _jsxs(Flex, { mt: 2, w: "full", gap: 3, direction: { base: "column", md: "row" }, align: { base: "flex-start", md: "center" }, justify: { base: "flex-start", md: rightSlot ? "space-between" : "flex-start" }, children: [_jsxs(Box, { display: "flex", alignItems: "center", fontSize: cfg.price, gap: 2, minW: 0, children: [selected.offer > 0 && (_jsxs(Text, { color: "gray.500", textDecoration: "line-through", children: ["\u20B9", selected.price] })), _jsxs(Text, { color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "semibold", children: ["\u20B9", getDiscountedPrice(selected)] })] }), rightSlot && (_jsx(Box, { flexShrink: 0, mt: { base: 2, md: 0 }, children: rightSlot }))] })] }));
|
|
109
|
+
};
|
|
110
|
+
export default ProductPrice;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Text, Icon } from '@chakra-ui/react';
|
|
3
|
+
import { BookCheck, Star } from 'lucide-react';
|
|
4
|
+
// The theme's `yellow` scale reverses index roles in dark mode (like every utility hue), so
|
|
5
|
+
// pulling it through the theme would silently flip this decorative "filled star" from gold to
|
|
6
|
+
// pale. A rating star is a universal, brand-independent gold — not something that should follow
|
|
7
|
+
// canvas/mode — so it's pinned here instead. Needs a design-token addition (a mode-stable
|
|
8
|
+
// "rating gold") to pixelize-design-library if this pattern is needed elsewhere.
|
|
9
|
+
const RATING_STAR_FILL = "#ECC94B";
|
|
10
|
+
const ProductReview = ({ rating, reviewCount, mb = 0 }) => {
|
|
11
|
+
const hasRating = rating !== undefined && rating !== null;
|
|
12
|
+
const hasReviewCount = reviewCount !== undefined && reviewCount !== null;
|
|
13
|
+
// Convert rating to number and ensure it's between 0 and 5
|
|
14
|
+
// Calculate fill percentage: (rating / 5) * 100%
|
|
15
|
+
const numericRating = hasRating ? Math.min(Math.max(Number(rating), 0), 5) : 0;
|
|
16
|
+
const fillPercentage = (numericRating / 6) * 100;
|
|
17
|
+
return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg: "teal.50", color: "teal.900", px: 2, borderRadius: "md", children: [_jsxs(Box, { position: "relative", flexShrink: 0, display: "inline-block", width: "14px", height: "14px", lineHeight: 0, children: [_jsx(Box, { position: "absolute", top: 0, left: 0, width: "14px", height: "14px", children: _jsx(Star, { size: 14, fill: "none", strokeWidth: 1.5 }) }), fillPercentage > 0 && (_jsx(Box, { position: "absolute", top: 0, left: 0, width: `${fillPercentage}%`, height: "100%", overflow: "hidden", children: _jsx(Star, { size: 14, color: RATING_STAR_FILL, fill: RATING_STAR_FILL }) }))] }), _jsx(Text, { fontSize: "sm", fontWeight: "bold", children: numericRating })] })), hasRating && hasReviewCount && _jsx(Box, { h: "4", w: "0.063rem", bg: "gray.400" }), hasReviewCount && (_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Icon, { as: BookCheck, boxSize: 3.5 }), _jsxs(Text, { fontSize: "sm", color: "gray.600", children: ["(", reviewCount, ")"] })] }))] }));
|
|
18
|
+
};
|
|
19
|
+
export default ProductReview;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Flex, useTheme } from '@chakra-ui/react';
|
|
4
|
+
import ToolTip from '../ToolTip/ToolTip';
|
|
5
|
+
const ProductTags = ({ tags, className, size = 'sm' }) => {
|
|
6
|
+
const getRows = (tags) => {
|
|
7
|
+
const count = tags.length;
|
|
8
|
+
if (count === 1)
|
|
9
|
+
return [tags];
|
|
10
|
+
if (count === 2)
|
|
11
|
+
return [tags];
|
|
12
|
+
if (count === 3)
|
|
13
|
+
return [[tags[0]], tags.slice(1)];
|
|
14
|
+
if (count === 4)
|
|
15
|
+
return [tags.slice(0, 2), tags.slice(2, 4)];
|
|
16
|
+
return [];
|
|
17
|
+
};
|
|
18
|
+
return (_jsx(Flex, { direction: "column", gap: "1", className: className, w: "full", children: getRows(tags).map((row, rowIndex) => (_jsx(Flex, { gap: "1", children: row.map((tag, tagIndex) => (_jsx(Tag, { fullWidth: row.length === 1, size: size, children: tag }, tagIndex))) }, rowIndex))) }));
|
|
19
|
+
};
|
|
20
|
+
const Tag = ({ children, fullWidth = false, size = 'sm', }) => {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const tagBorder = (_c = (_b = (_a = theme.colors.semantic) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b[200]) !== null && _c !== void 0 ? _c : (_d = theme.colors.red) === null || _d === void 0 ? void 0 : _d[200];
|
|
24
|
+
const tagText = theme.colors.text[900];
|
|
25
|
+
// Size map for tags
|
|
26
|
+
const tagSizes = {
|
|
27
|
+
xs: { fontSize: '0.625rem', px: '0.5rem', py: '0.125rem' },
|
|
28
|
+
sm: { fontSize: '0.75rem', px: '0.6rem', py: '0.2rem' },
|
|
29
|
+
md: { fontSize: '0.875rem', px: '0.75rem', py: '0.3rem' },
|
|
30
|
+
lg: { fontSize: '0.938rem', px: '0.938rem', py: '0.4rem' },
|
|
31
|
+
};
|
|
32
|
+
const ref = React.useRef(null);
|
|
33
|
+
const [truncated, setTruncated] = React.useState(false);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const el = ref.current;
|
|
36
|
+
if (!el)
|
|
37
|
+
return;
|
|
38
|
+
const check = () => setTruncated(el.scrollWidth > el.clientWidth);
|
|
39
|
+
check();
|
|
40
|
+
window.addEventListener('resize', check);
|
|
41
|
+
return () => {
|
|
42
|
+
window.removeEventListener('resize', check);
|
|
43
|
+
};
|
|
44
|
+
}, [children]);
|
|
45
|
+
const content = (_jsx(Box, { ref: ref, flex: fullWidth ? '1' : '1', border: "0.063rem solid", borderColor: tagBorder, color: tagText, fontSize: tagSizes[size].fontSize, fontWeight: "semibold", borderRadius: "full", px: tagSizes[size].px, py: tagSizes[size].py, textAlign: "center", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: children }));
|
|
46
|
+
return truncated ? (_jsx(ToolTip, { label: String(children), hasArrow: true, openDelay: 300, placement: 'bottom', children: content })) : (content);
|
|
47
|
+
};
|
|
48
|
+
export default ProductTags;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Box, Flex, Text, HStack, IconButton, useBreakpointValue } from "@chakra-ui/react";
|
|
4
|
+
import ProductImageSlider from "./ProductImageSlider";
|
|
5
|
+
import ProductLabel from "../ProductCard/ProductLabel";
|
|
6
|
+
import ProductTags from "../ProductCard/ProductTags";
|
|
7
|
+
import ProductDtlPrice from "./ProductDtlPrice";
|
|
8
|
+
import Button from "../Button/Button";
|
|
9
|
+
import { ShoppingCartIcon, Minus, Plus } from "lucide-react";
|
|
10
|
+
import ProductReview from "../ProductCard/ProductReview";
|
|
11
|
+
import FormattedDescription from "../Common/FormattedDescription";
|
|
12
|
+
const ProductDetails = ({ id, price, label, shortdesc, tags, images, batch, onAddToCart, onNotifyMe, onOptionChange, addToCart, goToCart, OnGoToCart, rating, reviews, notifyMe, isQtyEditable = false, displayRating = true, }) => {
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
14
|
+
const isMobile = useBreakpointValue({ base: true, md: false });
|
|
15
|
+
const [selectedOption, setSelectedOption] = React.useState(price === null || price === void 0 ? void 0 : price[0]);
|
|
16
|
+
const [qty, setQty] = React.useState(1);
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
setQty(1);
|
|
19
|
+
}, [selectedOption]);
|
|
20
|
+
const handleIncrement = () => {
|
|
21
|
+
setQty((prev) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const stock = (_a = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _a !== void 0 ? _a : Infinity;
|
|
24
|
+
if (prev >= stock)
|
|
25
|
+
return prev;
|
|
26
|
+
return prev + 1;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const handleDecrement = () => {
|
|
30
|
+
setQty((prev) => (prev > 1 ? prev - 1 : 1));
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5, children: [_jsx(Box, { position: "relative", color: "white", borderRadius: "md", flex: "1", minH: isMobile ? undefined : "31.25rem", children: _jsx(ProductImageSlider, { images: images, thumbHeight: isMobile ? 48 : 80, imageSize: isMobile ? 360 : 480, thumbnailsToShow: isMobile ? 4 : 6, batch: batch }) }), _jsxs(Box, { flex: "1", children: [label && _jsx(ProductLabel, { label: label, size: "sm" }), shortdesc && _jsx(Box, { my: 3, children: _jsx(FormattedDescription, { content: shortdesc }) }), ((rating !== undefined && rating !== null) || (reviews !== undefined && reviews !== null)) && displayRating && (_jsx(ProductReview, { rating: rating, reviewCount: reviews, mb: 3 })), tags && _jsx(ProductTags, { tags: tags, size: "sm" }), price && (_jsx(ProductDtlPrice, { price: price, onSelect: (option) => {
|
|
33
|
+
setSelectedOption(option);
|
|
34
|
+
onOptionChange === null || onOptionChange === void 0 ? void 0 : onOptionChange(option);
|
|
35
|
+
} })), typeof (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) === "number" && ((_a = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _a !== void 0 ? _a : 0) <= 0 && (_jsx(Box, { sx: { ml: "1.1rem", mt: "0.5rem", mb: "0.5rem" }, children: _jsx(Button, { colorScheme: "gray", size: "sm",
|
|
36
|
+
// width="50%"
|
|
37
|
+
// onClick={button?.onClick}
|
|
38
|
+
isDisabled: true, children: "Out of Stock" }) })), goToCart && (_jsx(Button, { size: "sm", colorScheme: "red", leftIcon: _jsx(ShoppingCartIcon, {}), sx: { ml: "1.1rem" }, onClick: OnGoToCart, children: "Go to cart" })), addToCart && (((_b = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _b !== void 0 ? _b : 1) > 0) && isQtyEditable && (_jsx(HStack, { sx: { ml: "1.1rem", mb: 4 }, spacing: 4, children: _jsxs(HStack, { children: [_jsx(IconButton, { icon: _jsx(Minus, { size: 16 }), "aria-label": "Decrease quantity", size: "xs", onClick: handleDecrement, isDisabled: qty <= 1, isRound: true, variant: "outline", colorScheme: "red" }), _jsx(Text, { fontWeight: "bold", w: 8, textAlign: "center", children: qty }), _jsx(IconButton, { icon: _jsx(Plus, { size: 16 }), "aria-label": "Increase quantity", size: "xs", onClick: handleIncrement, isDisabled: qty >= ((_c = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _c !== void 0 ? _c : Infinity), isRound: true, variant: "outline", colorScheme: "red" })] }) })), addToCart && (((_d = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _d !== void 0 ? _d : 1) > 0) && (_jsx(Button, { size: "sm", colorScheme: "red", leftIcon: _jsx(ShoppingCartIcon, {}), sx: { ml: "1.1rem" }, onClick: () => (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.var_id) !== undefined && (onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id, selectedOption.var_id, qty)), children: "Add to cart" })), addToCart && (((_e = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _e !== void 0 ? _e : 1) <= 0) && notifyMe && (_jsx(Button, { size: "sm", colorScheme: "red", variant: "outline", sx: { ml: "1.1rem" }, onClick: () => (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.var_id) !== undefined && (onNotifyMe === null || onNotifyMe === void 0 ? void 0 : onNotifyMe(id, selectedOption.var_id)), children: "Notify Me" }))] })] }));
|
|
39
|
+
};
|
|
40
|
+
export default ProductDetails;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Box, Text, HStack, Badge, Button, VStack, } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
5
|
+
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText";
|
|
6
|
+
const ProductDtlPrice = ({ price, onSelect }) => {
|
|
7
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
8
|
+
const selected = price[selectedIndex];
|
|
9
|
+
const discounted = Math.round(selected.price - (selected.price * selected.offer) / 100);
|
|
10
|
+
const theme = useCustomTheme();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
|
|
13
|
+
}, [selected, onSelect]);
|
|
14
|
+
return (_jsxs(VStack, { align: "start", spacing: 3, p: 4, borderRadius: "md", w: "full", children: [_jsxs(HStack, { spacing: 2, align: "center", children: [selected.offer > 0 && (_jsxs(Text, { fontSize: "lg", color: theme.colors.gray[500], as: "s", children: ["\u20B9", selected.price] })), _jsxs(Text, { fontSize: "xl", color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "bold", children: ["\u20B9", discounted] }), selected.offer > 0 && (_jsxs(Badge, { colorScheme: "pink", fontSize: "xs", borderRadius: "sm", px: 2, py: 0.5, children: ["SAVE ", selected.offer, "%"] }))] }), _jsx(Text, { fontSize: "sm", color: theme.colors.gray[600], children: "(Incl. of all taxes)" }), _jsxs(Box, { children: [_jsxs(Text, { fontSize: "sm", fontWeight: "bold", textTransform: "uppercase", mb: 1, children: ["Packs : ", selected.label] }), _jsx(HStack, { spacing: 2, children: price.map((pack, idx) => (_jsx(Button, { size: "xs", variant: "outline", borderColor: idx === selectedIndex ? "orange.400" : "orange.200", bg: idx === selectedIndex ? "orange.50" : theme.colors.background[50],
|
|
15
|
+
// orange.600 fails AA against both possible bg states — walk the scale per canvas
|
|
16
|
+
color: accentTextOnCanvas(theme.colors.orange, idx === selectedIndex ? theme.colors.orange[50] : theme.colors.background[50]), borderRadius: "md", fontWeight: "medium", _hover: {
|
|
17
|
+
bg: "orange.100",
|
|
18
|
+
}, _active: {
|
|
19
|
+
bg: "orange.100",
|
|
20
|
+
}, onClick: () => setSelectedIndex(idx), children: pack.label }, pack.var_id))) })] })] }));
|
|
21
|
+
};
|
|
22
|
+
export default ProductDtlPrice;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Box, Flex, IconButton, Image, AspectRatio, VStack, HStack, useBreakpointValue, } from "@chakra-ui/react";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Play, } from "lucide-react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
export default function ProductImageSlider({ images, thumbHeight = 60, imageSize = 480, thumbnailsToShow = 6, batch, }) {
|
|
7
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
8
|
+
const [thumbStartIndex, setThumbStartIndex] = useState(0);
|
|
9
|
+
const [transformOrigin, setTransformOrigin] = useState("center center");
|
|
10
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
11
|
+
const [isPlaying, setIsPlaying] = useState(false);
|
|
12
|
+
const theme = useCustomTheme();
|
|
13
|
+
const isMobile = useBreakpointValue({ base: true, md: false });
|
|
14
|
+
const getYouTubeId = (url) => {
|
|
15
|
+
const patterns = [
|
|
16
|
+
/youtu\.be\/([A-Za-z0-9_-]{6,})/i,
|
|
17
|
+
/youtube\.com\/watch\?[^#]*v=([A-Za-z0-9_-]{6,})/i,
|
|
18
|
+
/youtube\.com\/embed\/([A-Za-z0-9_-]{6,})/i,
|
|
19
|
+
/youtube\.com\/shorts\/([A-Za-z0-9_-]{6,})/i,
|
|
20
|
+
/youtube\.com\/live\/([A-Za-z0-9_-]{6,})/i,
|
|
21
|
+
];
|
|
22
|
+
for (const re of patterns) {
|
|
23
|
+
const m = url.match(re);
|
|
24
|
+
if (m === null || m === void 0 ? void 0 : m[1])
|
|
25
|
+
return m[1];
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
const getVimeoId = (url) => {
|
|
30
|
+
const patterns = [
|
|
31
|
+
/vimeo\.com\/(\d+)/i,
|
|
32
|
+
/player\.vimeo\.com\/video\/(\d+)/i,
|
|
33
|
+
];
|
|
34
|
+
for (const re of patterns) {
|
|
35
|
+
const m = url.match(re);
|
|
36
|
+
if (m === null || m === void 0 ? void 0 : m[1])
|
|
37
|
+
return m[1];
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
const getDailymotionId = (url) => {
|
|
42
|
+
const patterns = [
|
|
43
|
+
/dailymotion\.com\/video\/([A-Za-z0-9]+)/i,
|
|
44
|
+
/dai\.ly\/([A-Za-z0-9]+)/i,
|
|
45
|
+
];
|
|
46
|
+
for (const re of patterns) {
|
|
47
|
+
const m = url.match(re);
|
|
48
|
+
if (m === null || m === void 0 ? void 0 : m[1])
|
|
49
|
+
return m[1];
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
};
|
|
53
|
+
const isVideoUrl = (url) => /\.(mp4|webm|ogg)(\?|#|$)/i.test(url) ||
|
|
54
|
+
!!(getYouTubeId(url) || getVimeoId(url) || getDailymotionId(url));
|
|
55
|
+
const getThumbForItem = (url) => {
|
|
56
|
+
const yt = getYouTubeId(url);
|
|
57
|
+
if (yt)
|
|
58
|
+
return `https://img.youtube.com/vi/${yt}/hqdefault.jpg`;
|
|
59
|
+
const vm = getVimeoId(url);
|
|
60
|
+
if (vm)
|
|
61
|
+
return `https://vumbnail.com/${vm}.jpg`;
|
|
62
|
+
const dm = getDailymotionId(url);
|
|
63
|
+
if (dm)
|
|
64
|
+
return `https://www.dailymotion.com/thumbnail/video/${dm}`;
|
|
65
|
+
return undefined;
|
|
66
|
+
};
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
setIsPlaying(false);
|
|
69
|
+
}, [activeIndex]);
|
|
70
|
+
const totalThumbs = (images === null || images === void 0 ? void 0 : images.length) || 0;
|
|
71
|
+
const hasMultiple = totalThumbs > 1;
|
|
72
|
+
const visibleThumbnails = images === null || images === void 0 ? void 0 : images.slice(thumbStartIndex, thumbStartIndex + thumbnailsToShow);
|
|
73
|
+
const canScrollUp = thumbStartIndex > 0;
|
|
74
|
+
const canScrollDown = thumbStartIndex + thumbnailsToShow < totalThumbs;
|
|
75
|
+
const handleThumbScroll = (direction) => {
|
|
76
|
+
if (direction === "up" && canScrollUp) {
|
|
77
|
+
setThumbStartIndex((prev) => {
|
|
78
|
+
const newStart = Math.max(prev - 1, 0);
|
|
79
|
+
setActiveIndex(newStart);
|
|
80
|
+
return newStart;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else if (direction === "down" && canScrollDown) {
|
|
84
|
+
setThumbStartIndex((prev) => {
|
|
85
|
+
const newStart = Math.min(prev + 1, totalThumbs - thumbnailsToShow);
|
|
86
|
+
setActiveIndex(newStart);
|
|
87
|
+
return newStart;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const updateActiveIndex = (newIndex) => {
|
|
92
|
+
setActiveIndex(newIndex);
|
|
93
|
+
// Scroll thumbnails window if active index is outside the current visible range
|
|
94
|
+
if (newIndex < thumbStartIndex) {
|
|
95
|
+
setThumbStartIndex(newIndex);
|
|
96
|
+
}
|
|
97
|
+
else if (newIndex >= thumbStartIndex + thumbnailsToShow) {
|
|
98
|
+
setThumbStartIndex(newIndex - thumbnailsToShow + 1);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return (_jsx(Flex, { maxW: "6xl", mx: "auto", gap: 4, direction: isMobile ? "column" : "row", children: isMobile ? (_jsxs(_Fragment, { children: [_jsxs(Box, { w: "full",
|
|
102
|
+
// h={`${imageSize}px`}
|
|
103
|
+
position: "relative", overflow: "hidden", borderRadius: "md", boxShadow: "md", onMouseMove: (e) => {
|
|
104
|
+
if (isMobile)
|
|
105
|
+
return;
|
|
106
|
+
const bounds = e.currentTarget.getBoundingClientRect();
|
|
107
|
+
const x = ((e.clientX - bounds.left) / bounds.width) * 100;
|
|
108
|
+
const y = ((e.clientY - bounds.top) / bounds.height) * 100;
|
|
109
|
+
setTransformOrigin(`${x}% ${y}%`);
|
|
110
|
+
}, onMouseEnter: () => !isMobile && setIsHovered(true), onMouseLeave: () => {
|
|
111
|
+
setIsHovered(false);
|
|
112
|
+
setTransformOrigin("center center");
|
|
113
|
+
}, children: [_jsx(Box, { position: "absolute", top: "2", left: "2", zIndex: "1", children: _jsx(Badge, { colorScheme: batch === null || batch === void 0 ? void 0 : batch.color, variant: "solid", children: batch === null || batch === void 0 ? void 0 : batch.label }) }), (() => {
|
|
114
|
+
const item = images === null || images === void 0 ? void 0 : images[activeIndex];
|
|
115
|
+
const url = (item === null || item === void 0 ? void 0 : item.imageUrl) || "";
|
|
116
|
+
const isVideo = (item === null || item === void 0 ? void 0 : item.isImage) !== undefined ? item.isImage === false : isVideoUrl(url);
|
|
117
|
+
const yt = getYouTubeId(url);
|
|
118
|
+
const vimeo = getVimeoId(url);
|
|
119
|
+
const dm = getDailymotionId(url);
|
|
120
|
+
const thumb = (item === null || item === void 0 ? void 0 : item.thumb) || getThumbForItem(url);
|
|
121
|
+
if (isVideo) {
|
|
122
|
+
if (!isPlaying) {
|
|
123
|
+
return (_jsxs(Box, { position: "relative", w: "100%", h: `${imageSize}px`, children: [_jsx(Image, { src: thumb || url, w: "100%", h: "100%", objectFit: "cover" }), _jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "lg", p: 3, cursor: "pointer", onClick: () => setIsPlaying(true), children: _jsx(Play, { size: 24, color: theme.colors.red[500] }) }) })] }));
|
|
124
|
+
}
|
|
125
|
+
return yt ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://www.youtube.com/embed/${yt}?rel=0&autoplay=1`, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, border: "0" }) })) : vimeo ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://player.vimeo.com/video/${vimeo}?autoplay=1`, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true, border: "0" }) })) : dm ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://www.dailymotion.com/embed/video/${dm}?autoplay=1`, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true, border: "0" }) })) : (_jsx(Box, { as: "video", src: url, w: "100%", h: `${imageSize}px`, controls: true, autoPlay: true, sx: { objectFit: "contain", backgroundColor: "black" } }));
|
|
126
|
+
}
|
|
127
|
+
return (_jsx(Image, { src: url, w: "100%", h: "100%", objectFit: "cover", transformOrigin: transformOrigin, transform: !isMobile && isHovered ? "scale(1.6)" : "scale(1)", transition: "transform 0.3s ease" }));
|
|
128
|
+
})(), hasMultiple && (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, { size: 20, color: theme.colors.gray[500] }), "aria-label": "Previous", onClick: () => {
|
|
129
|
+
var _a;
|
|
130
|
+
const max = ((_a = images === null || images === void 0 ? void 0 : images.length) !== null && _a !== void 0 ? _a : 1);
|
|
131
|
+
const newIndex = activeIndex === 0 ? max - 1 : activeIndex - 1;
|
|
132
|
+
updateActiveIndex(newIndex);
|
|
133
|
+
}, position: "absolute", left: "2", top: "50%", transform: "translateY(-50%)", variant: "ghost", colorScheme: "gray" }), _jsx(IconButton, { icon: _jsx(ChevronRight, { size: 20, color: theme.colors.gray[500] }), "aria-label": "Next", onClick: () => {
|
|
134
|
+
var _a;
|
|
135
|
+
const max = ((_a = images === null || images === void 0 ? void 0 : images.length) !== null && _a !== void 0 ? _a : 1);
|
|
136
|
+
const newIndex = activeIndex === max - 1 ? 0 : activeIndex + 1;
|
|
137
|
+
updateActiveIndex(newIndex);
|
|
138
|
+
}, position: "absolute", right: "2", top: "50%", transform: "translateY(-50%)", variant: "ghost", colorScheme: "gray" })] }))] }), hasMultiple && (_jsxs(HStack, { spacing: 2, align: "center", justify: "center", children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, { size: 16, color: theme.colors.gray[500] }), "aria-label": "Scroll Left", onClick: () => handleThumbScroll("up"), isDisabled: !canScrollUp, variant: "ghost", size: "sm" }), visibleThumbnails === null || visibleThumbnails === void 0 ? void 0 : visibleThumbnails.map((src, index) => {
|
|
139
|
+
const actualIndex = thumbStartIndex + index;
|
|
140
|
+
const url = src.imageUrl;
|
|
141
|
+
const isVideo = src.isImage !== undefined ? src.isImage === false : isVideoUrl(url);
|
|
142
|
+
const thumb = src.thumb || getThumbForItem(url);
|
|
143
|
+
return (_jsx(Box, { w: `${thumbHeight}px`, h: `${thumbHeight}px`, borderRadius: "md", overflow: "hidden", cursor: "pointer", border: actualIndex === activeIndex
|
|
144
|
+
? `0.125rem solid ${theme.colors.gray[500]}`
|
|
145
|
+
: "0.125rem solid transparent", opacity: actualIndex === activeIndex ? 1 : 0.5, onClick: () => setActiveIndex(actualIndex), _hover: { opacity: 1 }, transition: "all 0.2s", position: "relative", children: isVideo ? (thumb ? (_jsxs(_Fragment, { children: [_jsx(Image, { src: thumb, w: "100%", h: "100%", objectFit: "cover" }), _jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", pointerEvents: "none", children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "md", p: 1.5, children: _jsx(Play, { size: 14, color: theme.colors.red[500] }) }) })] })) : (_jsx(Flex, { w: "100%", h: "100%", align: "center", justify: "center", bg: theme.colors.gray[100], children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "md", p: 1.5, children: _jsx(Play, { size: 14, color: theme.colors.red[500] }) }) }))) : (_jsx(Image, { src: url, w: "100%", h: "100%", objectFit: "cover" })) }, actualIndex));
|
|
146
|
+
}), _jsx(IconButton, { icon: _jsx(ChevronRight, { size: 16, color: theme.colors.gray[500] }), "aria-label": "Scroll Right", onClick: () => handleThumbScroll("down"), isDisabled: !canScrollDown, variant: "ghost", size: "sm" })] }))] })) : (_jsxs(_Fragment, { children: [hasMultiple && (_jsxs(Box, { w: `${thumbHeight}px`, h: `${thumbHeight * thumbnailsToShow}px`, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "space-between", borderRadius: "md", overflow: "hidden", children: [_jsx(IconButton, { icon: _jsx(ChevronUp, { size: 16, color: theme.colors.gray[500] }), "aria-label": "Scroll Up", onClick: () => handleThumbScroll("up"), isDisabled: !canScrollUp, variant: "ghost", size: "sm", m: 1 }), _jsx(VStack, { spacing: 2, flex: "1", overflow: "hidden", children: visibleThumbnails === null || visibleThumbnails === void 0 ? void 0 : visibleThumbnails.map((src, index) => {
|
|
147
|
+
const actualIndex = thumbStartIndex + index;
|
|
148
|
+
const url = src.imageUrl;
|
|
149
|
+
const isVideo = src.isImage !== undefined ? src.isImage === false : isVideoUrl(url);
|
|
150
|
+
const thumb = src.thumb || getThumbForItem(url);
|
|
151
|
+
return (_jsx(Box, { w: `${thumbHeight}px`, h: `${thumbHeight}px`, borderRadius: "md", overflow: "hidden", cursor: "pointer", border: actualIndex === activeIndex
|
|
152
|
+
? `0.125rem solid ${theme.colors.gray[500]}`
|
|
153
|
+
: "0.125rem solid transparent", opacity: actualIndex === activeIndex ? 1 : 0.5, onClick: () => setActiveIndex(actualIndex), _hover: { opacity: 1 }, transition: "all 0.2s", position: "relative", children: isVideo ? (thumb ? (_jsxs(_Fragment, { children: [_jsx(Image, { src: thumb, w: "100%", h: "100%", objectFit: "cover", alt: `Thumb ${actualIndex}` }), _jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", pointerEvents: "none", children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "md", p: 1.5, children: _jsx(Play, { size: 14, color: theme.colors.red[500] }) }) })] })) : (_jsx(Flex, { w: "100%", h: "100%", align: "center", justify: "center", bg: theme.colors.gray[100], children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "md", p: 1.5, children: _jsx(Play, { size: 14, color: theme.colors.red[500] }) }) }))) : (_jsx(Image, { src: url, w: "100%", h: "100%", objectFit: "cover", alt: `Thumb ${actualIndex}` })) }, actualIndex));
|
|
154
|
+
}) }), _jsx(IconButton, { icon: _jsx(ChevronDown, { size: 16, color: theme.colors.gray[500] }), "aria-label": "Scroll Down", onClick: () => handleThumbScroll("down"), isDisabled: !canScrollDown, variant: "ghost", size: "sm", m: 1 })] })), _jsxs(Box, { w: `${imageSize}px`, h: `${imageSize}px`, position: "relative", overflow: "hidden", borderRadius: "md", boxShadow: "md", onMouseMove: (e) => {
|
|
155
|
+
const bounds = e.currentTarget.getBoundingClientRect();
|
|
156
|
+
const x = ((e.clientX - bounds.left) / bounds.width) * 100;
|
|
157
|
+
const y = ((e.clientY - bounds.top) / bounds.height) * 100;
|
|
158
|
+
setTransformOrigin(`${x}% ${y}%`);
|
|
159
|
+
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => {
|
|
160
|
+
setIsHovered(false);
|
|
161
|
+
setTransformOrigin("center center");
|
|
162
|
+
}, children: [_jsx(Box, { position: "absolute", top: "2", left: "2", zIndex: "1", children: _jsx(Badge, { colorScheme: batch === null || batch === void 0 ? void 0 : batch.color, variant: "solid", children: batch === null || batch === void 0 ? void 0 : batch.label }) }), (() => {
|
|
163
|
+
const item = images === null || images === void 0 ? void 0 : images[activeIndex];
|
|
164
|
+
const url = (item === null || item === void 0 ? void 0 : item.imageUrl) || "";
|
|
165
|
+
const isVideo = (item === null || item === void 0 ? void 0 : item.isImage) !== undefined ? item.isImage === false : isVideoUrl(url);
|
|
166
|
+
const yt = getYouTubeId(url);
|
|
167
|
+
const vimeo = getVimeoId(url);
|
|
168
|
+
const dm = getDailymotionId(url);
|
|
169
|
+
const thumb = (item === null || item === void 0 ? void 0 : item.thumb) || getThumbForItem(url);
|
|
170
|
+
if (isVideo) {
|
|
171
|
+
if (!isPlaying) {
|
|
172
|
+
return (_jsxs(Box, { position: "relative", w: "100%", h: `${imageSize}px`, children: [_jsx(Image, { src: thumb || url, w: "100%", h: "100%", objectFit: "cover" }), _jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", children: _jsx(Box, { bg: theme.colors.background[50], borderRadius: "full", boxShadow: "lg", p: 3, cursor: "pointer", onClick: () => setIsPlaying(true), children: _jsx(Play, { size: 24, color: theme.colors.red[500] }) }) })] }));
|
|
173
|
+
}
|
|
174
|
+
return yt ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://www.youtube.com/embed/${yt}?rel=0&autoplay=1`, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, border: "0" }) })) : vimeo ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://player.vimeo.com/video/${vimeo}?autoplay=1`, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true, border: "0" }) })) : dm ? (_jsx(AspectRatio, { ratio: 16 / 9, w: "100%", children: _jsx(Box, { as: "iframe", src: `https://www.dailymotion.com/embed/video/${dm}?autoplay=1`, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true, border: "0" }) })) : (_jsx(Box, { as: "video", src: url, w: "100%", h: `${imageSize}px`, controls: true, autoPlay: true, sx: { objectFit: "contain", backgroundColor: "black" } }));
|
|
175
|
+
}
|
|
176
|
+
return (_jsx(Image, { src: url, w: "100%", h: "100%", objectFit: "cover", transformOrigin: transformOrigin, transform: isHovered ? "scale(1.6)" : "scale(1)", transition: "transform 0.3s ease", cursor: isHovered ? "zoom-in" : "default" }));
|
|
177
|
+
})(), hasMultiple && (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, { size: 20, color: theme.colors.gray[500] }), "aria-label": "Previous", onClick: () => {
|
|
178
|
+
var _a;
|
|
179
|
+
const max = ((_a = images === null || images === void 0 ? void 0 : images.length) !== null && _a !== void 0 ? _a : 1);
|
|
180
|
+
const newIndex = activeIndex === 0 ? max - 1 : activeIndex - 1;
|
|
181
|
+
updateActiveIndex(newIndex);
|
|
182
|
+
}, position: "absolute", left: "2", top: "50%", transform: "translateY(-50%)", variant: "ghost", colorScheme: "gray" }), _jsx(IconButton, { icon: _jsx(ChevronRight, { size: 20, color: theme.colors.gray[500] }), "aria-label": "Next", onClick: () => {
|
|
183
|
+
var _a;
|
|
184
|
+
const max = ((_a = images === null || images === void 0 ? void 0 : images.length) !== null && _a !== void 0 ? _a : 1);
|
|
185
|
+
const newIndex = activeIndex === max - 1 ? 0 : activeIndex + 1;
|
|
186
|
+
updateActiveIndex(newIndex);
|
|
187
|
+
}, position: "absolute", right: "2", top: "50%", transform: "translateY(-50%)", variant: "ghost", colorScheme: "gray" })] }))] })] })) }));
|
|
188
|
+
}
|