@campxdev/react-blueprint 1.1.8 → 1.1.10
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/package.json +2 -2
- package/src/AppContent.tsx +6 -6
- package/src/assets/fonts/heebo/index.ts +2 -2
- package/src/assets/fonts/poppins/index.ts +5 -5
- package/src/assets/images/gif/index.ts +4 -0
- package/src/assets/images/gif/upload-file.gif +0 -0
- package/src/assets/images/gif/uploading-file.gif +0 -0
- package/src/components/Assets/ErrorPages/InternalServerError.tsx +7 -7
- package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +7 -7
- package/src/components/Assets/ErrorPages/NoItemFound.tsx +7 -7
- package/src/components/Assets/ErrorPages/PageNotFound.tsx +5 -5
- package/src/components/Assets/ErrorPages/UnAuthorized.tsx +6 -6
- package/src/components/Assets/ErrorPages/styles.tsx +15 -15
- package/src/components/Assets/Icons/IconComponents/AcademicIcon.tsx +7 -1
- package/src/components/Assets/Icons/IconComponents/ActiveDevicesIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AdminIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AdministratorIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AlertFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ArrowBackIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AttachmentIcon.tsx +32 -0
- package/src/components/Assets/Icons/IconComponents/BulbIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.tsx +3 -3
- package/src/components/Assets/Icons/IconComponents/CampxIcon.tsx +2 -2
- package/src/components/Assets/Icons/IconComponents/CareerIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CheckedCheckBoxIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CheckedRadioIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ClogWheelIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CollapseIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CrossIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DashBoardIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DeleteIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DeviceIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DocumentIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/DownloadIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/EditIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExamResultIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExcelIcon.tsx +56 -0
- package/src/components/Assets/Icons/IconComponents/ExpandIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExportIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/FilterIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/HelpIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/HomeIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ImageIcon.tsx +44 -0
- package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/InfoIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/InstitutionsIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LeftIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LocationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LogoutIcon.tsx +2 -2
- package/src/components/Assets/Icons/IconComponents/NavigationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/NoteIcon.tsx +7 -1
- package/src/components/Assets/Icons/IconComponents/NotificationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/PdfIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/ProductFeaturesIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ProfileIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RedirectIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RedoIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RightIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/SaveIcon.tsx +39 -39
- package/src/components/Assets/Icons/IconComponents/SearchIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ShareIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/SuccessFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/TicketsIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/UncheckCheckBoxIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/UncheckedRadioIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ViewIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/VisibiityOffIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/VisibilityIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/WarningFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/Icons.tsx +12 -0
- package/src/components/Assets/export.ts +6 -6
- package/src/components/Charts/BarChart/BarChart.tsx +17 -19
- package/src/components/Charts/LineChart/LineChart.tsx +12 -14
- package/src/components/Charts/PieChart/PieChart.tsx +8 -8
- package/src/components/Charts/TreeMap/TreeMap.tsx +15 -15
- package/src/components/Charts/export.ts +4 -4
- package/src/components/Charts/types/types.ts +3 -3
- package/src/components/DataDisplay/Accordion/Accordion.tsx +2 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +14 -3
- package/src/components/DataDisplay/Card/Card.tsx +18 -18
- package/src/components/DataDisplay/Card/styles.tsx +24 -25
- package/src/components/DataDisplay/Chips/Chips.tsx +14 -14
- package/src/components/DataDisplay/DataTable/DataTable.tsx +4 -1
- package/src/components/DataDisplay/DataTable/TablePagination.tsx +10 -10
- package/src/components/DataDisplay/SidePanel/SidePanel.tsx +1 -1
- package/src/components/DataDisplay/Typography/Typography.tsx +1 -1
- package/src/components/Feedback/Alert/Alert.tsx +8 -8
- package/src/components/Feedback/Snackbar/Snackbar.tsx +27 -27
- package/src/components/Feedback/Spinner/Spinner.tsx +2 -2
- package/src/components/Feedback/Tooltip/Tooltip.tsx +6 -6
- package/src/components/Feedback/Tutorial/Tutorial.tsx +45 -45
- package/src/components/Feedback/export.ts +5 -0
- package/src/components/Image/Image.tsx +8 -8
- package/src/components/Input/Button/Button.tsx +2 -2
- package/src/components/Input/DatePicker/DatePicker.tsx +18 -4
- package/src/components/Input/FormActions/FormActions.tsx +15 -4
- package/src/components/Input/FormControlWrapper/FormControlWrapper.tsx +20 -5
- package/src/components/Input/HelpButton/HelpButton.stories.tsx +9 -9
- package/src/components/Input/HelpButton/HelpButton.tsx +4 -4
- package/src/components/Input/IconButtons/IconButtons/DeleteButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/EditButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/RedirectButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/ViewButton.tsx +2 -2
- package/src/components/Input/LabelWrapper/LabelWrapper.tsx +5 -5
- package/src/components/Input/MultiCheckBox/MultiCheckBox.tsx +6 -6
- package/src/components/Input/OtpInput/OtpInput.tsx +17 -17
- package/src/components/Input/PasswordField/PasswordField.tsx +8 -8
- package/src/components/Input/RadioGroup/RadioGroup.tsx +5 -5
- package/src/components/Input/SearchBar/SearchBar.tsx +20 -20
- package/src/components/Input/SingleCheckBox/SIngleCheckBox.tsx +5 -5
- package/src/components/Input/SingleSelect/SingleSelect.tsx +39 -6
- package/src/components/Input/Switch/Switch.tsx +1 -1
- package/src/components/Input/TextField/TextField.tsx +3 -3
- package/src/components/Input/TimePicker/TimePicker.tsx +18 -4
- package/src/components/Input/components/FetchingOptionsLoader.tsx +3 -3
- package/src/components/Input/styles.tsx +6 -6
- package/src/components/Layout/AppHeader/AppHeader.tsx +10 -12
- package/src/components/Layout/AppHeader/AppHeaderActions/CogWheelMenu.tsx +5 -5
- package/src/components/Layout/AppHeader/AppHeaderActions/HeaderActions.tsx +6 -6
- package/src/components/Layout/AppHeader/AppHeaderActions/SwitchInstitution.tsx +37 -37
- package/src/components/Layout/AppHeader/AppHeaderActions/UserBox.tsx +28 -28
- package/src/components/Layout/AppHeader/styles/styles.tsx +24 -24
- package/src/components/Layout/PageHeader/PageHeader.tsx +8 -3
- package/src/components/Layout/TabsLayout/Tabs.tsx +16 -16
- package/src/components/Layout/TabsLayout/TabsLayout.tsx +6 -6
- package/src/components/Layout/export.ts +4 -0
- package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +35 -23
- package/src/components/Navigation/ConfirmDialog/ConfirmDialog.tsx +43 -48
- package/src/components/Navigation/Dialog/Dialog.tsx +33 -0
- package/src/components/Navigation/DialogButton/DialogButton.tsx +17 -81
- package/src/components/Navigation/DropDownMenu/DropDownButton.tsx +4 -4
- package/src/components/Navigation/DropDownMenu/DropDownIcon.tsx +4 -4
- package/src/components/Navigation/DropDownMenu/DropDownMenu.tsx +8 -8
- package/src/components/Navigation/DropDownMenu/DropdownMenuItem.tsx +3 -3
- package/src/components/Navigation/DropDownMenu/styles.tsx +13 -13
- package/src/components/Navigation/PreviewFiles/PreviewFiles.tsx +165 -0
- package/src/components/Navigation/Sidebar/Components.tsx +18 -18
- package/src/components/Navigation/Sidebar/MenuItem.tsx +1 -1
- package/src/components/Navigation/Sidebar/SubMenuItem.tsx +2 -1
- package/src/components/Navigation/Sidebar/interfaces.ts +1 -1
- package/src/components/Navigation/Sidebar/styles.tsx +64 -64
- package/src/components/Navigation/Stepper/Stepper.tsx +5 -5
- package/src/components/Navigation/Stepper/StepperComponents.tsx +15 -15
- package/src/components/Navigation/TabsContainer/TabsContainer.tsx +4 -4
- package/src/components/Navigation/UploadDialog/LoadingUploadDialogContainer.tsx +23 -0
- package/src/components/Navigation/UploadDialog/Styles.tsx +34 -0
- package/src/components/Navigation/UploadDialog/UploadDialog.tsx +143 -0
- package/src/components/Navigation/UploadDialog/UploadDialogContainer.tsx +82 -0
- package/src/components/Navigation/{exports.ts → export.ts} +4 -0
- package/src/components/export.ts +7 -7
- package/src/index.tsx +2 -2
- package/src/store/activeStore.ts +1 -1
- package/src/stories/Assets/Icons.stories.tsx +6 -6
- package/src/stories/Charts/BarChart.stories.tsx +56 -56
- package/src/stories/Charts/LineChart.stories.tsx +49 -49
- package/src/stories/Charts/PieChart.stories.tsx +53 -53
- package/src/stories/Charts/Treemap.stories.tsx +122 -122
- package/src/stories/DataDisplay/AccordionGroup.stories.tsx +11 -12
- package/src/stories/DataDisplay/Card.stories.tsx +34 -34
- package/src/stories/DataDisplay/Chips.stories.tsx +10 -10
- package/src/stories/DataDisplay/CircularAvatar.stories.tsx +6 -6
- package/src/stories/DataDisplay/DataTable.stories.tsx +32 -32
- package/src/stories/DataDisplay/SidePanel.stories.tsx +14 -14
- package/src/stories/DataDisplay/SquareAvatar.stories.tsx +15 -15
- package/src/stories/DesignSystem/colorTokens.stories.tsx +10 -10
- package/src/stories/DesignSystem/typography.stories.tsx +19 -19
- package/src/stories/Feedback/Alert.stories.tsx +9 -9
- package/src/stories/Feedback/Snackbar.stories.tsx +11 -11
- package/src/stories/Feedback/Spinner.stories.tsx +4 -4
- package/src/stories/Feedback/Tooltip.stories.tsx +5 -5
- package/src/stories/Feedback/Tutorial.stories.tsx +13 -13
- package/src/stories/Input/Button.stories.tsx +26 -26
- package/src/stories/Input/DatePicker.stories.tsx +48 -8
- package/src/stories/Input/IconButtons.stories.tsx +6 -6
- package/src/stories/Input/MultiCheckBox.stories.tsx +15 -15
- package/src/stories/Input/OtpInput.stories.tsx +5 -5
- package/src/stories/Input/Password.stories.tsx +7 -7
- package/src/stories/Input/RadioGroup.stories.tsx +14 -14
- package/src/stories/Input/SearchBar.stories.tsx +10 -10
- package/src/stories/Input/SingleCheckBox.stories.tsx +7 -7
- package/src/stories/Input/SingleSelect.stories.tsx +47 -47
- package/src/stories/Input/Switch.stories.tsx +22 -22
- package/src/stories/Input/TextField.stories.tsx +47 -47
- package/src/stories/Input/TimePicker.stories.tsx +44 -7
- package/src/stories/Layout/AppHeader.stories.tsx +13 -13
- package/src/stories/Layout/TabsLayout.stories.tsx +24 -24
- package/src/stories/Navigation/ConfirmDialog.stories.tsx +12 -2
- package/src/stories/Navigation/DialogButton.stories.tsx +38 -45
- package/src/stories/Navigation/DropDownMenu.stories.tsx +24 -24
- package/src/stories/Navigation/FloatingSidebar.stories.tsx +23 -23
- package/src/stories/Navigation/ImportDialog.stories.tsx +45 -0
- package/src/stories/Navigation/PreviewFiles.stories.tsx +80 -0
- package/src/stories/Navigation/Stepper.stories.tsx +15 -15
- package/src/stories/Navigation/TabsContainer.stories.tsx +11 -11
- package/src/themes/MuiThemeProvider.tsx +3 -3
- package/src/themes/colorTokens/colorPalette.tsx +38 -38
- package/src/themes/colorTokens/darkColorTokens.tsx +1 -1
- package/src/themes/colorTokens/lightColorTokens.ts +1 -1
- package/src/themes/commonTheme.ts +13 -3
- package/src/themes/customCssBaseline.ts +2 -2
- package/src/themes/darkTheme.ts +4 -4
- package/src/themes/export.ts +3 -3
- package/src/themes/lightTheme.ts +4 -4
- package/src/utils/constants.ts +5 -5
- package/src/utils/logout.ts +8 -8
- package/src/components/Feedback/exports.ts +0 -5
- package/src/components/Layout/exports.ts +0 -4
- package/src/stories/Navigation/Breadcrumbs.stories.tsx +0 -34
- package/src/utils/campxAxios.ts +0 -18
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// HelpButton.tsx
|
|
2
|
-
import React from
|
|
3
|
-
import { IconButton } from
|
|
4
|
-
import { Icons } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IconButton } from '@mui/material';
|
|
4
|
+
import { Icons } from '../../export';
|
|
5
5
|
|
|
6
6
|
const HelpButton = () => {
|
|
7
7
|
return (
|
|
8
8
|
<IconButton
|
|
9
|
-
href={
|
|
9
|
+
href={'https://campx.atlassian.net/servicedesk/customer/portal/2'}
|
|
10
10
|
target="_blank"
|
|
11
11
|
>
|
|
12
12
|
<Icons.HelpIcon />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonProps, IconButton } from
|
|
2
|
-
import { Icons } from
|
|
1
|
+
import { ButtonProps, IconButton } from '@mui/material';
|
|
2
|
+
import { Icons } from '../../../export';
|
|
3
3
|
|
|
4
4
|
export function DeleteButton({ disabled, ...props }: ButtonProps) {
|
|
5
5
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonProps, IconButton } from
|
|
2
|
-
import { Icons } from
|
|
1
|
+
import { ButtonProps, IconButton } from '@mui/material';
|
|
2
|
+
import { Icons } from '../../../export';
|
|
3
3
|
|
|
4
4
|
export function EditButton({ disabled, ...props }: ButtonProps) {
|
|
5
5
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonProps, IconButton } from
|
|
2
|
-
import { Icons } from
|
|
1
|
+
import { ButtonProps, IconButton } from '@mui/material';
|
|
2
|
+
import { Icons } from '../../../export';
|
|
3
3
|
|
|
4
4
|
export function RedirectButton({ disabled, ...props }: ButtonProps) {
|
|
5
5
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonProps, IconButton } from
|
|
2
|
-
import { Icons } from
|
|
1
|
+
import { ButtonProps, IconButton } from '@mui/material';
|
|
2
|
+
import { Icons } from '../../../export';
|
|
3
3
|
|
|
4
4
|
export function ViewButton({ disabled, ...props }: ButtonProps) {
|
|
5
5
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Stack, StackProps, Typography, useTheme } from
|
|
2
|
-
import { ReactNode } from
|
|
1
|
+
import { Stack, StackProps, Typography, useTheme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
export const LabelWrapper = ({
|
|
5
5
|
required,
|
|
@@ -16,13 +16,13 @@ export const LabelWrapper = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const theme = useTheme();
|
|
18
18
|
return (
|
|
19
|
-
<Stack margin={
|
|
20
|
-
{typeof label ===
|
|
19
|
+
<Stack margin={' 8px 12px'} {...containerProps}>
|
|
20
|
+
{typeof label === 'string' ? (
|
|
21
21
|
<Typography htmlFor={name} component="label" variant="label1">
|
|
22
22
|
{label}
|
|
23
23
|
{required && (
|
|
24
24
|
<span style={{ color: `${theme.palette.tertiary.main}` }}>
|
|
25
|
-
{
|
|
25
|
+
{' *'}
|
|
26
26
|
</span>
|
|
27
27
|
)}
|
|
28
28
|
</Typography>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Stack, StackProps } from
|
|
2
|
-
import { ResponsiveStyleValue } from
|
|
3
|
-
import { ReactNode } from
|
|
4
|
-
import { LabelWrapper } from
|
|
5
|
-
import { SingleCheckBox } from
|
|
1
|
+
import { Stack, StackProps } from '@mui/material';
|
|
2
|
+
import { ResponsiveStyleValue } from '@mui/system';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
|
|
5
|
+
import { SingleCheckBox } from '../SingleCheckBox/SIngleCheckBox';
|
|
6
6
|
|
|
7
7
|
export type MultiCheckboxProps = {
|
|
8
8
|
containerProps?: StackProps;
|
|
9
9
|
options: Array<{ label: ReactNode; value: any }>;
|
|
10
10
|
label: string;
|
|
11
11
|
direction?: ResponsiveStyleValue<
|
|
12
|
-
|
|
12
|
+
'row' | 'row-reverse' | 'column' | 'column-reverse'
|
|
13
13
|
>;
|
|
14
14
|
values: any[];
|
|
15
15
|
onChange: (values: any[]) => void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, { useState, useRef } from
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
|
|
3
3
|
interface OtpInputProps {
|
|
4
4
|
length: number;
|
|
5
5
|
onChangeOtp: (otp: string) => void;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const OtpInput = ({ length, onChangeOtp }:OtpInputProps) => {
|
|
9
|
-
const [otp, setOtp] = useState<string[]>(Array(length).fill(
|
|
8
|
+
const OtpInput = ({ length, onChangeOtp }: OtpInputProps) => {
|
|
9
|
+
const [otp, setOtp] = useState<string[]>(Array(length).fill(''));
|
|
10
10
|
const inputRefs = useRef<HTMLInputElement[]>([]);
|
|
11
11
|
|
|
12
12
|
const handleChange = (element: HTMLInputElement, index: number) => {
|
|
13
13
|
const value = element.value;
|
|
14
|
-
if (/^[0-9]$/.test(value) || value ===
|
|
14
|
+
if (/^[0-9]$/.test(value) || value === '') {
|
|
15
15
|
const newOtp = [...otp];
|
|
16
16
|
newOtp[index] = value;
|
|
17
17
|
setOtp(newOtp);
|
|
18
|
-
onChangeOtp(newOtp.join(
|
|
18
|
+
onChangeOtp(newOtp.join(''));
|
|
19
19
|
|
|
20
20
|
if (value && index < length - 1) {
|
|
21
21
|
inputRefs.current[index + 1].focus();
|
|
@@ -25,17 +25,17 @@ const OtpInput = ({ length, onChangeOtp }:OtpInputProps) => {
|
|
|
25
25
|
|
|
26
26
|
const handleKeyDown = (
|
|
27
27
|
event: React.KeyboardEvent<HTMLInputElement>,
|
|
28
|
-
index: number
|
|
28
|
+
index: number,
|
|
29
29
|
) => {
|
|
30
|
-
if (event.key ===
|
|
30
|
+
if (event.key === 'Backspace' && !otp[index] && index > 0) {
|
|
31
31
|
inputRefs.current[index - 1].focus();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {
|
|
36
36
|
event.preventDefault();
|
|
37
|
-
const paste = event.clipboardData.getData(
|
|
38
|
-
const digits = paste.split(
|
|
37
|
+
const paste = event.clipboardData.getData('text');
|
|
38
|
+
const digits = paste.split('').filter((char) => /^[0-9]$/.test(char));
|
|
39
39
|
|
|
40
40
|
if (digits.length > 0) {
|
|
41
41
|
const newOtp = [...otp];
|
|
@@ -50,30 +50,30 @@ const OtpInput = ({ length, onChangeOtp }:OtpInputProps) => {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
setOtp(newOtp);
|
|
53
|
-
onChangeOtp(newOtp.join(
|
|
53
|
+
onChangeOtp(newOtp.join(''));
|
|
54
54
|
inputRefs.current[Math.min(focusIndex + 1, length - 1)].focus();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
<div style={{ display:
|
|
59
|
+
<div style={{ display: 'flex', gap: '10px' }}>
|
|
60
60
|
{otp.map((value, index) => (
|
|
61
61
|
<input
|
|
62
|
-
|
|
62
|
+
className="MuiOtpInput"
|
|
63
63
|
key={index}
|
|
64
64
|
ref={(el) => (inputRefs.current[index] = el!)}
|
|
65
65
|
type="text"
|
|
66
|
-
value={value ?
|
|
66
|
+
value={value ? '•' : ''}
|
|
67
67
|
onChange={(e) => handleChange(e.target, index)}
|
|
68
68
|
onKeyDown={(e) => handleKeyDown(e, index)}
|
|
69
69
|
onPaste={handlePaste}
|
|
70
70
|
data-index={index}
|
|
71
71
|
maxLength={1}
|
|
72
72
|
style={{
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
75
|
-
textAlign:
|
|
76
|
-
fontSize:
|
|
73
|
+
width: '40px',
|
|
74
|
+
height: '40px',
|
|
75
|
+
textAlign: 'center',
|
|
76
|
+
fontSize: '20px',
|
|
77
77
|
}}
|
|
78
78
|
/>
|
|
79
79
|
))}
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
TextField as MuiTextField,
|
|
5
5
|
TextFieldProps as MuiTextFieldProps,
|
|
6
6
|
StackProps,
|
|
7
|
-
} from
|
|
8
|
-
import { useState } from
|
|
9
|
-
import { VisibilityOffIcon } from
|
|
10
|
-
import { VisibilityIcon } from
|
|
11
|
-
import { Typography } from
|
|
12
|
-
import { LabelWrapper } from
|
|
7
|
+
} from '@mui/material';
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { VisibilityOffIcon } from '../../Assets/Icons/IconComponents/VisibiityOffIcon';
|
|
10
|
+
import { VisibilityIcon } from '../../Assets/Icons/IconComponents/VisibilityIcon';
|
|
11
|
+
import { Typography } from '../../export';
|
|
12
|
+
import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
|
|
13
13
|
|
|
14
14
|
export type PasswordFieldProps = {
|
|
15
15
|
containerProps?: StackProps;
|
|
@@ -24,7 +24,7 @@ export const PasswordField = ({
|
|
|
24
24
|
required = false,
|
|
25
25
|
containerProps,
|
|
26
26
|
description,
|
|
27
|
-
type =
|
|
27
|
+
type = 'text',
|
|
28
28
|
...rest
|
|
29
29
|
}: PasswordFieldProps) => {
|
|
30
30
|
const [showPassword, setShowPassword] = useState(false);
|
|
@@ -45,7 +45,7 @@ export const PasswordField = ({
|
|
|
45
45
|
label={label}
|
|
46
46
|
name={name}
|
|
47
47
|
onChange={onChange}
|
|
48
|
-
type={!showPassword ?
|
|
48
|
+
type={!showPassword ? 'password' : 'text'}
|
|
49
49
|
InputProps={{
|
|
50
50
|
endAdornment: (
|
|
51
51
|
<InputAdornment position="end">
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
RadioGroupProps as MuiRadioGroupProps,
|
|
5
5
|
Radio,
|
|
6
6
|
StackProps,
|
|
7
|
-
} from
|
|
8
|
-
import { ReactNode } from
|
|
9
|
-
import { Typography } from
|
|
10
|
-
import { Icons } from
|
|
11
|
-
import { LabelWrapper } from
|
|
7
|
+
} from '@mui/material';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
10
|
+
import { Icons } from '../../export';
|
|
11
|
+
import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
|
|
12
12
|
|
|
13
13
|
export type RadioGroupProps = {
|
|
14
14
|
containerProps?: StackProps;
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
TextField,
|
|
4
4
|
TextFieldProps,
|
|
5
5
|
styled,
|
|
6
|
-
} from
|
|
7
|
-
import { debounce } from
|
|
8
|
-
import { ReactNode, useMemo, useState } from
|
|
9
|
-
import { SearchIcon } from
|
|
6
|
+
} from '@mui/material';
|
|
7
|
+
import { debounce } from 'lodash';
|
|
8
|
+
import { ReactNode, useMemo, useState } from 'react';
|
|
9
|
+
import { SearchIcon } from '../../Assets/Icons/IconComponents/SearchIcon';
|
|
10
10
|
|
|
11
11
|
export type SearchBarProps = {
|
|
12
12
|
placeholder?: string;
|
|
@@ -16,9 +16,9 @@ export type SearchBarProps = {
|
|
|
16
16
|
} & TextFieldProps;
|
|
17
17
|
|
|
18
18
|
export const SearchBar = ({
|
|
19
|
-
placeholder =
|
|
19
|
+
placeholder = 'Search by Name',
|
|
20
20
|
label,
|
|
21
|
-
value =
|
|
21
|
+
value = '',
|
|
22
22
|
onSearch,
|
|
23
23
|
...rest
|
|
24
24
|
}: SearchBarProps) => {
|
|
@@ -55,27 +55,27 @@ const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
|
55
55
|
margin: 0,
|
|
56
56
|
height: 40,
|
|
57
57
|
backgroundColor: theme.palette.surface.grey,
|
|
58
|
-
|
|
58
|
+
'.MuiFormControl-root': {
|
|
59
59
|
margin: 0,
|
|
60
|
-
height:
|
|
60
|
+
height: '100%',
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
height:
|
|
64
|
-
padding:
|
|
65
|
-
display:
|
|
66
|
-
alignItems:
|
|
62
|
+
'.MuiOutlinedInput-root': {
|
|
63
|
+
height: '100%',
|
|
64
|
+
padding: '5px, 10px',
|
|
65
|
+
display: 'flex',
|
|
66
|
+
alignItems: 'center',
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
height:
|
|
70
|
-
fontSize:
|
|
71
|
-
|
|
68
|
+
'.MuiInputBase-input': {
|
|
69
|
+
height: '100%',
|
|
70
|
+
fontSize: '14px',
|
|
71
|
+
'&::placeholder': {
|
|
72
72
|
color: theme.palette.text.tertiary,
|
|
73
|
-
fontSize:
|
|
73
|
+
fontSize: '14px',
|
|
74
74
|
opacity: 1,
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
height:
|
|
77
|
+
'.MuiOutlinedInput-notchedOutline': {
|
|
78
|
+
height: '100%',
|
|
79
79
|
top: 0,
|
|
80
80
|
borderColor: theme.palette.border.primary,
|
|
81
81
|
},
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
Checkbox as MuiCheckbox,
|
|
4
4
|
CheckboxProps as MuiCheckboxProps,
|
|
5
5
|
useTheme,
|
|
6
|
-
} from
|
|
7
|
-
import { ReactNode } from
|
|
8
|
-
import { Typography } from
|
|
9
|
-
import { Icons } from
|
|
6
|
+
} from '@mui/material';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
9
|
+
import { Icons } from '../../export';
|
|
10
10
|
|
|
11
11
|
export type CheckboxProps = {
|
|
12
12
|
label: ReactNode;
|
|
@@ -36,7 +36,7 @@ export const SingleCheckBox = ({
|
|
|
36
36
|
{label}
|
|
37
37
|
{required && (
|
|
38
38
|
<span style={{ color: `${theme.palette.tertiary.main}` }}>
|
|
39
|
-
{
|
|
39
|
+
{' *'}
|
|
40
40
|
</span>
|
|
41
41
|
)}
|
|
42
42
|
</Typography>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { axios as campxAxios } from '@campxdev/campx-web-utils';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BaseSelectProps,
|
|
4
|
+
Box,
|
|
5
|
+
Autocomplete as MuiAutocomplete,
|
|
6
|
+
Paper,
|
|
7
|
+
PaperProps,
|
|
8
|
+
} from '@mui/material';
|
|
3
9
|
import axios from 'axios';
|
|
4
10
|
import _ from 'lodash';
|
|
5
11
|
import { useEffect, useReducer } from 'react';
|
|
@@ -50,7 +56,13 @@ enum SingleSelectActionsTypes {
|
|
|
50
56
|
APPEND_INTERNAL_OPTIONS = 'append_internal_options',
|
|
51
57
|
CHANGE_HAS_MORE_FLAG = 'change_has_more_flag',
|
|
52
58
|
}
|
|
53
|
-
const singleSelectReducer = (
|
|
59
|
+
const singleSelectReducer = (
|
|
60
|
+
state: any,
|
|
61
|
+
{
|
|
62
|
+
actionType,
|
|
63
|
+
stateChanges,
|
|
64
|
+
}: { actionType: SingleSelectActionsTypes; stateChanges?: any },
|
|
65
|
+
) => {
|
|
54
66
|
switch (actionType) {
|
|
55
67
|
case SingleSelectActionsTypes.OPEN: {
|
|
56
68
|
return { ...state, open: true };
|
|
@@ -133,7 +145,15 @@ export const SingleSelect = ({
|
|
|
133
145
|
offset: 0,
|
|
134
146
|
hasMore: true,
|
|
135
147
|
});
|
|
136
|
-
const {
|
|
148
|
+
const {
|
|
149
|
+
open,
|
|
150
|
+
loadingInternalOptions,
|
|
151
|
+
loadingInitialInternalOptions,
|
|
152
|
+
internalOptions,
|
|
153
|
+
limit,
|
|
154
|
+
offset,
|
|
155
|
+
hasMore,
|
|
156
|
+
} = state;
|
|
137
157
|
|
|
138
158
|
const internalAxios = useCampxAxios ? campxAxios : axios;
|
|
139
159
|
|
|
@@ -178,7 +198,12 @@ export const SingleSelect = ({
|
|
|
178
198
|
|
|
179
199
|
const handleScroll = async (event: any) => {
|
|
180
200
|
const listboxNode = event.currentTarget;
|
|
181
|
-
if (
|
|
201
|
+
if (
|
|
202
|
+
listboxNode.scrollTop + listboxNode.clientHeight >=
|
|
203
|
+
listboxNode.scrollHeight - 1 &&
|
|
204
|
+
hasMore &&
|
|
205
|
+
optionsApiEndPoint
|
|
206
|
+
) {
|
|
182
207
|
dispatch({
|
|
183
208
|
actionType: SingleSelectActionsTypes.LOAD_INTERNAL_OPTIONS_START,
|
|
184
209
|
});
|
|
@@ -234,7 +259,8 @@ export const SingleSelect = ({
|
|
|
234
259
|
if (value && optionsApiEndPoint) {
|
|
235
260
|
fetchInitialOptions().finally(() => {
|
|
236
261
|
dispatch({
|
|
237
|
-
actionType:
|
|
262
|
+
actionType:
|
|
263
|
+
SingleSelectActionsTypes.LOAD_INITIAL_INTERNAL_OPTIONS_END,
|
|
238
264
|
});
|
|
239
265
|
});
|
|
240
266
|
}
|
|
@@ -263,7 +289,14 @@ export const SingleSelect = ({
|
|
|
263
289
|
autoFocus={true}
|
|
264
290
|
value={state.internalOptionsMap[value]}
|
|
265
291
|
renderInput={(params) => (
|
|
266
|
-
<TextField
|
|
292
|
+
<TextField
|
|
293
|
+
{...params}
|
|
294
|
+
label={label}
|
|
295
|
+
required={required}
|
|
296
|
+
name={name}
|
|
297
|
+
error={error}
|
|
298
|
+
helperText={helperText}
|
|
299
|
+
/>
|
|
267
300
|
)}
|
|
268
301
|
PaperComponent={CustomPaper}
|
|
269
302
|
renderOption={(props, option: any) => {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
TextField as MuiTextField,
|
|
3
3
|
TextFieldProps as MuiTextFieldProps,
|
|
4
4
|
StackProps,
|
|
5
|
-
} from
|
|
6
|
-
import { Typography } from
|
|
7
|
-
import { LabelWrapper } from
|
|
5
|
+
} from '@mui/material';
|
|
6
|
+
import { Typography } from '../../export';
|
|
7
|
+
import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
|
|
8
8
|
|
|
9
9
|
export type TextFieldProps = {
|
|
10
10
|
containerProps?: StackProps;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { PickerValidDate } from '@mui/x-date-pickers';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TimePicker as MuiTimePicker,
|
|
4
|
+
TimePickerProps as MuiTimePickerProps,
|
|
5
|
+
} from '@mui/x-date-pickers/TimePicker';
|
|
3
6
|
import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
|
|
4
7
|
|
|
5
|
-
type TimePickerProps<
|
|
8
|
+
type TimePickerProps<
|
|
9
|
+
TDate extends PickerValidDate,
|
|
10
|
+
TEnableAccessibleFieldDOMStructure extends boolean = false,
|
|
11
|
+
> = {
|
|
6
12
|
format?: 'hh:mm a' | 'HH:mm' | 'HH:mm:ss a' | 'HH:mm:ss';
|
|
7
13
|
views?: ('hours' | 'minutes' | 'seconds')[];
|
|
8
14
|
helperText?: string;
|
|
@@ -11,7 +17,10 @@ type TimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStr
|
|
|
11
17
|
containerProps?: any;
|
|
12
18
|
} & MuiTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
13
19
|
|
|
14
|
-
export const TimePicker = <
|
|
20
|
+
export const TimePicker = <
|
|
21
|
+
TDate extends PickerValidDate,
|
|
22
|
+
TEnableAccessibleFieldDOMStructure extends boolean = false,
|
|
23
|
+
>({
|
|
15
24
|
label,
|
|
16
25
|
name,
|
|
17
26
|
value,
|
|
@@ -24,7 +33,12 @@ export const TimePicker = <TDate extends PickerValidDate, TEnableAccessibleField
|
|
|
24
33
|
...rest
|
|
25
34
|
}: TimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>) => {
|
|
26
35
|
return (
|
|
27
|
-
<LabelWrapper
|
|
36
|
+
<LabelWrapper
|
|
37
|
+
label={label}
|
|
38
|
+
required={required}
|
|
39
|
+
name={name}
|
|
40
|
+
containerProps={containerProps}
|
|
41
|
+
>
|
|
28
42
|
<MuiTimePicker
|
|
29
43
|
defaultValue={value}
|
|
30
44
|
format={format}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Typography } from
|
|
2
|
-
import { Spinner } from
|
|
3
|
-
import { FetchingOptionsLoaderContainer } from
|
|
1
|
+
import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
2
|
+
import { Spinner } from '../../Feedback/Spinner/Spinner';
|
|
3
|
+
import { FetchingOptionsLoaderContainer } from '../styles';
|
|
4
4
|
|
|
5
5
|
export const FetchingOptionsLoader = ({ loading }: { loading: boolean }) => {
|
|
6
6
|
return loading ? (
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Box, Stack, styled } from
|
|
1
|
+
import { Box, Stack, styled } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
export const OptionContainer = styled(Box)(({ theme }) => ({
|
|
4
|
-
display:
|
|
5
|
-
flexDirection:
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'column',
|
|
6
6
|
borderBottom: `1px solid ${theme.palette.secondary.main}`,
|
|
7
|
-
width:
|
|
8
|
-
padding:
|
|
7
|
+
width: '100%',
|
|
8
|
+
padding: '5px 0px',
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
11
|
export const FetchingOptionsLoaderContainer = styled(Stack)(({ theme }) => ({
|
|
12
12
|
backgroundColor: theme.palette.background.default,
|
|
13
|
-
maxHeight:
|
|
13
|
+
maxHeight: '32px',
|
|
14
14
|
}));
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Stack } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { StyledHeader } from "./styles/styles";
|
|
8
|
-
import { Button } from "../../export";
|
|
1
|
+
import { Stack } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
4
|
+
import { Button } from '../../export';
|
|
5
|
+
import UserBox from './AppHeaderActions/UserBox';
|
|
6
|
+
import { StyledHeader } from './styles/styles';
|
|
9
7
|
|
|
10
8
|
export interface AppHeaderProps {
|
|
11
9
|
actions?: ReactNode[];
|
|
@@ -24,7 +22,7 @@ export const AppHeader = ({
|
|
|
24
22
|
actions = [],
|
|
25
23
|
profileSx = {},
|
|
26
24
|
clientLogoUrl,
|
|
27
|
-
designation =
|
|
25
|
+
designation = '',
|
|
28
26
|
clientName,
|
|
29
27
|
userFullName,
|
|
30
28
|
collapsed,
|
|
@@ -33,8 +31,8 @@ export const AppHeader = ({
|
|
|
33
31
|
}: AppHeaderProps) => {
|
|
34
32
|
return (
|
|
35
33
|
<StyledHeader collapsed={collapsed} className="appHeader">
|
|
36
|
-
<Typography variant={
|
|
37
|
-
<Stack alignItems={
|
|
34
|
+
<Typography variant={'subtitle2'}>{clientName}</Typography>
|
|
35
|
+
<Stack alignItems={'center'} gap={'12px'} flexDirection={'row'}>
|
|
38
36
|
{/* <StyledIconButton>
|
|
39
37
|
<a
|
|
40
38
|
href={"https://campx.atlassian.net/servicedesk/customer/portal/2"}
|
|
@@ -53,7 +51,7 @@ export const AppHeader = ({
|
|
|
53
51
|
<Typography
|
|
54
52
|
variant="button"
|
|
55
53
|
sx={{
|
|
56
|
-
fontWeight:
|
|
54
|
+
fontWeight: 'bold',
|
|
57
55
|
}}
|
|
58
56
|
>
|
|
59
57
|
Report an Issue
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Divider, IconButton } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
import { DropdownMenu } from
|
|
4
|
-
import { Icons } from
|
|
1
|
+
import { Divider, IconButton } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { DropdownMenu } from '../../../Navigation/DropDownMenu/DropDownMenu';
|
|
4
|
+
import { Icons } from '../../../export';
|
|
5
5
|
// import { clogWheel } from "../../../../assets/images";
|
|
6
6
|
// import DropDownButton from "../../../DropDownButton/DropDownButton";
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ const CogWheelMenu = ({ menu }: { menu: ReactNode[] }) => {
|
|
|
13
13
|
orientation="vertical"
|
|
14
14
|
variant="middle"
|
|
15
15
|
flexItem
|
|
16
|
-
sx={{ height:
|
|
16
|
+
sx={{ height: '20px' }}
|
|
17
17
|
/>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// HeaderActions.tsx
|
|
2
2
|
|
|
3
|
-
import { Divider, Stack } from
|
|
4
|
-
import { ReactNode } from
|
|
5
|
-
import CogWheelMenu from
|
|
6
|
-
import UserBox from
|
|
3
|
+
import { Divider, Stack } from '@mui/material';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import CogWheelMenu from './CogWheelMenu';
|
|
6
|
+
import UserBox from './UserBox';
|
|
7
7
|
|
|
8
8
|
export interface HeaderActionsProps {
|
|
9
9
|
cogWheelMenu: ReactNode[];
|
|
@@ -27,7 +27,7 @@ const HeaderActions = ({
|
|
|
27
27
|
fullName,
|
|
28
28
|
designation,
|
|
29
29
|
userBoxActions = [],
|
|
30
|
-
profileUrl =
|
|
30
|
+
profileUrl = '',
|
|
31
31
|
actions = [],
|
|
32
32
|
profileSx = {},
|
|
33
33
|
avatar = {},
|
|
@@ -44,7 +44,7 @@ const HeaderActions = ({
|
|
|
44
44
|
orientation="vertical"
|
|
45
45
|
variant="middle"
|
|
46
46
|
flexItem
|
|
47
|
-
sx={{ height:
|
|
47
|
+
sx={{ height: '20px' }}
|
|
48
48
|
/>
|
|
49
49
|
</>
|
|
50
50
|
))}
|