@codezee/sixtify-brahma 0.0.0
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/.github/workflows/check-build.yml +41 -0
- package/.github/workflows/deploy-on-npm.yml +43 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.lintstagedrc +5 -0
- package/.prettierignore +12 -0
- package/.prettierrc +22 -0
- package/.vscode/extensions.json +22 -0
- package/.vscode/settings.json +17 -0
- package/README.md +90 -0
- package/apps/docs/.eslintrc.cjs +9 -0
- package/apps/docs/.storybook/main.ts +23 -0
- package/apps/docs/.storybook/manager.ts +6 -0
- package/apps/docs/.storybook/preview.tsx +27 -0
- package/apps/docs/.storybook/theme.ts +8 -0
- package/apps/docs/next-env.d.ts +5 -0
- package/apps/docs/next.config.mjs +4 -0
- package/apps/docs/package.json +43 -0
- package/apps/docs/public/globals.css +26 -0
- package/apps/docs/stories/Actions/Actions.stories.tsx +49 -0
- package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +70 -0
- package/apps/docs/stories/AppBar/AppBar.stories.tsx +39 -0
- package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +37 -0
- package/apps/docs/stories/Button/ButtonGroup.stories.tsx +120 -0
- package/apps/docs/stories/Button/button.stories.tsx +99 -0
- package/apps/docs/stories/Card/AttendanceCard.stories.tsx +36 -0
- package/apps/docs/stories/Card/Card.stories.tsx +39 -0
- package/apps/docs/stories/Charts/PieChart.stories.tsx +265 -0
- package/apps/docs/stories/Chips/Chip.stories.tsx +141 -0
- package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +18 -0
- package/apps/docs/stories/Chips/FilterPill.stories.tsx +24 -0
- package/apps/docs/stories/Color/Color.stories.tsx +14 -0
- package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +48 -0
- package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +32 -0
- package/apps/docs/stories/Dialog/Dialog.stories.tsx +48 -0
- package/apps/docs/stories/Drawer/Drawer.stories.tsx +94 -0
- package/apps/docs/stories/FilterList/FilterList.stories.tsx +88 -0
- package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +92 -0
- package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +90 -0
- package/apps/docs/stories/FormFields/CheckBox.stories.tsx +64 -0
- package/apps/docs/stories/FormFields/DatePicker.stories.tsx +100 -0
- package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/DateTimePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/FileUpload.stories.tsx +83 -0
- package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +69 -0
- package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +59 -0
- package/apps/docs/stories/FormFields/PhoneInputField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +172 -0
- package/apps/docs/stories/FormFields/SearchField.stories.tsx +74 -0
- package/apps/docs/stories/FormFields/TextField.stories.tsx +141 -0
- package/apps/docs/stories/FormFields/TimeField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/TimePicker.stories.tsx +84 -0
- package/apps/docs/stories/Indicator/Indicator.stories.tsx +33 -0
- package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +27 -0
- package/apps/docs/stories/Layouts/FormRow.stories.tsx +45 -0
- package/apps/docs/stories/PadBox/PadBox.stories.tsx +49 -0
- package/apps/docs/stories/Stepper/Stepper.stories.tsx +110 -0
- package/apps/docs/stories/Stepper/StepperV2.stories.tsx +44 -0
- package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +29 -0
- package/apps/docs/stories/Timeline/Timeline.stories.tsx +38 -0
- package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +28 -0
- package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +112 -0
- package/apps/docs/tsconfig.json +19 -0
- package/commitlint.config.cjs +6 -0
- package/index.ts +1 -0
- package/package.json +85 -0
- package/packages/eslint-config/README.md +3 -0
- package/packages/eslint-config/library.js +88 -0
- package/packages/eslint-config/next.js +85 -0
- package/packages/eslint-config/package.json +19 -0
- package/packages/eslint-config/react-internal.js +89 -0
- package/packages/shared-components/.eslintrc.js +10 -0
- package/packages/shared-components/package.json +51 -0
- package/packages/shared-components/src/Actions/AddAction.tsx +16 -0
- package/packages/shared-components/src/Actions/CalendarAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ConfigureAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DeleteAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DownloadAction.tsx +16 -0
- package/packages/shared-components/src/Actions/EditAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ExportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/FilterAction.tsx +16 -0
- package/packages/shared-components/src/Actions/HistoryAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ImportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ViewAction.tsx +16 -0
- package/packages/shared-components/src/Actions/index.ts +11 -0
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +57 -0
- package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +32 -0
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +93 -0
- package/packages/shared-components/src/AgGrid/LoadingCell.tsx +5 -0
- package/packages/shared-components/src/AgGrid/index.ts +3 -0
- package/packages/shared-components/src/AppBar/AppBar.styled.tsx +33 -0
- package/packages/shared-components/src/AppBar/AppBar.tsx +20 -0
- package/packages/shared-components/src/AppBar/index.ts +1 -0
- package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +76 -0
- package/packages/shared-components/src/Breadcrumbs/index.ts +1 -0
- package/packages/shared-components/src/Button/ActionButton.tsx +38 -0
- package/packages/shared-components/src/Button/Button.tsx +19 -0
- package/packages/shared-components/src/Button/ButtonGroup.tsx +37 -0
- package/packages/shared-components/src/Button/index.ts +3 -0
- package/packages/shared-components/src/Card/AttendanceCard.tsx +51 -0
- package/packages/shared-components/src/Card/Card.tsx +34 -0
- package/packages/shared-components/src/Card/CardItem/CardItem.tsx +33 -0
- package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +98 -0
- package/packages/shared-components/src/Card/CardItem/index.ts +2 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +40 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +53 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +94 -0
- package/packages/shared-components/src/Card/index.ts +6 -0
- package/packages/shared-components/src/Charts/PieChart.tsx +81 -0
- package/packages/shared-components/src/Charts/Skeleton.tsx +36 -0
- package/packages/shared-components/src/Charts/index.ts +1 -0
- package/packages/shared-components/src/Chips/Chip.tsx +26 -0
- package/packages/shared-components/src/Chips/ChipWithBorder.tsx +39 -0
- package/packages/shared-components/src/Chips/FilterPill.tsx +47 -0
- package/packages/shared-components/src/Chips/index.ts +3 -0
- package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +28 -0
- package/packages/shared-components/src/Dialog/BottomDialog.tsx +37 -0
- package/packages/shared-components/src/Dialog/DeleteDialog.tsx +48 -0
- package/packages/shared-components/src/Dialog/Dialog.tsx +61 -0
- package/packages/shared-components/src/Dialog/index.ts +3 -0
- package/packages/shared-components/src/Drawer/Bullet.tsx +12 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +57 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +109 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +128 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +45 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +43 -0
- package/packages/shared-components/src/Drawer/Drawer.styled.tsx +63 -0
- package/packages/shared-components/src/Drawer/Drawer.tsx +56 -0
- package/packages/shared-components/src/Drawer/MenuItem.tsx +75 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +13 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +48 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +232 -0
- package/packages/shared-components/src/Drawer/index.ts +1 -0
- package/packages/shared-components/src/FilterList/DateRangePickerPopUp.tsx +123 -0
- package/packages/shared-components/src/FilterList/FilterList.tsx +180 -0
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +661 -0
- package/packages/shared-components/src/FilterList/FilterPopup.tsx +165 -0
- package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +110 -0
- package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +60 -0
- package/packages/shared-components/src/FilterList/GetFilterPopupComponent.tsx +76 -0
- package/packages/shared-components/src/FilterList/getFormData.ts +29 -0
- package/packages/shared-components/src/FilterList/index.ts +6 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +509 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/Autocomplete/index.ts +1 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +76 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +44 -0
- package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/CheckBox/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +217 -0
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +28 -0
- package/packages/shared-components/src/FormFields/DatePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +97 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +38 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +253 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +32 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +31 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +160 -0
- package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +21 -0
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +20 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +181 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +65 -0
- package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +74 -0
- package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/ImageUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +25 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +52 -0
- package/packages/shared-components/src/FormFields/ListItemButton/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +50 -0
- package/packages/shared-components/src/FormFields/PasswordField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/PhoneInputField.tsx +108 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +105 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +21 -0
- package/packages/shared-components/src/FormFields/SearchField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/Switch/Switch.tsx +33 -0
- package/packages/shared-components/src/FormFields/Switch/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +167 -0
- package/packages/shared-components/src/FormFields/TextField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +120 -0
- package/packages/shared-components/src/FormFields/TimeField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +168 -0
- package/packages/shared-components/src/FormFields/TimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/index.ts +16 -0
- package/packages/shared-components/src/Indicator/Indicator.tsx +18 -0
- package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +34 -0
- package/packages/shared-components/src/Indicator/index.ts +2 -0
- package/packages/shared-components/src/Layouts/FormContainer.tsx +6 -0
- package/packages/shared-components/src/Layouts/FormGridLayout.tsx +27 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +47 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +20 -0
- package/packages/shared-components/src/Layouts/FormRow/index.ts +1 -0
- package/packages/shared-components/src/Layouts/FormSection.tsx +22 -0
- package/packages/shared-components/src/Layouts/index.ts +4 -0
- package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +41 -0
- package/packages/shared-components/src/Loader/index.ts +1 -0
- package/packages/shared-components/src/PadBox/PadBox.tsx +21 -0
- package/packages/shared-components/src/PadBox/index.ts +1 -0
- package/packages/shared-components/src/Pagination/Pagination.tsx +42 -0
- package/packages/shared-components/src/Pagination/index.ts +1 -0
- package/packages/shared-components/src/Stepper/Stepper.tsx +88 -0
- package/packages/shared-components/src/Stepper/StepperV2.tsx +115 -0
- package/packages/shared-components/src/Stepper/StepperV3.tsx +72 -0
- package/packages/shared-components/src/Stepper/index.ts +3 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +65 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +48 -0
- package/packages/shared-components/src/Svgs/ArrowUp.tsx +11 -0
- package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +480 -0
- package/packages/shared-components/src/Svgs/Company/index.ts +1 -0
- package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +31 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgBankConfig.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgConfiguration.tsx +16 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgPayroll.tsx +32 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +25 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +81 -0
- package/packages/shared-components/src/Svgs/Drawer/index.ts +7 -0
- package/packages/shared-components/src/Svgs/FormAction.tsx +118 -0
- package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +54 -0
- package/packages/shared-components/src/Svgs/LogoIcon.tsx +74 -0
- package/packages/shared-components/src/Svgs/SvgAdd.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgCalendar.tsx +89 -0
- package/packages/shared-components/src/Svgs/SvgConfigure.tsx +51 -0
- package/packages/shared-components/src/Svgs/SvgDelete.tsx +55 -0
- package/packages/shared-components/src/Svgs/SvgDownload.tsx +20 -0
- package/packages/shared-components/src/Svgs/SvgEmail.tsx +27 -0
- package/packages/shared-components/src/Svgs/SvgExport.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgFilterList.tsx +22 -0
- package/packages/shared-components/src/Svgs/SvgImport.tsx +43 -0
- package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +66 -0
- package/packages/shared-components/src/Svgs/SvgNoSign.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgPhone.tsx +19 -0
- package/packages/shared-components/src/Svgs/SvgProfile.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgView.tsx +16 -0
- package/packages/shared-components/src/Svgs/SvgsDrop.tsx +44 -0
- package/packages/shared-components/src/Svgs/SvgsEdit.tsx +42 -0
- package/packages/shared-components/src/Svgs/SvgsHistory.tsx +40 -0
- package/packages/shared-components/src/Svgs/SvgsHome.tsx +18 -0
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +24 -0
- package/packages/shared-components/src/Svgs/index.ts +18 -0
- package/packages/shared-components/src/Tab/Skeleton.tsx +15 -0
- package/packages/shared-components/src/Tab/Tabs.tsx +64 -0
- package/packages/shared-components/src/Tab/index.ts +1 -0
- package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +56 -0
- package/packages/shared-components/src/Timeline/Timeline.tsx +159 -0
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +130 -0
- package/packages/shared-components/src/Timeline/index.ts +2 -0
- package/packages/shared-components/src/Toast/Toast.tsx +59 -0
- package/packages/shared-components/src/Toast/ToastBody.tsx +26 -0
- package/packages/shared-components/src/Toast/ToastFooterLink.tsx +19 -0
- package/packages/shared-components/src/Toast/Toaster.styled.tsx +80 -0
- package/packages/shared-components/src/Toast/Toaster.tsx +21 -0
- package/packages/shared-components/src/Toast/index.ts +3 -0
- package/packages/shared-components/src/Toast/toasts.tsx +28 -0
- package/packages/shared-components/src/Toast/types.ts +13 -0
- package/packages/shared-components/src/Tooltip/Tooltip.tsx +36 -0
- package/packages/shared-components/src/Tooltip/index.ts +1 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +42 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +168 -0
- package/packages/shared-components/src/UserProfileMenu/index.ts +1 -0
- package/packages/shared-components/src/index.ts +25 -0
- package/packages/shared-components/src/utils/colorVariant.ts +162 -0
- package/packages/shared-components/src/utils/date.ts +25 -0
- package/packages/shared-components/src/utils/file.ts +22 -0
- package/packages/shared-components/src/utils/index.ts +11 -0
- package/packages/shared-components/src/utils/theme/colorPalette.ts +112 -0
- package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +44 -0
- package/packages/shared-components/src/utils/theme/paletteDark.ts +10 -0
- package/packages/shared-components/src/utils/theme/paletteLight.ts +31 -0
- package/packages/shared-components/src/utils/theme/theme.ts +297 -0
- package/packages/shared-components/src/utils/theme/types.ts +18 -0
- package/packages/shared-components/src/utils/theme/typography.ts +52 -0
- package/packages/shared-components/src/utils/urlToNestedObject.ts +9 -0
- package/packages/shared-components/tsconfig.json +8 -0
- package/packages/shared-components/tsconfig.lint.json +8 -0
- package/packages/shared-components/webpack/cjs.js +20 -0
- package/packages/shared-components/webpack/common.js +36 -0
- package/packages/typescript-config/base.json +20 -0
- package/packages/typescript-config/nextjs.json +13 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +42 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BoxProps } from "@mui/material";
|
|
2
|
+
import { Box, styled } from "@mui/material";
|
|
3
|
+
import type {
|
|
4
|
+
ComponentType,
|
|
5
|
+
DetailedHTMLProps,
|
|
6
|
+
InputHTMLAttributes,
|
|
7
|
+
ReactNode,
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
export type FileUploadContainerProps = BoxProps & {
|
|
11
|
+
error?: boolean;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const FileUploadContainer: ComponentType<FileUploadContainerProps> =
|
|
16
|
+
styled(Box)<FileUploadContainerProps>(({ theme, error }) => ({
|
|
17
|
+
border: error
|
|
18
|
+
? `2px dashed ${theme.palette.app.color.red[900]}`
|
|
19
|
+
: `2px dashed ${theme.palette.app.color.iron[800]}`,
|
|
20
|
+
borderRadius: "8px",
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
"&:hover": {
|
|
23
|
+
borderColor: theme.palette.app.color.butterflyBlue[900],
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
export const FileInput: ComponentType<
|
|
28
|
+
DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>
|
|
29
|
+
> = styled("input")({
|
|
30
|
+
display: "none",
|
|
31
|
+
});
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { InputLabel, Stack, Typography, useTheme } from "@mui/material";
|
|
2
|
+
import { isFunction } from "lodash";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import type {
|
|
5
|
+
FieldError,
|
|
6
|
+
FieldValues,
|
|
7
|
+
UseControllerProps,
|
|
8
|
+
} from "react-hook-form";
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
import { PadBox } from "../../PadBox";
|
|
11
|
+
import { SvgsDrop } from "../../Svgs";
|
|
12
|
+
import { isFileSizeValid, isFileTypeValid } from "../../utils";
|
|
13
|
+
import { FileInput, FileUploadContainer } from "./FileUpload.styled";
|
|
14
|
+
import { Skeleton } from "./Skeleton";
|
|
15
|
+
|
|
16
|
+
export type FileUploadProps<P extends FieldValues> = UseControllerProps<P> & {
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
onChange: (file: File[]) => void;
|
|
21
|
+
error?: boolean;
|
|
22
|
+
helperText?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
size?: number; //Note:- Size in MB
|
|
25
|
+
accept?: string;
|
|
26
|
+
fileNames: JSX.Element;
|
|
27
|
+
acceptTitle?: string;
|
|
28
|
+
setError: (
|
|
29
|
+
name: keyof P,
|
|
30
|
+
error: FieldError | { type: string; message?: string }
|
|
31
|
+
) => void;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const error_with_transaltion = "error_with_transaltion";
|
|
35
|
+
|
|
36
|
+
export function FileUpload<P extends FieldValues>({
|
|
37
|
+
loading = false,
|
|
38
|
+
onChange,
|
|
39
|
+
isDisabled,
|
|
40
|
+
multiple = false,
|
|
41
|
+
error,
|
|
42
|
+
helperText,
|
|
43
|
+
label,
|
|
44
|
+
fileNames,
|
|
45
|
+
size = 10,
|
|
46
|
+
name,
|
|
47
|
+
setError,
|
|
48
|
+
accept = ".png,.jpg,.jpeg,.doc,.docx,.pdf",
|
|
49
|
+
acceptTitle = "Only JPG, PNG, PDF files are accepted.",
|
|
50
|
+
...restProps
|
|
51
|
+
}: FileUploadProps<P>) {
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
|
|
54
|
+
const { red } = theme.palette.app.color;
|
|
55
|
+
|
|
56
|
+
const { t } = useTranslation();
|
|
57
|
+
|
|
58
|
+
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
59
|
+
|
|
60
|
+
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
61
|
+
if (event.target.files) {
|
|
62
|
+
const files = Array.from(event.target.files);
|
|
63
|
+
|
|
64
|
+
const uploadFiles: File[] = [];
|
|
65
|
+
|
|
66
|
+
const inValidFiles: string[] = [];
|
|
67
|
+
|
|
68
|
+
let isShowError: boolean = false;
|
|
69
|
+
|
|
70
|
+
for (const element of files) {
|
|
71
|
+
if (!isFileSizeValid(element, size)) {
|
|
72
|
+
isShowError = true;
|
|
73
|
+
|
|
74
|
+
inValidFiles.push(
|
|
75
|
+
t("fileUpload.fileSize.error.message", {
|
|
76
|
+
fileName: element.name,
|
|
77
|
+
fileSize: size,
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
} else if (!isFileTypeValid(element)) {
|
|
81
|
+
isShowError = true;
|
|
82
|
+
|
|
83
|
+
inValidFiles.push(
|
|
84
|
+
t("fileUpload.fileType.error.message", {
|
|
85
|
+
fileName: element.name,
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
} else {
|
|
89
|
+
uploadFiles.push(element);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (isShowError) {
|
|
94
|
+
if (isFunction(setError)) {
|
|
95
|
+
setError(name, {
|
|
96
|
+
type: error_with_transaltion,
|
|
97
|
+
message: inValidFiles.join("\n"),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (uploadFiles?.length > 0) {
|
|
105
|
+
onChange(uploadFiles);
|
|
106
|
+
|
|
107
|
+
event.target.value = "";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
if (loading) {
|
|
113
|
+
return <Skeleton />;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<Stack gap="10px">
|
|
118
|
+
<InputLabel required>{label}</InputLabel>
|
|
119
|
+
|
|
120
|
+
<FileUploadContainer
|
|
121
|
+
onClick={() => inputRef.current?.click()}
|
|
122
|
+
error={error}
|
|
123
|
+
{...restProps}
|
|
124
|
+
>
|
|
125
|
+
<PadBox padding={{ padding: "20px" }}>
|
|
126
|
+
<Stack gap="4px" alignItems="center" justifyContent="center">
|
|
127
|
+
<FileInput
|
|
128
|
+
disabled={isDisabled}
|
|
129
|
+
type="file"
|
|
130
|
+
accept={accept}
|
|
131
|
+
ref={inputRef}
|
|
132
|
+
onChange={handleFileChange}
|
|
133
|
+
multiple={multiple}
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<SvgsDrop />
|
|
137
|
+
|
|
138
|
+
<Typography>Drag & drop files or Browse</Typography>
|
|
139
|
+
|
|
140
|
+
<Typography variant="caption">{acceptTitle}</Typography>
|
|
141
|
+
</Stack>
|
|
142
|
+
</PadBox>
|
|
143
|
+
</FileUploadContainer>
|
|
144
|
+
|
|
145
|
+
{error && (
|
|
146
|
+
<Typography
|
|
147
|
+
variant="caption"
|
|
148
|
+
sx={{
|
|
149
|
+
color: `${red[900]}`,
|
|
150
|
+
whiteSpace: "pre",
|
|
151
|
+
textWrap: "wrap",
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
{helperText}
|
|
155
|
+
</Typography>
|
|
156
|
+
)}
|
|
157
|
+
{fileNames}
|
|
158
|
+
</Stack>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const Skeleton = () => {
|
|
4
|
+
return (
|
|
5
|
+
<Stack gap="10px">
|
|
6
|
+
<MuiSkeleton
|
|
7
|
+
width={120}
|
|
8
|
+
height="23px"
|
|
9
|
+
sx={{
|
|
10
|
+
transform: "scale(1)",
|
|
11
|
+
}}
|
|
12
|
+
/>
|
|
13
|
+
<MuiSkeleton
|
|
14
|
+
height="141px"
|
|
15
|
+
sx={{
|
|
16
|
+
transform: "scale(1)",
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
</Stack>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BoxProps } from "@mui/material";
|
|
2
|
+
import { Box, styled } from "@mui/material";
|
|
3
|
+
import type { ComponentType } from "react";
|
|
4
|
+
|
|
5
|
+
export const DarkBackgroundContainer: ComponentType<BoxProps> = styled(Box)(({
|
|
6
|
+
theme,
|
|
7
|
+
}) => {
|
|
8
|
+
return {
|
|
9
|
+
position: "absolute",
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
right: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
backgroundColor: theme.palette.app.color.mirage[600],
|
|
15
|
+
display: "flex",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
transition: "opacity 0.5s ease",
|
|
19
|
+
};
|
|
20
|
+
});
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Delete as DeleteIcon, Edit as EditIcon } from "@mui/icons-material";
|
|
2
|
+
import CameraAltOutlinedIcon from "@mui/icons-material/CameraAltOutlined";
|
|
3
|
+
import PersonAddAltIcon from "@mui/icons-material/PersonAddAlt";
|
|
4
|
+
import { Box, IconButton, Stack, Typography, useTheme } from "@mui/material";
|
|
5
|
+
import { useRef, useState } from "react";
|
|
6
|
+
import { Button } from "../../Button";
|
|
7
|
+
import { PadBox } from "../../PadBox";
|
|
8
|
+
import { DarkBackgroundContainer } from "./ImageUpload.styled";
|
|
9
|
+
import { PhotoCaptureDialog } from "./PhotoCaptureDialog";
|
|
10
|
+
import { Skeleton } from "./Skeleton";
|
|
11
|
+
|
|
12
|
+
export type ImageUploadProps = Readonly<{
|
|
13
|
+
onDelete: () => void;
|
|
14
|
+
onChange: (file: File[]) => void;
|
|
15
|
+
variant?: "square" | "circle";
|
|
16
|
+
isUploading?: boolean;
|
|
17
|
+
label?: string;
|
|
18
|
+
subTitle?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
isCapture?: boolean;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
export function ImageUpload({
|
|
25
|
+
variant = "square",
|
|
26
|
+
isUploading = false,
|
|
27
|
+
defaultValue = "",
|
|
28
|
+
onDelete,
|
|
29
|
+
onChange,
|
|
30
|
+
label,
|
|
31
|
+
isCapture = false,
|
|
32
|
+
loading = false,
|
|
33
|
+
subTitle = "PNG, JPEG under 5 MB",
|
|
34
|
+
}: ImageUploadProps) {
|
|
35
|
+
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
36
|
+
|
|
37
|
+
const [hover, setHover] = useState(false);
|
|
38
|
+
|
|
39
|
+
const [isOpenCaptureModal, setIsOpenCaptureModal] = useState(false);
|
|
40
|
+
|
|
41
|
+
const theme = useTheme();
|
|
42
|
+
|
|
43
|
+
const { butterflyBlue, iron } = theme.palette.app.color;
|
|
44
|
+
|
|
45
|
+
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
46
|
+
if (event.target.files) {
|
|
47
|
+
const files = Array.from(event.target.files);
|
|
48
|
+
|
|
49
|
+
onChange(files);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const handleFileRemove = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
onDelete();
|
|
56
|
+
|
|
57
|
+
if (inputRef.current) {
|
|
58
|
+
inputRef.current.value = "";
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (loading) {
|
|
63
|
+
return <Skeleton />;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<Stack gap="20px" direction="row" alignItems="center">
|
|
69
|
+
<Box
|
|
70
|
+
onClick={() => !defaultValue && inputRef.current?.click()}
|
|
71
|
+
onMouseEnter={() => setHover(true)}
|
|
72
|
+
onMouseLeave={() => setHover(false)}
|
|
73
|
+
sx={{
|
|
74
|
+
height: "120px",
|
|
75
|
+
width: "120px",
|
|
76
|
+
position: "relative",
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
border: defaultValue
|
|
79
|
+
? `2px solid ${butterflyBlue[900]}`
|
|
80
|
+
: `2px dashed ${theme.palette.grey[400]}`,
|
|
81
|
+
cursor: "pointer",
|
|
82
|
+
borderRadius: "10px",
|
|
83
|
+
"& img": {
|
|
84
|
+
borderRadius: "10px",
|
|
85
|
+
},
|
|
86
|
+
":hover": {
|
|
87
|
+
border: `2px dashed ${butterflyBlue[900]}`,
|
|
88
|
+
},
|
|
89
|
+
...(variant === "circle"
|
|
90
|
+
? {
|
|
91
|
+
borderRadius: "50%",
|
|
92
|
+
"& img": {
|
|
93
|
+
borderRadius: "50%",
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
: {}),
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<input
|
|
100
|
+
type="file"
|
|
101
|
+
ref={inputRef}
|
|
102
|
+
onChange={handleFileChange}
|
|
103
|
+
style={{ display: "none" }}
|
|
104
|
+
accept="image/png, image/jpeg"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
{hover && !!defaultValue && (
|
|
108
|
+
<DarkBackgroundContainer>
|
|
109
|
+
<IconButton onClick={() => inputRef.current?.click()}>
|
|
110
|
+
<EditIcon sx={{ color: "white" }} />
|
|
111
|
+
</IconButton>
|
|
112
|
+
<IconButton onClick={handleFileRemove}>
|
|
113
|
+
<DeleteIcon sx={{ color: "white" }} />
|
|
114
|
+
</IconButton>
|
|
115
|
+
</DarkBackgroundContainer>
|
|
116
|
+
)}
|
|
117
|
+
|
|
118
|
+
{isUploading && (
|
|
119
|
+
<DarkBackgroundContainer>
|
|
120
|
+
<Typography color={iron[600]}>Processing...</Typography>
|
|
121
|
+
</DarkBackgroundContainer>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
{defaultValue ? (
|
|
125
|
+
<PadBox padding={{ padding: "2px" }}>
|
|
126
|
+
<img
|
|
127
|
+
alt=""
|
|
128
|
+
src={defaultValue}
|
|
129
|
+
style={{
|
|
130
|
+
width: "100%",
|
|
131
|
+
height: "100%",
|
|
132
|
+
objectFit: "cover",
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
</PadBox>
|
|
136
|
+
) : (
|
|
137
|
+
<Stack
|
|
138
|
+
justifyContent="center"
|
|
139
|
+
alignItems="center"
|
|
140
|
+
sx={{ height: "100%" }}
|
|
141
|
+
>
|
|
142
|
+
<PersonAddAltIcon />
|
|
143
|
+
</Stack>
|
|
144
|
+
)}
|
|
145
|
+
</Box>
|
|
146
|
+
|
|
147
|
+
<Stack>
|
|
148
|
+
<Typography variant="subtitle1" fontWeight={500}>
|
|
149
|
+
{label}
|
|
150
|
+
</Typography>
|
|
151
|
+
|
|
152
|
+
<Typography variant="caption" color={iron[800]}>
|
|
153
|
+
{subTitle}
|
|
154
|
+
</Typography>
|
|
155
|
+
</Stack>
|
|
156
|
+
|
|
157
|
+
{isCapture && (
|
|
158
|
+
<Button
|
|
159
|
+
onClick={() => setIsOpenCaptureModal(true)}
|
|
160
|
+
variant="outlined"
|
|
161
|
+
>
|
|
162
|
+
<Stack gap="10px" direction="row">
|
|
163
|
+
<CameraAltOutlinedIcon />
|
|
164
|
+
|
|
165
|
+
<Typography variant="body1">Capture photo</Typography>
|
|
166
|
+
</Stack>
|
|
167
|
+
</Button>
|
|
168
|
+
)}
|
|
169
|
+
</Stack>
|
|
170
|
+
|
|
171
|
+
{isOpenCaptureModal && (
|
|
172
|
+
<PhotoCaptureDialog
|
|
173
|
+
onChange={onChange}
|
|
174
|
+
isUploading={isUploading}
|
|
175
|
+
open={isOpenCaptureModal}
|
|
176
|
+
onClose={() => setIsOpenCaptureModal(false)}
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
179
|
+
</>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Avatar, Box, Stack, useTheme } from "@mui/material";
|
|
2
|
+
import { PadBox } from "../../PadBox";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
export type ImageUploadViewProps = Readonly<{
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
variant: string;
|
|
8
|
+
}>;
|
|
9
|
+
export function ImageUploadView({
|
|
10
|
+
defaultValue,
|
|
11
|
+
variant,
|
|
12
|
+
}: ImageUploadViewProps) {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
|
|
15
|
+
const { butterflyBlue } = theme.palette.app.color;
|
|
16
|
+
|
|
17
|
+
const [hasError, setHasError] = useState(false);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Box
|
|
21
|
+
sx={{
|
|
22
|
+
height: "120px",
|
|
23
|
+
minWidth: "120px",
|
|
24
|
+
maxWidth: "120px",
|
|
25
|
+
overflow: "hidden",
|
|
26
|
+
border: `2px solid ${butterflyBlue[900]}`,
|
|
27
|
+
borderRadius: "10px",
|
|
28
|
+
"& img": {
|
|
29
|
+
borderRadius: "10px",
|
|
30
|
+
},
|
|
31
|
+
...(variant === "circle"
|
|
32
|
+
? {
|
|
33
|
+
borderRadius: "50%",
|
|
34
|
+
"& img": {
|
|
35
|
+
borderRadius: "50%",
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
: {}),
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{defaultValue && !hasError ? (
|
|
42
|
+
<PadBox padding={{ padding: "2px" }}>
|
|
43
|
+
<img
|
|
44
|
+
alt=""
|
|
45
|
+
src={defaultValue}
|
|
46
|
+
onError={() => setHasError(true)}
|
|
47
|
+
style={{
|
|
48
|
+
width: "100%",
|
|
49
|
+
height: "100%",
|
|
50
|
+
objectFit: "cover",
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
</PadBox>
|
|
54
|
+
) : (
|
|
55
|
+
<Stack
|
|
56
|
+
justifyContent="center"
|
|
57
|
+
alignItems="center"
|
|
58
|
+
sx={{ height: "100%" }}
|
|
59
|
+
>
|
|
60
|
+
<Avatar sx={{ width: "93%", height: "93%" }} />
|
|
61
|
+
</Stack>
|
|
62
|
+
)}
|
|
63
|
+
</Box>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Stack } from "@mui/material";
|
|
2
|
+
import { base64ToFile } from "file64";
|
|
3
|
+
import { useCallback, useRef } from "react";
|
|
4
|
+
import Webcam from "react-webcam";
|
|
5
|
+
import { Button } from "../../Button";
|
|
6
|
+
import { Dialog } from "../../Dialog";
|
|
7
|
+
import { toasts } from "../../Toast";
|
|
8
|
+
|
|
9
|
+
type PhotoCaptureDialogProps = {
|
|
10
|
+
open: boolean;
|
|
11
|
+
isUploading: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onChange: (file: File[]) => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const PhotoCaptureDialog = ({
|
|
17
|
+
open,
|
|
18
|
+
isUploading,
|
|
19
|
+
onClose,
|
|
20
|
+
onChange,
|
|
21
|
+
}: PhotoCaptureDialogProps) => {
|
|
22
|
+
const webcamRef = useRef<Webcam | null>(null);
|
|
23
|
+
|
|
24
|
+
const capture = useCallback(async () => {
|
|
25
|
+
if (webcamRef.current) {
|
|
26
|
+
const imageSrc = webcamRef.current.getScreenshot();
|
|
27
|
+
|
|
28
|
+
if (imageSrc) {
|
|
29
|
+
try {
|
|
30
|
+
const file = await base64ToFile(imageSrc, "image/jpeg");
|
|
31
|
+
|
|
32
|
+
onChange([file]);
|
|
33
|
+
|
|
34
|
+
onClose();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
toasts.error({ title: `Failed to convert base64 to file:${error}` });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, [webcamRef]);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Dialog
|
|
44
|
+
onClose={onClose}
|
|
45
|
+
open={open}
|
|
46
|
+
title="Photo Capture"
|
|
47
|
+
maxWidth="md"
|
|
48
|
+
actions={
|
|
49
|
+
<Stack direction="row" gap="5px">
|
|
50
|
+
<Button onClick={onClose} variant="outlined">
|
|
51
|
+
Cancel
|
|
52
|
+
</Button>
|
|
53
|
+
|
|
54
|
+
<Button
|
|
55
|
+
onClick={() => {
|
|
56
|
+
capture();
|
|
57
|
+
}}
|
|
58
|
+
loading={isUploading}
|
|
59
|
+
>
|
|
60
|
+
Save
|
|
61
|
+
</Button>
|
|
62
|
+
</Stack>
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
<Webcam
|
|
66
|
+
mirrored
|
|
67
|
+
ref={webcamRef}
|
|
68
|
+
screenshotFormat="image/jpeg"
|
|
69
|
+
width="835"
|
|
70
|
+
height="600"
|
|
71
|
+
/>
|
|
72
|
+
</Dialog>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const Skeleton = () => {
|
|
4
|
+
return (
|
|
5
|
+
<Stack gap="20px" direction="row" alignItems="center">
|
|
6
|
+
<MuiSkeleton
|
|
7
|
+
width="120px"
|
|
8
|
+
height="120px"
|
|
9
|
+
sx={{
|
|
10
|
+
transform: "scale(1)",
|
|
11
|
+
}}
|
|
12
|
+
></MuiSkeleton>
|
|
13
|
+
<Stack gap="8px">
|
|
14
|
+
<MuiSkeleton
|
|
15
|
+
width={129}
|
|
16
|
+
height="24px"
|
|
17
|
+
sx={{
|
|
18
|
+
transform: "scale(1)",
|
|
19
|
+
}}
|
|
20
|
+
/>
|
|
21
|
+
<MuiSkeleton
|
|
22
|
+
width={129}
|
|
23
|
+
height="16px"
|
|
24
|
+
sx={{
|
|
25
|
+
transform: "scale(1)",
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
</Stack>
|
|
29
|
+
</Stack>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ListItemButton as MuiListItemButton,
|
|
3
|
+
styled,
|
|
4
|
+
type ListItemButtonProps as MuiListItemButtonProps,
|
|
5
|
+
} from "@mui/material";
|
|
6
|
+
import type { ComponentType } from "react";
|
|
7
|
+
|
|
8
|
+
export const StyledListItemButton: ComponentType<
|
|
9
|
+
MuiListItemButtonProps & { selected?: boolean }
|
|
10
|
+
> = styled(MuiListItemButton, {
|
|
11
|
+
shouldForwardProp: (prop) => prop !== "selected",
|
|
12
|
+
})<MuiListItemButtonProps & { selected?: boolean }>(({ theme, selected }) => ({
|
|
13
|
+
background: theme.palette.app.color.iron[600],
|
|
14
|
+
color: theme.palette.app.color.mirage[900],
|
|
15
|
+
borderRadius: "4px",
|
|
16
|
+
//TODO: Manish, Add a transition
|
|
17
|
+
border: `1px solid ${theme.palette.app.color.butterflyBlue[300]}`,
|
|
18
|
+
...(selected
|
|
19
|
+
? {
|
|
20
|
+
background: theme.palette.app.color.deepAqua[500],
|
|
21
|
+
color: theme.palette.app.color.mirage[900],
|
|
22
|
+
borderLeft: `6px solid ${theme.palette.app.color.butterflyBlue[900]}`,
|
|
23
|
+
}
|
|
24
|
+
: {}),
|
|
25
|
+
}));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Stack,
|
|
3
|
+
Typography,
|
|
4
|
+
useTheme,
|
|
5
|
+
type ListItemButtonProps as MuiListItemButtonProps,
|
|
6
|
+
} from "@mui/material";
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import { Tooltip } from "../../Tooltip";
|
|
9
|
+
import { StyledListItemButton } from "./ListItemButton.styled";
|
|
10
|
+
|
|
11
|
+
export type ListItemButtonProps = MuiListItemButtonProps & {
|
|
12
|
+
label: string;
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
companyName?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function ListItemButton({
|
|
18
|
+
label,
|
|
19
|
+
selected,
|
|
20
|
+
actions,
|
|
21
|
+
companyName,
|
|
22
|
+
...restListItemButtonProps
|
|
23
|
+
}: ListItemButtonProps) {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
|
|
26
|
+
const { iron } = theme.palette.app.color;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<StyledListItemButton
|
|
30
|
+
selected={selected}
|
|
31
|
+
alignItems="flex-start"
|
|
32
|
+
{...restListItemButtonProps}
|
|
33
|
+
>
|
|
34
|
+
<Stack
|
|
35
|
+
width="100%"
|
|
36
|
+
flexDirection="row"
|
|
37
|
+
alignItems="center"
|
|
38
|
+
justifyContent="space-between"
|
|
39
|
+
>
|
|
40
|
+
<Stack gap="5px" direction="column">
|
|
41
|
+
<Tooltip toolTipLabel={label}>{label}</Tooltip>
|
|
42
|
+
|
|
43
|
+
<Typography variant="caption" color={iron[800]}>
|
|
44
|
+
{companyName}
|
|
45
|
+
</Typography>
|
|
46
|
+
</Stack>
|
|
47
|
+
|
|
48
|
+
{actions}
|
|
49
|
+
</Stack>
|
|
50
|
+
</StyledListItemButton>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListItemButton";
|