@campxdev/react-blueprint 3.0.0-alpha.4 → 3.0.0-alpha.6
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/cjs/index.js +1 -1
- package/dist/cjs/types/src/components/Assets/ErrorPages/ComingSoon.d.ts +24 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/InternalServerError.d.ts +20 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/NoInternetConnection.d.ts +20 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/NoItemFound.d.ts +28 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/PageNotFound.d.ts +21 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/ResourceNotFound.d.ts +21 -0
- package/dist/cjs/types/src/components/Assets/ErrorPages/UnAuthorized.d.ts +31 -0
- package/dist/cjs/types/src/components/Assets/Icons/Icons.d.ts +54 -0
- package/dist/cjs/types/src/components/Charts/BarChart/BarChart.d.ts +38 -0
- package/dist/cjs/types/src/components/Charts/BarChart/HorizontalBarChart.d.ts +93 -0
- package/dist/cjs/types/src/components/Charts/BarChart/VerticalBarChart.d.ts +110 -0
- package/dist/cjs/types/src/components/Charts/LineChart/LineChart.d.ts +89 -0
- package/dist/cjs/types/src/components/Charts/PieChart/PieChart.d.ts +86 -0
- package/dist/cjs/types/src/components/Charts/TreeMap/TreeMap.d.ts +74 -0
- package/dist/cjs/types/src/components/DataDisplay/Accordion/Accordion.d.ts +54 -0
- package/dist/cjs/types/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.d.ts +35 -0
- package/dist/cjs/types/src/components/DataDisplay/ActivityLogView/ActivityLogView.d.ts +78 -0
- package/dist/cjs/types/src/components/DataDisplay/Avatar/Avatar.d.ts +40 -0
- package/dist/cjs/types/src/components/DataDisplay/Chip/Chip.d.ts +28 -0
- package/dist/cjs/types/src/components/DataDisplay/Chips/Chips.d.ts +55 -0
- package/dist/cjs/types/src/components/DataDisplay/DataTable/DataTable.d.ts +95 -0
- package/dist/cjs/types/src/components/DataDisplay/DataTable/components/TablePagination.d.ts +35 -0
- package/dist/cjs/types/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.d.ts +30 -0
- package/dist/cjs/types/src/components/DataDisplay/ReactJoyride/ReactJoyride.d.ts +64 -0
- package/dist/cjs/types/src/components/DataDisplay/Separator/Separator.d.ts +30 -0
- package/dist/cjs/types/src/components/DataDisplay/Skeleton/Skeleton.d.ts +20 -0
- package/dist/cjs/types/src/components/DataDisplay/StatusCard/StatusCard.d.ts +36 -0
- package/dist/cjs/types/src/components/DataDisplay/Timeline/Timeline.d.ts +58 -0
- package/dist/cjs/types/src/components/DataDisplay/Typography/Typography.d.ts +25 -0
- package/dist/cjs/types/src/components/Feedback/Alert/Alert.d.ts +31 -0
- package/dist/cjs/types/src/components/Feedback/Snackbar/Snackbar.d.ts +54 -0
- package/dist/cjs/types/src/components/Feedback/Spinner/Spinner.d.ts +15 -0
- package/dist/cjs/types/src/components/Feedback/Tooltip/Tooltip.d.ts +54 -0
- package/dist/cjs/types/src/components/Input/Button/Button.d.ts +26 -0
- package/dist/cjs/types/src/components/Input/DatePicker/DatePicker.d.ts +43 -1
- package/dist/cjs/types/src/components/Input/DatePicker/components/DatePickerFilter.d.ts +2 -0
- package/dist/cjs/types/src/components/Input/DatePicker/components/DatePickerInput.d.ts +2 -0
- package/dist/cjs/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +44 -1
- package/dist/cjs/types/src/components/Input/DateTimePicker/components/DateTimePickerFilter.d.ts +2 -0
- package/dist/cjs/types/src/components/Input/DateTimePicker/components/DateTimePickerInput.d.ts +2 -0
- package/dist/cjs/types/src/components/Input/FileUpload/FileUpload.d.ts +41 -0
- package/dist/cjs/types/src/components/Input/FormActions/FormActions.d.ts +37 -0
- package/dist/cjs/types/src/components/Input/FormControlWrapper/FormControlWrapper.d.ts +31 -0
- package/dist/cjs/types/src/components/Input/FormWrapper/FormWrapper.d.ts +20 -0
- package/dist/cjs/types/src/components/Input/HelpButton/HelpButton.d.ts +14 -0
- package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/DeleteButton.d.ts +16 -0
- package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/EditButton.d.ts +16 -0
- package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/RedirectButton.d.ts +16 -0
- package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/ViewButton.d.ts +16 -0
- package/dist/cjs/types/src/components/Input/IconButtons/IconButtons.d.ts +18 -0
- package/dist/cjs/types/src/components/Input/LabelWrapper/LabelWrapper.d.ts +26 -0
- package/dist/cjs/types/src/components/Input/MultiCheckBox/MultiCheckBox.d.ts +34 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/MultiSelect.d.ts +42 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiSelectFilter.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiSelectInput.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/OtpInput/OtpInput.d.ts +29 -0
- package/dist/cjs/types/src/components/Input/PasswordField/PasswordField.d.ts +34 -0
- package/dist/cjs/types/src/components/Input/RadioGroup/RadioGroup.d.ts +38 -0
- package/dist/cjs/types/src/components/Input/SearchBar/SearchBar.d.ts +26 -0
- package/dist/cjs/types/src/components/Input/Select/Select.d.ts +34 -1
- package/dist/cjs/types/src/components/Input/SingleCheckBox/SingleCheckBox.d.ts +29 -0
- package/dist/cjs/types/src/components/Input/SingleSelect/SingleSelect.d.ts +42 -0
- package/dist/cjs/types/src/components/Input/SingleSelect/components/SingleFilter.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/SingleSelect/components/SingleInput.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/Switch/Switch.d.ts +23 -0
- package/dist/cjs/types/src/components/Input/Tags/Tags.d.ts +26 -0
- package/dist/cjs/types/src/components/Input/TextField/TextField.d.ts +35 -0
- package/dist/cjs/types/src/components/Input/Textarea/Textarea.d.ts +36 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/AppLayout.d.ts +32 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/MenuToggleButton.d.ts +16 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/MenuBar.d.ts +26 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/MenuItem.d.ts +37 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +30 -1
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.d.ts +139 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +34 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/context/SidebarContext.d.ts +48 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/types.d.ts +1 -1
- package/dist/cjs/types/src/components/Layout/PageContent/PageContent.d.ts +19 -0
- package/dist/cjs/types/src/components/Layout/PageHeader/PageHeader.d.ts +46 -0
- package/dist/cjs/types/src/components/Layout/PageHeader/components/SearchBar.d.ts +22 -0
- package/dist/cjs/types/src/components/Layout/UserBox/UserBox.d.ts +40 -0
- package/dist/cjs/types/src/components/Navigation/Breadcrumbs/Breadcrumbs.d.ts +33 -0
- package/dist/cjs/types/src/components/Navigation/Calendar/Calendar.d.ts +63 -0
- package/dist/cjs/types/src/components/Navigation/ConfirmDialog/ConfirmDialog.d.ts +64 -0
- package/dist/cjs/types/src/components/Navigation/Dialog/Dialog.d.ts +55 -0
- package/dist/cjs/types/src/components/Navigation/DialogButton/DialogButton.d.ts +64 -0
- package/dist/cjs/types/src/components/Navigation/DropDownMenu/DropDownMenu.d.ts +73 -0
- package/dist/cjs/types/src/components/Navigation/PreviewFiles/PreviewFiles.d.ts +54 -0
- package/dist/cjs/types/src/components/Navigation/Stepper/Stepper.d.ts +55 -10
- package/dist/cjs/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +80 -0
- package/dist/cjs/types/src/components/Navigation/UploadDialog/UploadDialog.d.ts +64 -0
- package/dist/cjs/types/src/shadcn-components/Input/Select/Select.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/Assets/ErrorPages/ComingSoon.d.ts +24 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/InternalServerError.d.ts +20 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/NoInternetConnection.d.ts +20 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/NoItemFound.d.ts +28 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/PageNotFound.d.ts +21 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/ResourceNotFound.d.ts +21 -0
- package/dist/esm/types/src/components/Assets/ErrorPages/UnAuthorized.d.ts +31 -0
- package/dist/esm/types/src/components/Assets/Icons/Icons.d.ts +54 -0
- package/dist/esm/types/src/components/Charts/BarChart/BarChart.d.ts +38 -0
- package/dist/esm/types/src/components/Charts/BarChart/HorizontalBarChart.d.ts +93 -0
- package/dist/esm/types/src/components/Charts/BarChart/VerticalBarChart.d.ts +110 -0
- package/dist/esm/types/src/components/Charts/LineChart/LineChart.d.ts +89 -0
- package/dist/esm/types/src/components/Charts/PieChart/PieChart.d.ts +86 -0
- package/dist/esm/types/src/components/Charts/TreeMap/TreeMap.d.ts +74 -0
- package/dist/esm/types/src/components/DataDisplay/Accordion/Accordion.d.ts +54 -0
- package/dist/esm/types/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.d.ts +35 -0
- package/dist/esm/types/src/components/DataDisplay/ActivityLogView/ActivityLogView.d.ts +78 -0
- package/dist/esm/types/src/components/DataDisplay/Avatar/Avatar.d.ts +40 -0
- package/dist/esm/types/src/components/DataDisplay/Chip/Chip.d.ts +28 -0
- package/dist/esm/types/src/components/DataDisplay/Chips/Chips.d.ts +55 -0
- package/dist/esm/types/src/components/DataDisplay/DataTable/DataTable.d.ts +95 -0
- package/dist/esm/types/src/components/DataDisplay/DataTable/components/TablePagination.d.ts +35 -0
- package/dist/esm/types/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.d.ts +30 -0
- package/dist/esm/types/src/components/DataDisplay/ReactJoyride/ReactJoyride.d.ts +64 -0
- package/dist/esm/types/src/components/DataDisplay/Separator/Separator.d.ts +30 -0
- package/dist/esm/types/src/components/DataDisplay/Skeleton/Skeleton.d.ts +20 -0
- package/dist/esm/types/src/components/DataDisplay/StatusCard/StatusCard.d.ts +36 -0
- package/dist/esm/types/src/components/DataDisplay/Timeline/Timeline.d.ts +58 -0
- package/dist/esm/types/src/components/DataDisplay/Typography/Typography.d.ts +25 -0
- package/dist/esm/types/src/components/Feedback/Alert/Alert.d.ts +31 -0
- package/dist/esm/types/src/components/Feedback/Snackbar/Snackbar.d.ts +54 -0
- package/dist/esm/types/src/components/Feedback/Spinner/Spinner.d.ts +15 -0
- package/dist/esm/types/src/components/Feedback/Tooltip/Tooltip.d.ts +54 -0
- package/dist/esm/types/src/components/Input/Button/Button.d.ts +26 -0
- package/dist/esm/types/src/components/Input/DatePicker/DatePicker.d.ts +43 -1
- package/dist/esm/types/src/components/Input/DatePicker/components/DatePickerFilter.d.ts +2 -0
- package/dist/esm/types/src/components/Input/DatePicker/components/DatePickerInput.d.ts +2 -0
- package/dist/esm/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +44 -1
- package/dist/esm/types/src/components/Input/DateTimePicker/components/DateTimePickerFilter.d.ts +2 -0
- package/dist/esm/types/src/components/Input/DateTimePicker/components/DateTimePickerInput.d.ts +2 -0
- package/dist/esm/types/src/components/Input/FileUpload/FileUpload.d.ts +41 -0
- package/dist/esm/types/src/components/Input/FormActions/FormActions.d.ts +37 -0
- package/dist/esm/types/src/components/Input/FormControlWrapper/FormControlWrapper.d.ts +31 -0
- package/dist/esm/types/src/components/Input/FormWrapper/FormWrapper.d.ts +20 -0
- package/dist/esm/types/src/components/Input/HelpButton/HelpButton.d.ts +14 -0
- package/dist/esm/types/src/components/Input/IconButtons/IconButtons/DeleteButton.d.ts +16 -0
- package/dist/esm/types/src/components/Input/IconButtons/IconButtons/EditButton.d.ts +16 -0
- package/dist/esm/types/src/components/Input/IconButtons/IconButtons/RedirectButton.d.ts +16 -0
- package/dist/esm/types/src/components/Input/IconButtons/IconButtons/ViewButton.d.ts +16 -0
- package/dist/esm/types/src/components/Input/IconButtons/IconButtons.d.ts +18 -0
- package/dist/esm/types/src/components/Input/LabelWrapper/LabelWrapper.d.ts +26 -0
- package/dist/esm/types/src/components/Input/MultiCheckBox/MultiCheckBox.d.ts +34 -0
- package/dist/esm/types/src/components/Input/MultiSelect/MultiSelect.d.ts +42 -0
- package/dist/esm/types/src/components/Input/MultiSelect/components/MultiSelectFilter.d.ts +1 -1
- package/dist/esm/types/src/components/Input/MultiSelect/components/MultiSelectInput.d.ts +1 -1
- package/dist/esm/types/src/components/Input/OtpInput/OtpInput.d.ts +29 -0
- package/dist/esm/types/src/components/Input/PasswordField/PasswordField.d.ts +34 -0
- package/dist/esm/types/src/components/Input/RadioGroup/RadioGroup.d.ts +38 -0
- package/dist/esm/types/src/components/Input/SearchBar/SearchBar.d.ts +26 -0
- package/dist/esm/types/src/components/Input/Select/Select.d.ts +34 -1
- package/dist/esm/types/src/components/Input/SingleCheckBox/SingleCheckBox.d.ts +29 -0
- package/dist/esm/types/src/components/Input/SingleSelect/SingleSelect.d.ts +42 -0
- package/dist/esm/types/src/components/Input/SingleSelect/components/SingleFilter.d.ts +1 -1
- package/dist/esm/types/src/components/Input/SingleSelect/components/SingleInput.d.ts +1 -1
- package/dist/esm/types/src/components/Input/Switch/Switch.d.ts +23 -0
- package/dist/esm/types/src/components/Input/Tags/Tags.d.ts +26 -0
- package/dist/esm/types/src/components/Input/TextField/TextField.d.ts +35 -0
- package/dist/esm/types/src/components/Input/Textarea/Textarea.d.ts +36 -0
- package/dist/esm/types/src/components/Layout/AppLayout/AppLayout.d.ts +32 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/MenuToggleButton.d.ts +16 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/MenuBar.d.ts +26 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/MenuItem.d.ts +37 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +30 -1
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.d.ts +139 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +34 -0
- package/dist/esm/types/src/components/Layout/AppLayout/context/SidebarContext.d.ts +48 -0
- package/dist/esm/types/src/components/Layout/AppLayout/types.d.ts +1 -1
- package/dist/esm/types/src/components/Layout/PageContent/PageContent.d.ts +19 -0
- package/dist/esm/types/src/components/Layout/PageHeader/PageHeader.d.ts +46 -0
- package/dist/esm/types/src/components/Layout/PageHeader/components/SearchBar.d.ts +22 -0
- package/dist/esm/types/src/components/Layout/UserBox/UserBox.d.ts +40 -0
- package/dist/esm/types/src/components/Navigation/Breadcrumbs/Breadcrumbs.d.ts +33 -0
- package/dist/esm/types/src/components/Navigation/Calendar/Calendar.d.ts +63 -0
- package/dist/esm/types/src/components/Navigation/ConfirmDialog/ConfirmDialog.d.ts +64 -0
- package/dist/esm/types/src/components/Navigation/Dialog/Dialog.d.ts +55 -0
- package/dist/esm/types/src/components/Navigation/DialogButton/DialogButton.d.ts +64 -0
- package/dist/esm/types/src/components/Navigation/DropDownMenu/DropDownMenu.d.ts +73 -0
- package/dist/esm/types/src/components/Navigation/PreviewFiles/PreviewFiles.d.ts +54 -0
- package/dist/esm/types/src/components/Navigation/Stepper/Stepper.d.ts +55 -10
- package/dist/esm/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +80 -0
- package/dist/esm/types/src/components/Navigation/UploadDialog/UploadDialog.d.ts +64 -0
- package/dist/esm/types/src/shadcn-components/Input/Select/Select.d.ts +2 -2
- package/dist/index.d.ts +2963 -15
- package/dist/styles.css +402 -13
- package/package.json +1 -1
- package/src/components/Assets/ErrorPages/ComingSoon.tsx +24 -0
- package/src/components/Assets/ErrorPages/InternalServerError.tsx +20 -0
- package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +20 -0
- package/src/components/Assets/ErrorPages/NoItemFound.tsx +28 -0
- package/src/components/Assets/ErrorPages/PageNotFound.tsx +21 -0
- package/src/components/Assets/ErrorPages/ResourceNotFound.tsx +21 -0
- package/src/components/Assets/ErrorPages/UnAuthorized.tsx +31 -0
- package/src/components/Assets/Icons/Icons.tsx +55 -1
- package/src/components/Charts/BarChart/BarChart.tsx +38 -0
- package/src/components/Charts/BarChart/HorizontalBarChart.tsx +93 -0
- package/src/components/Charts/BarChart/VerticalBarChart.tsx +110 -0
- package/src/components/Charts/LineChart/LineChart.tsx +89 -0
- package/src/components/Charts/PieChart/PieChart.tsx +86 -0
- package/src/components/Charts/TreeMap/TreeMap.tsx +90 -0
- package/src/components/DataDisplay/Accordion/Accordion.tsx +54 -0
- package/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.tsx +35 -0
- package/src/components/DataDisplay/ActivityLogView/ActivityLogView.tsx +84 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +40 -0
- package/src/components/DataDisplay/Chip/Chip.tsx +28 -0
- package/src/components/DataDisplay/Chips/Chips.tsx +56 -0
- package/src/components/DataDisplay/DataTable/DataTable.tsx +95 -0
- package/src/components/DataDisplay/DataTable/components/TablePagination.tsx +35 -0
- package/src/components/DataDisplay/DataTable/components/TableView.tsx +31 -5
- package/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.tsx +31 -0
- package/src/components/DataDisplay/ReactJoyride/ReactJoyride.tsx +64 -0
- package/src/components/DataDisplay/Separator/Separator.tsx +32 -0
- package/src/components/DataDisplay/Skeleton/Skeleton.tsx +20 -0
- package/src/components/DataDisplay/StatusCard/StatusCard.tsx +36 -0
- package/src/components/DataDisplay/Timeline/Timeline.tsx +58 -0
- package/src/components/DataDisplay/Typography/Typography.tsx +25 -0
- package/src/components/Feedback/Alert/Alert.tsx +38 -0
- package/src/components/Feedback/Snackbar/Snackbar.tsx +54 -0
- package/src/components/Feedback/Spinner/Spinner.tsx +15 -0
- package/src/components/Feedback/Tooltip/Tooltip.tsx +71 -3
- package/src/components/Input/Button/Button.tsx +26 -0
- package/src/components/Input/Button/ButtonLoader.css +2 -2
- package/src/components/Input/DatePicker/DatePicker.tsx +50 -188
- package/src/components/Input/DatePicker/components/DatePickerFilter.tsx +178 -0
- package/src/components/Input/DatePicker/components/DatePickerInput.tsx +192 -0
- package/src/components/Input/DateTimePicker/DateTimePicker.tsx +50 -294
- package/src/components/Input/DateTimePicker/components/DateTimePickerFilter.tsx +292 -0
- package/src/components/Input/DateTimePicker/components/DateTimePickerInput.tsx +297 -0
- package/src/components/Input/FileUpload/FileUpload.tsx +41 -0
- package/src/components/Input/FormActions/FormActions.tsx +37 -0
- package/src/components/Input/FormControlWrapper/FormControlWrapper.tsx +31 -0
- package/src/components/Input/FormWrapper/FormWrapper.tsx +20 -0
- package/src/components/Input/HelpButton/HelpButton.tsx +14 -0
- package/src/components/Input/IconButtons/IconButtons/DeleteButton.tsx +16 -0
- package/src/components/Input/IconButtons/IconButtons/EditButton.tsx +16 -0
- package/src/components/Input/IconButtons/IconButtons/RedirectButton.tsx +16 -0
- package/src/components/Input/IconButtons/IconButtons/ViewButton.tsx +16 -0
- package/src/components/Input/IconButtons/IconButtons.tsx +18 -0
- package/src/components/Input/LabelWrapper/LabelWrapper.tsx +26 -0
- package/src/components/Input/MultiCheckBox/MultiCheckBox.tsx +34 -0
- package/src/components/Input/MultiSelect/MultiSelect.tsx +42 -0
- package/src/components/Input/MultiSelect/components/MultiSelectFilter.tsx +7 -3
- package/src/components/Input/MultiSelect/components/MultiSelectInput.tsx +8 -3
- package/src/components/Input/OtpInput/OtpInput.tsx +29 -0
- package/src/components/Input/PasswordField/PasswordField.tsx +34 -0
- package/src/components/Input/RadioGroup/RadioGroup.tsx +38 -0
- package/src/components/Input/SearchBar/SearchBar.tsx +26 -0
- package/src/components/Input/Select/Select.tsx +63 -12
- package/src/components/Input/SingleCheckBox/SingleCheckBox.tsx +29 -0
- package/src/components/Input/SingleSelect/SingleSelect.tsx +42 -0
- package/src/components/Input/SingleSelect/components/SingleFilter.tsx +7 -3
- package/src/components/Input/SingleSelect/components/SingleInput.tsx +8 -3
- package/src/components/Input/Switch/Switch.tsx +23 -0
- package/src/components/Input/Tags/Tags.tsx +26 -0
- package/src/components/Input/TextField/TextField.tsx +35 -0
- package/src/components/Input/Textarea/Textarea.tsx +36 -0
- package/src/components/Layout/AppLayout/AppLayout.tsx +33 -1
- package/src/components/Layout/AppLayout/components/MenuToggleButton.tsx +16 -0
- package/src/components/Layout/AppLayout/components/Sidebar/MenuBar.tsx +26 -0
- package/src/components/Layout/AppLayout/components/Sidebar/MenuItem.tsx +51 -1
- package/src/components/Layout/AppLayout/components/Sidebar/Sidebar.tsx +173 -104
- package/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.tsx +139 -9
- package/src/components/Layout/AppLayout/components/UserProfilePopup.tsx +34 -0
- package/src/components/Layout/AppLayout/context/SidebarContext.tsx +48 -0
- package/src/components/Layout/AppLayout/types.ts +1 -1
- package/src/components/Layout/PageContent/PageContent.tsx +19 -0
- package/src/components/Layout/PageHeader/PageHeader.tsx +46 -0
- package/src/components/Layout/PageHeader/components/SearchBar.tsx +22 -0
- package/src/components/Layout/UserBox/UserBox.tsx +40 -0
- package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +33 -0
- package/src/components/Navigation/Calendar/Calendar.tsx +63 -0
- package/src/components/Navigation/ConfirmDialog/ConfirmDialog.tsx +64 -0
- package/src/components/Navigation/Dialog/Dialog.tsx +55 -0
- package/src/components/Navigation/DialogButton/DialogButton.tsx +70 -1
- package/src/components/Navigation/DropDownMenu/DropDownMenu.tsx +74 -1
- package/src/components/Navigation/PreviewFiles/PreviewFiles.tsx +93 -0
- package/src/components/Navigation/Stepper/Stepper.tsx +56 -10
- package/src/components/Navigation/TabsContainer/TabsContainer.tsx +81 -1
- package/src/components/Navigation/UploadDialog/UploadDialog.tsx +64 -0
- package/src/shadcn-components/DataDisplay/Dialog/Dialog.tsx +2 -2
- package/src/shadcn-components/Input/Popover/Popover.tsx +1 -1
- package/src/shadcn-components/Input/Select/Select.tsx +8 -8
- package/src/shadcn-components/Layout/Sheet/Sheet.tsx +2 -2
- package/src/shadcn-components/Navigation/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/styles/globals.css +4 -2
- package/src/styles/index.css +5 -0
|
@@ -3,22 +3,86 @@ import { Typography } from '@/shadcn-components/DataDisplay/Typography/Typograph
|
|
|
3
3
|
import { Button } from '@/shadcn-components/Input/Button/Button';
|
|
4
4
|
import { AnimatedGIFs } from '../../../assets/images/gif';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Type definition for the kind of confirmation dialog
|
|
8
|
+
*/
|
|
6
9
|
export type ConfirmDialogType = 'confirm' | 'delete';
|
|
7
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Available max-width sizes for the dialog
|
|
13
|
+
*/
|
|
8
14
|
type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
9
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Props for the ConfirmDialog component
|
|
18
|
+
*/
|
|
10
19
|
export type ConfirmDialogProps = {
|
|
20
|
+
/** Whether the dialog is open and visible */
|
|
11
21
|
isOpen: boolean;
|
|
22
|
+
/** Title text displayed in the dialog header */
|
|
12
23
|
title: string;
|
|
24
|
+
/** Message/description text displayed in the dialog */
|
|
13
25
|
message: string;
|
|
26
|
+
/** Callback function triggered when the user confirms the action */
|
|
14
27
|
onConfirm: () => void;
|
|
28
|
+
/** Callback function triggered when the user cancels the dialog */
|
|
15
29
|
onCancel: () => void;
|
|
30
|
+
/** Type of confirmation dialog - 'confirm' for general confirmations, 'delete' for destructive actions */
|
|
16
31
|
type: ConfirmDialogType;
|
|
32
|
+
/** Custom text for the confirm button. Defaults to 'Confirm Delete' for delete type, 'Confirm' otherwise */
|
|
17
33
|
confirmButtonText?: string;
|
|
34
|
+
/** Custom text for the cancel button. Defaults to 'Cancel' */
|
|
18
35
|
cancelButtonText?: string;
|
|
36
|
+
/** Max-width size class of the dialog. Defaults to 'xl' */
|
|
19
37
|
maxWidth?: MaxWidthSize;
|
|
20
38
|
};
|
|
21
39
|
|
|
40
|
+
/**
|
|
41
|
+
* ConfirmDialog component that displays a modal confirmation dialog with custom title, message, and action buttons.
|
|
42
|
+
*
|
|
43
|
+
* This component provides a user-friendly confirmation interface with support for two types:
|
|
44
|
+
* 'confirm' for general confirmations and 'delete' for destructive operations. The dialog
|
|
45
|
+
* includes an animated GIF icon that changes based on the dialog type.
|
|
46
|
+
*
|
|
47
|
+
* @component
|
|
48
|
+
* @param {ConfirmDialogProps} props - The component props
|
|
49
|
+
* @param {boolean} props.isOpen - Whether the dialog is currently open
|
|
50
|
+
* @param {string} props.title - Dialog title text
|
|
51
|
+
* @param {string} props.message - Dialog message/body text
|
|
52
|
+
* @param {() => void} props.onConfirm - Callback fired when the confirm button is clicked
|
|
53
|
+
* @param {() => void} props.onCancel - Callback fired when the cancel button is clicked or dialog is closed
|
|
54
|
+
* @param {ConfirmDialogType} props.type - Dialog type ('confirm' or 'delete') which affects styling and default text
|
|
55
|
+
* @param {string} [props.confirmButtonText] - Custom text for confirm button
|
|
56
|
+
* @param {string} [props.cancelButtonText] - Custom text for cancel button
|
|
57
|
+
* @param {MaxWidthSize} [props.maxWidth='xl'] - Maximum width of the dialog
|
|
58
|
+
*
|
|
59
|
+
* @returns {React.ReactElement} A Dialog component with header, message, and action buttons
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Basic confirmation dialog
|
|
63
|
+
* <ConfirmDialog
|
|
64
|
+
* isOpen={isOpen}
|
|
65
|
+
* type="confirm"
|
|
66
|
+
* title="Confirm Action"
|
|
67
|
+
* message="Are you sure you want to proceed?"
|
|
68
|
+
* onConfirm={() => handleAction()}
|
|
69
|
+
* onCancel={() => setIsOpen(false)}
|
|
70
|
+
* />
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Delete confirmation dialog with custom buttons
|
|
74
|
+
* <ConfirmDialog
|
|
75
|
+
* isOpen={deleteOpen}
|
|
76
|
+
* type="delete"
|
|
77
|
+
* title="Delete Item"
|
|
78
|
+
* message="This action cannot be undone. All data will be permanently deleted."
|
|
79
|
+
* confirmButtonText="Yes, Delete"
|
|
80
|
+
* cancelButtonText="Keep Item"
|
|
81
|
+
* onConfirm={() => deleteItem()}
|
|
82
|
+
* onCancel={() => setDeleteOpen(false)}
|
|
83
|
+
* maxWidth="md"
|
|
84
|
+
* />
|
|
85
|
+
*/
|
|
22
86
|
export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
|
23
87
|
isOpen,
|
|
24
88
|
title,
|
|
@@ -1,18 +1,73 @@
|
|
|
1
1
|
import { DialogHeader, Dialog as ShadcnDialog, DialogContent as ShadcnDialogContent, DialogTitle as ShadcnDialogTitle } from '@/shadcn-components/DataDisplay/Dialog/Dialog';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Available max-width sizes for the dialog
|
|
6
|
+
*/
|
|
4
7
|
type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Props for the Dialog component
|
|
11
|
+
*/
|
|
6
12
|
type DialogProps = {
|
|
13
|
+
/** Function that renders the dialog content. Receives close callback to allow closing from within content */
|
|
7
14
|
content: (props: { close: () => void }) => ReactNode;
|
|
15
|
+
/** Optional title displayed in the dialog header */
|
|
8
16
|
title?: string | undefined;
|
|
17
|
+
/** Callback function triggered when the dialog is closed */
|
|
9
18
|
onClose: () => void;
|
|
19
|
+
/** Whether the dialog is open and visible */
|
|
10
20
|
open: boolean;
|
|
21
|
+
/** Optional CSS class names for the dialog content element */
|
|
11
22
|
className?: string;
|
|
23
|
+
/** Whether to show the close button in the dialog header. Defaults to true */
|
|
12
24
|
showCloseButton?: boolean;
|
|
25
|
+
/** Max-width size class of the dialog. Defaults to 'lg' */
|
|
13
26
|
maxWidth?: MaxWidthSize;
|
|
14
27
|
};
|
|
15
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Dialog component that wraps shadcn/ui Dialog with additional features and sensible defaults.
|
|
31
|
+
*
|
|
32
|
+
* This component provides a controlled dialog with optional header, configurable width,
|
|
33
|
+
* and flexible content rendering with a close callback for self-closing from within the content.
|
|
34
|
+
*
|
|
35
|
+
* @component
|
|
36
|
+
* @param {DialogProps} props - The component props
|
|
37
|
+
* @param {(props: { close: () => void }) => ReactNode} props.content - Render function for dialog content
|
|
38
|
+
* @param {() => void} props.onClose - Callback fired when the dialog is closed
|
|
39
|
+
* @param {boolean} props.open - Whether the dialog is currently open
|
|
40
|
+
* @param {string} [props.title] - Optional dialog title
|
|
41
|
+
* @param {string} [props.className] - Optional CSS classes for the dialog content
|
|
42
|
+
* @param {boolean} [props.showCloseButton=true] - Whether to show the close button
|
|
43
|
+
* @param {MaxWidthSize} [props.maxWidth='lg'] - Maximum width of the dialog
|
|
44
|
+
*
|
|
45
|
+
* @returns {React.ReactElement} A Dialog component with optional header and flexible content
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Simple dialog with title
|
|
49
|
+
* <Dialog
|
|
50
|
+
* open={isOpen}
|
|
51
|
+
* title="Delete Item"
|
|
52
|
+
* onClose={() => setIsOpen(false)}
|
|
53
|
+
* content={({ close }) => (
|
|
54
|
+
* <div>
|
|
55
|
+
* <p>Are you sure?</p>
|
|
56
|
+
* <button onClick={close}>Cancel</button>
|
|
57
|
+
* </div>
|
|
58
|
+
* )}
|
|
59
|
+
* />
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Dialog without title and custom width
|
|
63
|
+
* <Dialog
|
|
64
|
+
* open={showDialog}
|
|
65
|
+
* onClose={handleClose}
|
|
66
|
+
* maxWidth="sm"
|
|
67
|
+
* showCloseButton={false}
|
|
68
|
+
* content={({ close }) => <FormComponent onSubmit={close} />}
|
|
69
|
+
* />
|
|
70
|
+
*/
|
|
16
71
|
const Dialog = ({
|
|
17
72
|
onClose,
|
|
18
73
|
title,
|
|
@@ -1,19 +1,88 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DialogHeader,
|
|
3
|
+
Dialog as ShadcnDialog,
|
|
4
|
+
DialogContent as ShadcnDialogContent,
|
|
5
|
+
DialogTitle as ShadcnDialogTitle,
|
|
6
|
+
} from '@/shadcn-components/DataDisplay/Dialog/Dialog';
|
|
2
7
|
import { ReactNode, useState } from 'react';
|
|
3
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Available max-width sizes for the dialog
|
|
11
|
+
*/
|
|
4
12
|
type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Props for the DialogButton component
|
|
16
|
+
*/
|
|
6
17
|
export type DialogButtonProps = {
|
|
18
|
+
/** Function that renders the dialog trigger element. Receives open callback to open the dialog */
|
|
7
19
|
anchor: (props: { open: () => void }) => ReactNode;
|
|
20
|
+
/** Optional callback fired when the dialog opens */
|
|
8
21
|
onDialogOpen?: () => void;
|
|
22
|
+
/** Optional callback fired when the dialog closes */
|
|
9
23
|
onDialogClose?: () => void;
|
|
24
|
+
/** Function that renders the dialog content. Receives close callback to close the dialog */
|
|
10
25
|
content: (props: { close: () => void }) => ReactNode;
|
|
26
|
+
/** Optional title displayed in the dialog header */
|
|
11
27
|
title?: string | undefined;
|
|
28
|
+
/** Optional CSS class names for the dialog content element */
|
|
12
29
|
className?: string;
|
|
30
|
+
/** Whether to show the close button in the dialog header. Defaults to true */
|
|
13
31
|
showCloseButton?: boolean;
|
|
32
|
+
/** Max-width size class of the dialog. Defaults to 'lg' */
|
|
14
33
|
maxWidth?: MaxWidthSize;
|
|
15
34
|
};
|
|
16
35
|
|
|
36
|
+
/**
|
|
37
|
+
* DialogButton component that combines a trigger element and a dialog in a single component.
|
|
38
|
+
*
|
|
39
|
+
* This is a convenient wrapper that manages its own open/close state and provides
|
|
40
|
+
* a clean API for rendering both the trigger (anchor) and the dialog content.
|
|
41
|
+
* It's useful when you want to bind a button or other trigger element with a dialog
|
|
42
|
+
* without managing state at the parent level.
|
|
43
|
+
*
|
|
44
|
+
* @component
|
|
45
|
+
* @param {DialogButtonProps} props - The component props
|
|
46
|
+
* @param {(props: { open: () => void }) => ReactNode} props.anchor - Render function for the trigger element
|
|
47
|
+
* @param {(props: { close: () => void }) => ReactNode} props.content - Render function for dialog content
|
|
48
|
+
* @param {string} [props.title] - Optional dialog title
|
|
49
|
+
* @param {() => void} [props.onDialogOpen] - Optional callback fired when the dialog opens
|
|
50
|
+
* @param {() => void} [props.onDialogClose] - Optional callback fired when the dialog closes
|
|
51
|
+
* @param {string} [props.className] - Optional CSS classes for the dialog content
|
|
52
|
+
* @param {boolean} [props.showCloseButton=true] - Whether to show the close button
|
|
53
|
+
* @param {MaxWidthSize} [props.maxWidth='lg'] - Maximum width of the dialog
|
|
54
|
+
*
|
|
55
|
+
* @returns {React.ReactElement} A fragment containing the anchor element and the Dialog
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Button that opens a dialog with a form
|
|
59
|
+
* <DialogButton
|
|
60
|
+
* anchor={({ open }) => <button onClick={open}>Edit Profile</button>}
|
|
61
|
+
* title="Edit Profile"
|
|
62
|
+
* content={({ close }) => (
|
|
63
|
+
* <form onSubmit={(e) => { handleSubmit(e); close(); }}>
|
|
64
|
+
* <input type="text" placeholder="Name" />
|
|
65
|
+
* <button type="submit">Save</button>
|
|
66
|
+
* </form>
|
|
67
|
+
* )}
|
|
68
|
+
* />
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // With callbacks and custom styling
|
|
72
|
+
* <DialogButton
|
|
73
|
+
* anchor={({ open }) => <IconButton icon={<EditIcon />} onClick={open} />}
|
|
74
|
+
* title="Delete Item"
|
|
75
|
+
* maxWidth="sm"
|
|
76
|
+
* onDialogOpen={() => console.log('Dialog opened')}
|
|
77
|
+
* onDialogClose={() => console.log('Dialog closed')}
|
|
78
|
+
* content={({ close }) => (
|
|
79
|
+
* <div>
|
|
80
|
+
* <p>Are you sure?</p>
|
|
81
|
+
* <button onClick={close}>Cancel</button>
|
|
82
|
+
* </div>
|
|
83
|
+
* )}
|
|
84
|
+
* />
|
|
85
|
+
*/
|
|
17
86
|
export const DialogButton = ({
|
|
18
87
|
onDialogClose,
|
|
19
88
|
onDialogOpen,
|
|
@@ -7,20 +7,93 @@ import {
|
|
|
7
7
|
} from '@/shadcn-components/Navigation/DropdownMenu/DropdownMenu';
|
|
8
8
|
import { ReactNode, useEffect, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Props for the DropdownMenu component
|
|
12
|
+
*/
|
|
10
13
|
export type DropdownMenuProps = {
|
|
14
|
+
/** Function that renders the dropdown trigger element. Receives open callback to open the dropdown */
|
|
11
15
|
anchor: (props: { open: (e: any) => void }) => ReactNode;
|
|
16
|
+
/** Array of menu items or a function that returns menu items. Can be static or dynamic */
|
|
12
17
|
menu?: ReactNode[] | ((props: { close: () => void }) => ReactNode[]);
|
|
18
|
+
/** Custom slot for rendering the entire menu content. Takes precedence over menu when useMenuSlot is true */
|
|
13
19
|
menuSlot?: (props: { close: () => void }) => ReactNode;
|
|
20
|
+
/** Whether to use menuSlot instead of menu items. Defaults to false */
|
|
14
21
|
useMenuSlot?: boolean;
|
|
22
|
+
/** Optional CSS class names for the menu content container */
|
|
15
23
|
menuContentClassName?: string;
|
|
24
|
+
/** Optional CSS class names for the menu list wrapper div */
|
|
16
25
|
menuListClassName?: string;
|
|
26
|
+
/** Optional React element or component to render above the menu items */
|
|
17
27
|
menuHeader?: ReactNode;
|
|
28
|
+
/** Optional React element or component to render below the menu items */
|
|
18
29
|
menuFooter?: ReactNode;
|
|
30
|
+
/** Optional async callback fired when the menu is scrolled, useful for infinite scroll */
|
|
19
31
|
handleMenuScroll?: (event: any) => Promise<void>;
|
|
32
|
+
/** Horizontal alignment of the dropdown menu relative to the trigger. Defaults to 'end' */
|
|
20
33
|
align?: 'start' | 'center' | 'end';
|
|
34
|
+
/** Vertical placement of the dropdown menu relative to the trigger. Defaults to 'bottom' */
|
|
21
35
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
22
36
|
};
|
|
23
37
|
|
|
38
|
+
/**
|
|
39
|
+
* DropdownMenu component that provides a flexible dropdown menu with trigger element and menu content.
|
|
40
|
+
*
|
|
41
|
+
* This component wraps shadcn/ui's DropdownMenu and adds support for dynamic menu items,
|
|
42
|
+
* header/footer sections, and custom scroll handling. It manages its own open/close state
|
|
43
|
+
* and provides a convenient API for both static and dynamic menu items.
|
|
44
|
+
*
|
|
45
|
+
* @component
|
|
46
|
+
* @param {DropdownMenuProps} props - The component props
|
|
47
|
+
* @param {(props: { open: (e: any) => void }) => ReactNode} props.anchor - Render function for the trigger element
|
|
48
|
+
* @param {ReactNode[] | ((props: { close: () => void }) => ReactNode[])} [props.menu] - Menu items array or function
|
|
49
|
+
* @param {(props: { close: () => void }) => ReactNode} [props.menuSlot] - Custom menu content renderer
|
|
50
|
+
* @param {boolean} [props.useMenuSlot=false] - Whether to use menuSlot instead of menu items
|
|
51
|
+
* @param {string} [props.menuContentClassName] - CSS classes for the menu content container
|
|
52
|
+
* @param {string} [props.menuListClassName] - CSS classes for the menu list wrapper
|
|
53
|
+
* @param {ReactNode} [props.menuHeader] - Content to display above the menu items
|
|
54
|
+
* @param {ReactNode} [props.menuFooter] - Content to display below the menu items
|
|
55
|
+
* @param {(event: any) => Promise<void>} [props.handleMenuScroll] - Async callback for scroll events
|
|
56
|
+
* @param {'start' | 'center' | 'end'} [props.align='end'] - Horizontal alignment of the menu
|
|
57
|
+
* @param {'top' | 'right' | 'bottom' | 'left'} [props.side='bottom'] - Vertical placement of the menu
|
|
58
|
+
*
|
|
59
|
+
* @returns {React.ReactElement} A dropdown menu component with trigger and content
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Simple dropdown with static menu items
|
|
63
|
+
* <DropdownMenu
|
|
64
|
+
* anchor={({ open }) => <button onClick={open}>Actions</button>}
|
|
65
|
+
* menu={[
|
|
66
|
+
* <button key="1">Edit</button>,
|
|
67
|
+
* <button key="2">Delete</button>,
|
|
68
|
+
* ]}
|
|
69
|
+
* />
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // Dropdown with dynamic menu items and header
|
|
73
|
+
* <DropdownMenu
|
|
74
|
+
* anchor={({ open }) => <IconButton icon={<MoreIcon />} onClick={open} />}
|
|
75
|
+
* menu={({ close }) => items.map(item => (
|
|
76
|
+
* <button key={item.id} onClick={() => { selectItem(item); close(); }}>
|
|
77
|
+
* {item.name}
|
|
78
|
+
* </button>
|
|
79
|
+
* ))}
|
|
80
|
+
* menuHeader={<span className="px-2 py-1 text-sm font-semibold">Options</span>}
|
|
81
|
+
* align="start"
|
|
82
|
+
* />
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* // Dropdown with infinite scroll
|
|
86
|
+
* <DropdownMenu
|
|
87
|
+
* anchor={({ open }) => <button onClick={open}>Load More</button>}
|
|
88
|
+
* menu={filteredItems}
|
|
89
|
+
* menuFooter={<span className="text-xs text-muted">Showing {items.length} items</span>}
|
|
90
|
+
* handleMenuScroll={async (e) => {
|
|
91
|
+
* if (isNearBottom(e)) {
|
|
92
|
+
* await loadMoreItems();
|
|
93
|
+
* }
|
|
94
|
+
* }}
|
|
95
|
+
* />
|
|
96
|
+
*/
|
|
24
97
|
export const DropdownMenu = ({
|
|
25
98
|
menu = [],
|
|
26
99
|
menuSlot,
|
|
@@ -66,7 +139,7 @@ export const DropdownMenu = ({
|
|
|
66
139
|
<DropdownMenuContent
|
|
67
140
|
align={align}
|
|
68
141
|
side={side}
|
|
69
|
-
className={cn('min-w-[200px]
|
|
142
|
+
className={cn('min-w-[200px] ', menuContentClassName)}
|
|
70
143
|
sideOffset={5}
|
|
71
144
|
collisionPadding={8}
|
|
72
145
|
// Force Radix to recalculate position
|
|
@@ -19,15 +19,69 @@ type FileInfo = {
|
|
|
19
19
|
url: string;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Props for the PreviewFiles component
|
|
24
|
+
*/
|
|
22
25
|
export type PreviewFilesProps = {
|
|
26
|
+
/** Array of files or single file to display. Can be File objects or string URLs. Accepts null for empty state */
|
|
23
27
|
files: File[] | File | string[] | string | null;
|
|
28
|
+
/** Optional label text displayed above the file list */
|
|
24
29
|
label?: string;
|
|
30
|
+
/** Optional callback fired when files are deleted. Receives remaining files array and deleted file */
|
|
25
31
|
onChange?: (newFiles: File[], deletedFile: File) => void;
|
|
32
|
+
/** Whether to show download button for each file. Defaults to false */
|
|
26
33
|
showDownload?: boolean;
|
|
34
|
+
/** Whether to hide the delete button for each file. Defaults to false */
|
|
27
35
|
hideDelete?: boolean;
|
|
36
|
+
/** Optional CSS class names for the container element */
|
|
28
37
|
className?: string;
|
|
29
38
|
};
|
|
30
39
|
|
|
40
|
+
/**
|
|
41
|
+
* PreviewFiles component that displays a list of files with preview, download, and delete functionality.
|
|
42
|
+
*
|
|
43
|
+
* This component renders file items in a grid/list format with icons, sizes, and action buttons.
|
|
44
|
+
* It supports both File objects and URL strings, automatically fetching file information for remote files.
|
|
45
|
+
* Users can preview files by clicking on them, download them, and delete them from the list.
|
|
46
|
+
*
|
|
47
|
+
* @component
|
|
48
|
+
* @param {PreviewFilesProps} props - The component props
|
|
49
|
+
* @param {File[] | File | string[] | string | null} props.files - Files to display (File objects or URLs)
|
|
50
|
+
* @param {string} [props.label] - Optional label text displayed above the file list
|
|
51
|
+
* @param {(newFiles: File[], deletedFile: File) => void} [props.onChange] - Callback when files are deleted
|
|
52
|
+
* @param {boolean} [props.showDownload=false] - Whether to show download button
|
|
53
|
+
* @param {boolean} [props.hideDelete=false] - Whether to hide delete button
|
|
54
|
+
* @param {string} [props.className] - Optional CSS classes for the container
|
|
55
|
+
*
|
|
56
|
+
* @returns {React.ReactElement | null} A div containing the file list, or null if no files
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Display File objects with delete capability
|
|
60
|
+
* <PreviewFiles
|
|
61
|
+
* files={uploadedFiles}
|
|
62
|
+
* label="Uploaded Files"
|
|
63
|
+
* onChange={(newFiles, deleted) => setFiles(newFiles)}
|
|
64
|
+
* />
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Display remote files with download button
|
|
68
|
+
* <PreviewFiles
|
|
69
|
+
* files={['https://example.com/file1.pdf', 'https://example.com/file2.docx']}
|
|
70
|
+
* label="Documents"
|
|
71
|
+
* showDownload={true}
|
|
72
|
+
* hideDelete={true}
|
|
73
|
+
* />
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* // Mixed files with custom styling
|
|
77
|
+
* <PreviewFiles
|
|
78
|
+
* files={[file1, 'https://example.com/file.pdf']}
|
|
79
|
+
* label="Files"
|
|
80
|
+
* showDownload={true}
|
|
81
|
+
* onChange={handleFileDelete}
|
|
82
|
+
* className="bg-gray-50 p-4 rounded-lg"
|
|
83
|
+
* />
|
|
84
|
+
*/
|
|
31
85
|
export const PreviewFiles = ({
|
|
32
86
|
files,
|
|
33
87
|
label,
|
|
@@ -234,6 +288,16 @@ export const PreviewFiles = ({
|
|
|
234
288
|
);
|
|
235
289
|
};
|
|
236
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Formats a file size in bytes to a human-readable string.
|
|
293
|
+
*
|
|
294
|
+
* @param {number} size - File size in bytes
|
|
295
|
+
* @returns {string} Formatted file size (e.g., "1.5 MB", "256 KB")
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* formatFileSize(1024) // "1.00 KB"
|
|
299
|
+
* formatFileSize(1048576) // "1.00 MB"
|
|
300
|
+
*/
|
|
237
301
|
const formatFileSize = (size: number) => {
|
|
238
302
|
if (size < 1024) return `${size} bytes`;
|
|
239
303
|
if (size < 1048576) return `${(size / 1024).toFixed(2)} KB`;
|
|
@@ -241,6 +305,15 @@ const formatFileSize = (size: number) => {
|
|
|
241
305
|
return `${(size / 1073741824).toFixed(2)} GB`;
|
|
242
306
|
};
|
|
243
307
|
|
|
308
|
+
/**
|
|
309
|
+
* Returns the appropriate icon component for a file based on its MIME type.
|
|
310
|
+
*
|
|
311
|
+
* @param {File | FileInfo} file - File object to get icon for
|
|
312
|
+
* @returns {React.ReactElement} Icon component for the file type
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* getFileIcon(file) // Returns Image icon for image files, FileText for PDFs, etc.
|
|
316
|
+
*/
|
|
244
317
|
const getFileIcon = (file: File | FileInfo) => {
|
|
245
318
|
const IconComponent =
|
|
246
319
|
Object.entries(FILE_TYPE_ICON_MAP).find(([key]) =>
|
|
@@ -249,6 +322,16 @@ const getFileIcon = (file: File | FileInfo) => {
|
|
|
249
322
|
return <IconComponent size={30} />;
|
|
250
323
|
};
|
|
251
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Creates a FileInfo object from a URL string, extracting file name and MIME type.
|
|
327
|
+
*
|
|
328
|
+
* @param {string} fileUrl - URL of the file
|
|
329
|
+
* @returns {FileInfo} FileInfo object with name, type, and url
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* createFileInfoFromUrl('https://example.com/document.pdf')
|
|
333
|
+
* // Returns { name: 'document.pdf', type: 'application/pdf', size: 0, url: '...' }
|
|
334
|
+
*/
|
|
252
335
|
const createFileInfoFromUrl = (fileUrl: string): FileInfo => {
|
|
253
336
|
const fileName = fileUrl.split('/').pop() || 'unknown_file';
|
|
254
337
|
const extension = Object.keys(EXTENSION_TO_MIME_TYPE).find((ext) =>
|
|
@@ -266,6 +349,16 @@ const createFileInfoFromUrl = (fileUrl: string): FileInfo => {
|
|
|
266
349
|
};
|
|
267
350
|
};
|
|
268
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Fetches the file size for a remote file by making a HEAD request or partial GET request.
|
|
354
|
+
*
|
|
355
|
+
* @param {string} url - URL of the file to fetch size for
|
|
356
|
+
* @returns {Promise<number>} File size in bytes, or 0 if unable to determine
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* const size = await fetchFileSizeAsync('https://example.com/file.pdf');
|
|
360
|
+
* console.log(size); // File size in bytes
|
|
361
|
+
*/
|
|
269
362
|
const fetchFileSizeAsync = async (url: string): Promise<number> => {
|
|
270
363
|
try {
|
|
271
364
|
const response = await fetch(url, { method: 'HEAD' });
|
|
@@ -3,37 +3,83 @@ import HorizontalStepper from './HorizontalStepper';
|
|
|
3
3
|
import VerticalStepper from './VerticalStepper';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Interface for individual step items
|
|
6
|
+
* Interface for individual step items in the stepper
|
|
7
7
|
*/
|
|
8
8
|
export interface StepItem {
|
|
9
|
-
/** The label text for
|
|
9
|
+
/** The label text displayed for this step */
|
|
10
10
|
label: string;
|
|
11
|
-
/** Optional description text shown below the label */
|
|
11
|
+
/** Optional description text shown below the label for additional context */
|
|
12
12
|
description?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Props for the Stepper
|
|
16
|
+
* Props for the Stepper variant components (HorizontalStepper and VerticalStepper)
|
|
17
17
|
*/
|
|
18
18
|
export interface StepperVariantProps {
|
|
19
|
-
/** Current active step index (0-based) */
|
|
19
|
+
/** Current active step index (0-based). Determines which step is highlighted */
|
|
20
20
|
activeStep: number;
|
|
21
21
|
/** Array of step items with labels and optional descriptions */
|
|
22
22
|
steps: StepItem[];
|
|
23
|
-
/** Additional
|
|
23
|
+
/** Additional CSS class names for the stepper container element */
|
|
24
24
|
containerClassName?: string;
|
|
25
|
-
/** Callback function
|
|
25
|
+
/** Callback function fired when a step is clicked. Receives the step index (0-based) as parameter */
|
|
26
26
|
onStepClick?: (stepIndex: number) => void;
|
|
27
|
-
/** Whether to allow
|
|
27
|
+
/** Whether to allow users to navigate by clicking on steps. Defaults to true */
|
|
28
28
|
allowNavigation?: boolean;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Props for the Stepper component
|
|
33
|
+
*/
|
|
30
34
|
export type StepperProps = StepperVariantProps & {
|
|
31
|
-
/** Orientation of the stepper - horizontal
|
|
35
|
+
/** Orientation of the stepper layout - 'horizontal' displays steps left-to-right, 'vertical' displays top-to-bottom. Defaults to 'horizontal' */
|
|
32
36
|
orientation?: 'vertical' | 'horizontal';
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
/**
|
|
36
|
-
*
|
|
40
|
+
* Stepper component that displays a progress indicator with multiple steps.
|
|
41
|
+
*
|
|
42
|
+
* This is a wrapper component that renders either HorizontalStepper or VerticalStepper
|
|
43
|
+
* based on the orientation prop. It provides a visual representation of progress through
|
|
44
|
+
* a sequence of steps, with optional click handlers for step navigation.
|
|
45
|
+
*
|
|
46
|
+
* @component
|
|
47
|
+
* @param {StepperProps} props - The component props
|
|
48
|
+
* @param {number} props.activeStep - Index of the currently active step (0-based)
|
|
49
|
+
* @param {StepItem[]} props.steps - Array of steps with label and optional description
|
|
50
|
+
* @param {'horizontal' | 'vertical'} [props.orientation='horizontal'] - Layout orientation
|
|
51
|
+
* @param {string} [props.containerClassName] - Optional CSS classes for the container
|
|
52
|
+
* @param {(stepIndex: number) => void} [props.onStepClick] - Callback when a step is clicked
|
|
53
|
+
* @param {boolean} [props.allowNavigation=true] - Whether clicking on steps navigates between them
|
|
54
|
+
*
|
|
55
|
+
* @returns {React.ReactElement} A HorizontalStepper or VerticalStepper component
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Horizontal stepper (default)
|
|
59
|
+
* <Stepper
|
|
60
|
+
* activeStep={1}
|
|
61
|
+
* steps={[
|
|
62
|
+
* { label: 'Step 1', description: 'Enter details' },
|
|
63
|
+
* { label: 'Step 2', description: 'Confirm' },
|
|
64
|
+
* { label: 'Step 3', description: 'Complete' }
|
|
65
|
+
* ]}
|
|
66
|
+
* onStepClick={(index) => setActiveStep(index)}
|
|
67
|
+
* />
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Vertical stepper with custom styling
|
|
71
|
+
* <Stepper
|
|
72
|
+
* orientation="vertical"
|
|
73
|
+
* activeStep={2}
|
|
74
|
+
* steps={[
|
|
75
|
+
* { label: 'Personal Info' },
|
|
76
|
+
* { label: 'Address' },
|
|
77
|
+
* { label: 'Payment' },
|
|
78
|
+
* { label: 'Review' }
|
|
79
|
+
* ]}
|
|
80
|
+
* containerClassName="bg-gray-50 p-6 rounded"
|
|
81
|
+
* allowNavigation={false}
|
|
82
|
+
* />
|
|
37
83
|
*/
|
|
38
84
|
const Stepper: React.FC<StepperProps> = ({
|
|
39
85
|
orientation = 'horizontal',
|