@fixefy/fixefy-ui-components 0.0.6 → 0.0.8
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/{ActionsTray/ActionsTray.jsx → FxActionsTray/FxActionsTray.jsx} +3 -3
- package/dist-cjs/FxActionsTray/index.js +5 -0
- package/dist-cjs/{AggregationsBar/Aggregations.jsx → FxAggregationsBar/FxAggregations.jsx} +3 -3
- package/dist-cjs/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.jsx +5 -5
- package/dist-cjs/FxAggregationsBar/index.js +5 -0
- package/dist-cjs/{AsyncDropdown/AsyncDropdown.jsx → FxAsyncDropdown/FxAsyncDropdown.jsx} +2 -2
- package/dist-cjs/FxAsyncDropdown/index.js +5 -0
- package/dist-cjs/FxIcon/index.js +2 -2
- package/dist-cjs/FxNumberField/index.js +2 -2
- package/dist-cjs/FxProgressCircle/FxProgressCircle.jsx +3 -3
- package/dist-cjs/FxProgressCircle/index.js +2 -2
- package/dist-cjs/{Score/Score.jsx → FxScore/FxScore.jsx} +3 -3
- package/dist-cjs/FxScore/index.js +5 -0
- package/dist-cjs/FxShowMore/FxShowMore.jsx +3 -3
- package/dist-cjs/FxShowMore/index.js +2 -2
- package/dist-cjs/FxSlider/FxSlider.jsx +3 -3
- package/dist-cjs/FxSlider/index.js +2 -2
- package/dist-cjs/{StatisticsBar/StatisticsBar.jsx → FxStatisticsBar/FxStatisticsBar.jsx} +3 -3
- package/dist-cjs/FxStatisticsBar/index.js +5 -0
- package/dist-cjs/FxStatusBar/FxStatusBar.jsx +64 -0
- package/dist-cjs/FxStatusBar/helpers/constants.js +15 -0
- package/dist-cjs/FxStatusBar/index.js +5 -0
- package/dist-cjs/FxStatusBar/styles/statusBar.styles.jsx +39 -0
- package/dist-cjs/{Tag/Tag.jsx → FxTag/FxTag.jsx} +3 -3
- package/dist-cjs/FxTag/index.js +5 -0
- package/dist-cjs/FxTextField/FxTextField.jsx +62 -0
- package/dist-cjs/FxTextField/index.js +5 -0
- package/dist-cjs/FxTodo/FxTodo.jsx +46 -0
- package/dist-cjs/FxTodo/index.js +5 -0
- package/dist-cjs/FxTodo/styles/todo.styles.jsx +75 -0
- package/dist-cjs/FxWizard/FxWizard.jsx +49 -0
- package/dist-cjs/FxWizard/WizardContext.jsx +86 -0
- package/dist-cjs/FxWizard/index.js +8 -0
- package/dist-cjs/FxWizard/styles/wizard.styles.jsx +17 -0
- package/dist-cjs/index.js +35 -7
- package/dist-es/{ActionsTray/ActionsTray.jsx → FxActionsTray/FxActionsTray.jsx} +1 -1
- package/dist-es/FxActionsTray/index.js +1 -0
- package/dist-es/{AggregationsBar/Aggregations.jsx → FxAggregationsBar/FxAggregations.jsx} +1 -1
- package/dist-es/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.jsx +5 -5
- package/dist-es/FxAggregationsBar/index.js +1 -0
- package/dist-es/{AsyncDropdown/AsyncDropdown.jsx → FxAsyncDropdown/FxAsyncDropdown.jsx} +1 -1
- package/dist-es/FxAsyncDropdown/index.js +1 -0
- package/dist-es/FxIcon/index.js +1 -1
- package/dist-es/FxNumberField/index.js +1 -1
- package/dist-es/FxProgressCircle/FxProgressCircle.jsx +1 -1
- package/dist-es/FxProgressCircle/index.js +1 -1
- package/dist-es/{Score/Score.jsx → FxScore/FxScore.jsx} +1 -1
- package/dist-es/FxScore/index.js +1 -0
- package/dist-es/FxShowMore/FxShowMore.jsx +1 -1
- package/dist-es/FxShowMore/index.js +1 -1
- package/dist-es/FxSlider/FxSlider.jsx +1 -1
- package/dist-es/FxSlider/index.js +1 -1
- package/dist-es/{StatisticsBar/StatisticsBar.jsx → FxStatisticsBar/FxStatisticsBar.jsx} +1 -1
- package/dist-es/FxStatisticsBar/index.js +1 -0
- package/dist-es/FxStatusBar/FxStatusBar.jsx +59 -0
- package/dist-es/FxStatusBar/helpers/constants.js +12 -0
- package/dist-es/FxStatusBar/index.js +1 -0
- package/dist-es/FxStatusBar/styles/statusBar.styles.jsx +39 -0
- package/dist-es/{Tag/Tag.jsx → FxTag/FxTag.jsx} +1 -1
- package/dist-es/FxTag/index.js +1 -0
- package/dist-es/FxTextField/FxTextField.jsx +63 -0
- package/dist-es/FxTextField/index.js +1 -0
- package/dist-es/FxTodo/FxTodo.jsx +41 -0
- package/dist-es/FxTodo/index.js +1 -0
- package/dist-es/FxTodo/styles/todo.styles.jsx +97 -0
- package/dist-es/FxWizard/FxWizard.jsx +46 -0
- package/dist-es/FxWizard/WizardContext.jsx +84 -0
- package/dist-es/FxWizard/index.js +2 -0
- package/dist-es/FxWizard/styles/wizard.styles.jsx +18 -0
- package/dist-es/index.js +16 -3
- package/dist-types/FxActionsTray/FxActionsTray.d.ts +3 -0
- package/dist-types/{ActionsTray → FxActionsTray}/index.d.ts +1 -1
- package/dist-types/FxAggregationsBar/FxAggregations.d.ts +3 -0
- package/dist-types/{AggregationsBar → FxAggregationsBar}/index.d.ts +1 -1
- package/dist-types/FxAsyncDropdown/FxAsyncDropdown.d.ts +3 -0
- package/dist-types/{AsyncDropdown → FxAsyncDropdown}/index.d.ts +1 -1
- package/dist-types/FxIcon/index.d.ts +2 -1
- package/dist-types/FxNumberField/index.d.ts +1 -1
- package/dist-types/FxProgressCircle/FxProgressCircle.d.ts +1 -1
- package/dist-types/FxProgressCircle/index.d.ts +1 -1
- package/dist-types/FxScore/FxScore.d.ts +3 -0
- package/dist-types/{Score → FxScore}/index.d.ts +1 -1
- package/dist-types/FxShowMore/FxShowMore.d.ts +1 -1
- package/dist-types/FxShowMore/index.d.ts +1 -1
- package/dist-types/FxSlider/FxSlider.d.ts +1 -1
- package/dist-types/FxSlider/index.d.ts +1 -1
- package/dist-types/FxStatisticsBar/FxStatisticsBar.d.ts +3 -0
- package/dist-types/{StatisticsBar → FxStatisticsBar}/index.d.ts +1 -1
- package/dist-types/FxStatusBar/FxStatusBar.d.ts +3 -0
- package/dist-types/FxStatusBar/helpers/constants.d.ts +12 -0
- package/dist-types/FxStatusBar/index.d.ts +2 -0
- package/dist-types/FxStatusBar/styles/statusBar.styles.d.ts +3 -0
- package/dist-types/FxTag/FxTag.d.ts +3 -0
- package/dist-types/{Tag → FxTag}/index.d.ts +1 -1
- package/dist-types/FxTextField/FxTextField.d.ts +4 -0
- package/dist-types/FxTextField/index.d.ts +2 -0
- package/dist-types/FxTodo/FxTodo.d.ts +3 -0
- package/dist-types/FxTodo/index.d.ts +2 -0
- package/dist-types/FxTodo/styles/todo.styles.d.ts +8 -0
- package/dist-types/FxWizard/FxWizard.d.ts +3 -0
- package/dist-types/FxWizard/WizardContext.d.ts +6 -0
- package/dist-types/FxWizard/index.d.ts +3 -0
- package/dist-types/FxWizard/styles/wizard.styles.d.ts +2 -0
- package/dist-types/index.d.ts +16 -4
- package/package.json +3 -2
- package/dist-cjs/ActionsTray/index.js +0 -5
- package/dist-cjs/AggregationsBar/index.js +0 -5
- package/dist-cjs/AsyncDropdown/index.js +0 -5
- package/dist-cjs/Score/index.js +0 -5
- package/dist-cjs/StatisticsBar/index.js +0 -5
- package/dist-cjs/Tag/index.js +0 -5
- package/dist-es/ActionsTray/index.js +0 -1
- package/dist-es/AggregationsBar/index.js +0 -1
- package/dist-es/AsyncDropdown/index.js +0 -1
- package/dist-es/Score/index.js +0 -1
- package/dist-es/StatisticsBar/index.js +0 -1
- package/dist-es/Tag/index.js +0 -1
- package/dist-types/ActionsTray/ActionsTray.d.ts +0 -3
- package/dist-types/AggregationsBar/Aggregations.d.ts +0 -3
- package/dist-types/AsyncDropdown/AsyncDropdown.d.ts +0 -3
- package/dist-types/Score/Score.d.ts +0 -3
- package/dist-types/StatisticsBar/StatisticsBar.d.ts +0 -3
- package/dist-types/Tag/Tag.d.ts +0 -3
- /package/dist-cjs/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.jsx +0 -0
- /package/dist-cjs/{AggregationsBar → FxAggregationsBar}/operations/query.js +0 -0
- /package/dist-cjs/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.js +0 -0
- /package/dist-cjs/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.jsx +0 -0
- /package/dist-cjs/{Score → FxScore}/styles/score.styles.js +0 -0
- /package/dist-cjs/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.js +0 -0
- /package/dist-cjs/{Tag → FxTag}/styles/tag.styles.jsx +0 -0
- /package/dist-es/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.jsx +0 -0
- /package/dist-es/{AggregationsBar → FxAggregationsBar}/operations/query.js +0 -0
- /package/dist-es/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.js +0 -0
- /package/dist-es/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.jsx +0 -0
- /package/dist-es/{Score → FxScore}/styles/score.styles.js +0 -0
- /package/dist-es/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.js +0 -0
- /package/dist-es/{Tag → FxTag}/styles/tag.styles.jsx +0 -0
- /package/dist-types/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.d.ts +0 -0
- /package/dist-types/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.d.ts +0 -0
- /package/dist-types/{AggregationsBar → FxAggregationsBar}/operations/query.d.ts +0 -0
- /package/dist-types/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.d.ts +0 -0
- /package/dist-types/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.d.ts +0 -0
- /package/dist-types/{Score → FxScore}/styles/score.styles.d.ts +0 -0
- /package/dist-types/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.d.ts +0 -0
- /package/dist-types/{Tag → FxTag}/styles/tag.styles.d.ts +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { titleCase } from '@fixefy/fixefy-ui-utils';
|
|
3
|
+
import { FormControl, FormHelperText, InputBase, InputLabel } from '@mui/material';
|
|
4
|
+
import ErrorRoundedIcon from '@mui/icons-material/ErrorRounded';
|
|
5
|
+
export const FxTextField = ({ autoFocus, droppedItem, defaultValue = '', onChange, structure, endAdornment, startAdornment, required, helperText, error = false, errorText, disabled }) => {
|
|
6
|
+
const [value, setValue] = useState(defaultValue);
|
|
7
|
+
const { input_type, extended: { placeholder, title_path }, title, } = structure;
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (droppedItem) {
|
|
10
|
+
const { item, type } = droppedItem;
|
|
11
|
+
setValue(item[title_path]);
|
|
12
|
+
}
|
|
13
|
+
}, [droppedItem]);
|
|
14
|
+
const _onChange = (e) => {
|
|
15
|
+
onChange && onChange(e);
|
|
16
|
+
setValue(e.target.value);
|
|
17
|
+
};
|
|
18
|
+
return (<FormControl variant="standard" error={error}>
|
|
19
|
+
{title && (<InputLabel shrink htmlFor={title} sx={(theme) => ({
|
|
20
|
+
color: theme.palette.greyscale.light,
|
|
21
|
+
'&.Mui-focused': {
|
|
22
|
+
color: theme.palette.greyscale.light,
|
|
23
|
+
},
|
|
24
|
+
...(disabled && { opacity: '0.3' }),
|
|
25
|
+
'&.Mui-error': { color: theme.palette.greyscale.light },
|
|
26
|
+
...(required && {
|
|
27
|
+
'&:before': {
|
|
28
|
+
content: "'*'",
|
|
29
|
+
color: theme.palette.redscale.main,
|
|
30
|
+
display: 'inline-block',
|
|
31
|
+
marginRight: '5px',
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
})}>
|
|
35
|
+
{titleCase(title)}
|
|
36
|
+
</InputLabel>)}
|
|
37
|
+
<InputBase endAdornment={endAdornment} startAdornment={startAdornment} id={title} autoFocus={autoFocus ? autoFocus : false} placeholder={titleCase(placeholder)} onChange={_onChange} type={input_type && input_type.value} value={value} error={error}/>
|
|
38
|
+
{error && errorText ? (<FormHelperText sx={(theme) => ({
|
|
39
|
+
'&.Mui-error': {
|
|
40
|
+
color: theme.palette.redscale.main,
|
|
41
|
+
},
|
|
42
|
+
display: 'grid',
|
|
43
|
+
gridAutoFlow: 'column',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'left',
|
|
46
|
+
columnGap: theme.spacing(0.6),
|
|
47
|
+
fontSize: '11px',
|
|
48
|
+
})}>
|
|
49
|
+
<ErrorRoundedIcon sx={(theme) => ({
|
|
50
|
+
color: theme.palette.redscale.main,
|
|
51
|
+
width: 10,
|
|
52
|
+
height: 10,
|
|
53
|
+
})}/>
|
|
54
|
+
{titleCase(errorText)}
|
|
55
|
+
</FormHelperText>) : (<FormHelperText sx={(theme) => ({
|
|
56
|
+
color: theme.palette.greyscale.light,
|
|
57
|
+
fontSize: '11px',
|
|
58
|
+
})}>
|
|
59
|
+
{helperText}
|
|
60
|
+
</FormHelperText>)}
|
|
61
|
+
</FormControl>);
|
|
62
|
+
};
|
|
63
|
+
export default FxTextField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FxTextField } from './FxTextField';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { FxAvatar } from '../FxAvatar';
|
|
4
|
+
import { Divider } from '@mui/material';
|
|
5
|
+
import { imageLoader, normalizeTimestamp, titleCase } from '@fixefy/fixefy-ui-utils';
|
|
6
|
+
import { TodoCard, TodoCardHeader, TodoCardContent, TodoCardPriority, TodoCardTag, TodoCardFooter, TodoCardFooterDueDate, TodoCardContentButton } from './styles/todo.styles';
|
|
7
|
+
export function FxTodo({ todo }) {
|
|
8
|
+
return (<TodoCard>
|
|
9
|
+
<TodoCardHeader>
|
|
10
|
+
<TodoCardPriority priority={todo.priority}>
|
|
11
|
+
<Image alt={todo.title} width={16} height={16} loader={() => imageLoader({
|
|
12
|
+
root: 'https://cdn-dev.fixefy.me/',
|
|
13
|
+
src: 'invoices/severity_low.svg',
|
|
14
|
+
})} src={`invoices/severity_${todo.priority}.svg`} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
15
|
+
|
|
16
|
+
{titleCase(todo.priority)}
|
|
17
|
+
</TodoCardPriority>
|
|
18
|
+
{todo.isNew && <TodoCardTag>New</TodoCardTag>}
|
|
19
|
+
</TodoCardHeader>
|
|
20
|
+
<TodoCardContent>
|
|
21
|
+
<p>{titleCase(todo.title)}</p>
|
|
22
|
+
<span>{titleCase(todo.description)}</span>
|
|
23
|
+
{todo.actionTitle && (<TodoCardContentButton size="small" onClick={todo.action ? todo.action : () => { }}>
|
|
24
|
+
{todo.actionTitle}
|
|
25
|
+
</TodoCardContentButton>)}
|
|
26
|
+
</TodoCardContent>
|
|
27
|
+
<Divider sx={{ mb: '16px' }}/>
|
|
28
|
+
<TodoCardFooter>
|
|
29
|
+
<TodoCardFooterDueDate>
|
|
30
|
+
<span>Due Date</span>
|
|
31
|
+
<p>
|
|
32
|
+
{normalizeTimestamp(todo.created_date, {
|
|
33
|
+
dateOnly: true,
|
|
34
|
+
format: 'dd.mm.yyyy',
|
|
35
|
+
})}
|
|
36
|
+
</p>
|
|
37
|
+
</TodoCardFooterDueDate>
|
|
38
|
+
<FxAvatar max={4} isEditable={todo.isUserEditable} users={todo.users}/>
|
|
39
|
+
</TodoCardFooter>
|
|
40
|
+
</TodoCard>);
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FxTodo } from './FxTodo';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { FxButton } from '../../FxButton';
|
|
3
|
+
export const TodoCard = styled('div')(({ theme }) => ({
|
|
4
|
+
background: theme.palette.common.white,
|
|
5
|
+
borderRadius: 8,
|
|
6
|
+
padding: 16,
|
|
7
|
+
marginBottom: 4,
|
|
8
|
+
}));
|
|
9
|
+
export const TodoCardHeader = styled('div')(({ theme }) => ({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'space-between',
|
|
13
|
+
marginBottom: 16,
|
|
14
|
+
}));
|
|
15
|
+
export const TodoCardPriority = styled('div')(({ theme, priority }) => ({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
...theme.typography.table,
|
|
20
|
+
color: theme.palette.priority[priority],
|
|
21
|
+
['& img']: {
|
|
22
|
+
marginRight: 4,
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
export const TodoCardTag = styled('div')(({ theme }) => ({
|
|
26
|
+
...theme.typography.table,
|
|
27
|
+
color: theme.palette.common.white,
|
|
28
|
+
width: 42,
|
|
29
|
+
height: 18,
|
|
30
|
+
background: '#6FCF97',
|
|
31
|
+
borderRadius: 50,
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
}));
|
|
36
|
+
export const TodoCardContent = styled('div')(({ theme }) => ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'flex-start',
|
|
39
|
+
justifyContent: 'space-between',
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
marginBottom: 16,
|
|
42
|
+
['& p']: {
|
|
43
|
+
fontStyle: 'normal',
|
|
44
|
+
fontSize: 14,
|
|
45
|
+
letterSpacing: '0.15px',
|
|
46
|
+
color: theme.palette.typography.title,
|
|
47
|
+
fontWeight: 700,
|
|
48
|
+
lineHeight: '16px',
|
|
49
|
+
margin: 0,
|
|
50
|
+
},
|
|
51
|
+
['& span']: {
|
|
52
|
+
fontStyle: 'normal',
|
|
53
|
+
fontSize: 14,
|
|
54
|
+
letterSpacing: '0.15px',
|
|
55
|
+
color: theme.palette.typography.title,
|
|
56
|
+
fontWeight: 400,
|
|
57
|
+
lineHeight: '20px',
|
|
58
|
+
marginBottom: 16,
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
export const TodoCardContentButton = styled(FxButton)(({ theme }) => ({
|
|
62
|
+
...theme.typography.button,
|
|
63
|
+
color: '#568793',
|
|
64
|
+
fontSize: 12,
|
|
65
|
+
maxHeight: 32,
|
|
66
|
+
minHeight: 32,
|
|
67
|
+
paddingLeft: 12,
|
|
68
|
+
paddingRight: 12,
|
|
69
|
+
}));
|
|
70
|
+
export const TodoCardFooter = styled('div')(({ theme }) => ({
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'space-between',
|
|
74
|
+
flexDirection: 'row',
|
|
75
|
+
}));
|
|
76
|
+
export const TodoCardFooterDueDate = styled('div')(({ theme }) => ({
|
|
77
|
+
display: 'flex',
|
|
78
|
+
alignItems: 'flex-start',
|
|
79
|
+
flexDirection: 'column',
|
|
80
|
+
['& p']: {
|
|
81
|
+
fontWeight: 'normal',
|
|
82
|
+
fontStyle: 'normal',
|
|
83
|
+
fontSize: 11,
|
|
84
|
+
lineHeight: '16px',
|
|
85
|
+
letterSpacing: '0.1px',
|
|
86
|
+
color: theme.palette.typography.title,
|
|
87
|
+
margin: 0,
|
|
88
|
+
},
|
|
89
|
+
['& span']: {
|
|
90
|
+
fontWeight: 'normal',
|
|
91
|
+
fontStyle: 'normal',
|
|
92
|
+
fontSize: 14,
|
|
93
|
+
lineHeight: '24px',
|
|
94
|
+
letterSpacing: '0.15px',
|
|
95
|
+
color: theme.palette.statistics.label,
|
|
96
|
+
},
|
|
97
|
+
}));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Divider } from '@mui/material';
|
|
3
|
+
import { useTransition, animated } from '@react-spring/web';
|
|
4
|
+
import { StyledModal, StyledContent } from './styles/wizard.styles';
|
|
5
|
+
const Animations = {
|
|
6
|
+
rightToLeft: {
|
|
7
|
+
from: {
|
|
8
|
+
opacity: 0,
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
transform: 'translate3d(20%,0,0)',
|
|
11
|
+
width: '100%',
|
|
12
|
+
},
|
|
13
|
+
enter: {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
transform: 'translate3d(0%,0,0)',
|
|
16
|
+
},
|
|
17
|
+
leave: {
|
|
18
|
+
opacity: 0,
|
|
19
|
+
transform: 'translate3d(-10%,0,0)',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
leftToRight: {
|
|
23
|
+
from: { opacity: 0, position: 'absolute', width: '100%' },
|
|
24
|
+
enter: {
|
|
25
|
+
opacity: 1,
|
|
26
|
+
transform: 'translate3d(0%,0,0)',
|
|
27
|
+
},
|
|
28
|
+
leave: {
|
|
29
|
+
opacity: 0,
|
|
30
|
+
transform: 'translate3d(20%,0,0)',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export function FxWizard({ open, content = [], currentPage = 0, reverse = false, onCancel, title, actions, icon, componentStyles, divider = true, ...rest }) {
|
|
35
|
+
const transitions = useTransition(content[currentPage], {
|
|
36
|
+
...Animations[reverse ? 'leftToRight' : 'rightToLeft'],
|
|
37
|
+
keys: null,
|
|
38
|
+
});
|
|
39
|
+
return (<StyledModal {...rest} title={title} actions={actions} icon={icon} isOpen={Boolean(open)} isIconTitleInline onClose={(e) => onCancel(e, '')}>
|
|
40
|
+
{divider && <Divider sx={{ mb: '32px', mt: '16px' }}/>}
|
|
41
|
+
<StyledContent style={{ ...componentStyles }}>
|
|
42
|
+
{transitions((style, item) => (<animated.div style={style}>{item}</animated.div>))}
|
|
43
|
+
</StyledContent>
|
|
44
|
+
{divider && <Divider sx={{ mb: '8px', mt: '32px' }}/>}
|
|
45
|
+
</StyledModal>);
|
|
46
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { FxWizard } from './FxWizard';
|
|
2
|
+
import React, { createContext, useState } from 'react';
|
|
3
|
+
export const WizardContext = createContext({});
|
|
4
|
+
export const WizardContextProvider = ({ children }) => {
|
|
5
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const [content, setContent] = useState([]);
|
|
8
|
+
const [reverse, setReverse] = useState(false);
|
|
9
|
+
const [options, setOptions] = useState({});
|
|
10
|
+
const [modalProps, _setModalProps] = useState({
|
|
11
|
+
shouldCloseOnBackdropClick: true,
|
|
12
|
+
shouldCloseOnEscapeKeyDown: true,
|
|
13
|
+
});
|
|
14
|
+
const [componentStyles, setComponentStyles] = useState({
|
|
15
|
+
width: '100%',
|
|
16
|
+
height: 500,
|
|
17
|
+
contain: 'content',
|
|
18
|
+
overflow: 'scroll',
|
|
19
|
+
});
|
|
20
|
+
const onCancel = (event, reason) => {
|
|
21
|
+
switch (reason) {
|
|
22
|
+
case 'escapeKeyDown': {
|
|
23
|
+
if (modalProps.shouldCloseOnEscapeKeyDown) {
|
|
24
|
+
return setOpen(false);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
case 'backdropClick': {
|
|
31
|
+
if (modalProps.shouldCloseOnBackdropClick) {
|
|
32
|
+
return setOpen(false);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
default: {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const onOpen = () => {
|
|
43
|
+
setOpen(true);
|
|
44
|
+
};
|
|
45
|
+
const nextPage = () => {
|
|
46
|
+
console.log('nextPage');
|
|
47
|
+
};
|
|
48
|
+
const prevPage = () => {
|
|
49
|
+
console.log('prevPage');
|
|
50
|
+
};
|
|
51
|
+
const setModalProps = (newState) => {
|
|
52
|
+
_setModalProps((prevState) => ({
|
|
53
|
+
...prevState,
|
|
54
|
+
...newState,
|
|
55
|
+
}));
|
|
56
|
+
};
|
|
57
|
+
const setPage = (page, option) => {
|
|
58
|
+
if (option) {
|
|
59
|
+
setOptions({ ...options, ...option });
|
|
60
|
+
}
|
|
61
|
+
setCurrentPage((prevCurrentPage) => {
|
|
62
|
+
setReverse(page < prevCurrentPage);
|
|
63
|
+
return page;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const _state = {
|
|
67
|
+
currentPage,
|
|
68
|
+
nextPage,
|
|
69
|
+
prevPage,
|
|
70
|
+
onOpen,
|
|
71
|
+
open,
|
|
72
|
+
setOpen,
|
|
73
|
+
setContent,
|
|
74
|
+
setPage,
|
|
75
|
+
options,
|
|
76
|
+
setModalProps,
|
|
77
|
+
setComponentStyles,
|
|
78
|
+
setOptions,
|
|
79
|
+
};
|
|
80
|
+
return (<WizardContext.Provider value={_state}>
|
|
81
|
+
{children}
|
|
82
|
+
<FxWizard {...modalProps} componentStyles={componentStyles} currentPage={currentPage} reverse={reverse} open={open} onCancel={onCancel} content={content}/>
|
|
83
|
+
</WizardContext.Provider>);
|
|
84
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { FxModal } from '../../FxModal';
|
|
4
|
+
export const StyledContent = styled(Box) ``;
|
|
5
|
+
export const StyledModal = styled(FxModal)(({ theme }) => ({
|
|
6
|
+
'& #customized-dialog-title': {
|
|
7
|
+
...theme.typography.h5,
|
|
8
|
+
color: theme.palette.typography.title,
|
|
9
|
+
padding: 0,
|
|
10
|
+
},
|
|
11
|
+
'& .MuiDialog-paper': {
|
|
12
|
+
maxWidth: '74% !important',
|
|
13
|
+
position: 'relative',
|
|
14
|
+
},
|
|
15
|
+
'& .MuiDialogContent-root': {
|
|
16
|
+
position: 'relative',
|
|
17
|
+
},
|
|
18
|
+
}));
|
package/dist-es/index.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { FxActionsTray } from './FxActionsTray';
|
|
2
|
+
export { FxAggregationsBar } from './FxAggregationsBar';
|
|
3
|
+
export { FxAsyncDropdown } from './FxAsyncDropdown';
|
|
3
4
|
export { FxAvatar } from './FxAvatar';
|
|
4
5
|
export { FxButton } from './FxButton';
|
|
5
6
|
export { FxChip } from './FxChip';
|
|
7
|
+
export { FxIcon } from './FxIcon';
|
|
6
8
|
export { FxModal } from './FxModal';
|
|
9
|
+
export { FxNotes } from './FxNotes';
|
|
10
|
+
export { FxNumberField } from './FxNumberField';
|
|
11
|
+
export { FxProgressCircle } from './FxProgressCircle';
|
|
7
12
|
export { FxProgressCounter } from './FxProgressCounter';
|
|
8
|
-
export {
|
|
13
|
+
export { FxScore } from './FxScore';
|
|
14
|
+
export { FxShowMore } from './FxShowMore';
|
|
15
|
+
export { FxSlider } from './FxSlider';
|
|
16
|
+
export { FxStatisticsBar } from './FxStatisticsBar';
|
|
17
|
+
export { FxStatusBar } from './FxStatusBar';
|
|
18
|
+
export { FxTag } from './FxTag';
|
|
19
|
+
export { FxTextField } from './FxTextField';
|
|
20
|
+
export { FxTodo } from './FxTodo';
|
|
21
|
+
export { FxWizard, WizardContext, WizardContextProvider } from './FxWizard';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxActionsTray } from './FxActionsTray';
|
|
2
2
|
export type { ActionsTrayPropsType, ActionButtonPropsType } from './actions_tray_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxAggregationsBar } from './FxAggregations';
|
|
2
2
|
export type { AggregationsDataPropsType, AggreationsBarPropsType } from './aggregations_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxAsyncDropdown } from './FxAsyncDropdown';
|
|
2
2
|
export type { AsyncDropdownPropsType } from './async_dropdown_types';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { FxIcon
|
|
1
|
+
export { FxIcon } from './FxIcon';
|
|
2
|
+
export { IconPropsType } from './icon_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FxNumberField
|
|
1
|
+
export { FxNumberField } from './FxNumberField';
|
|
2
2
|
export type { NumberfieldPropsType } from './number_field_types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProgressCirclePropsType } from './progress_circle_types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function FxProgressCircle({ radius, border, value, hasLabel, max, color, type }: ProgressCirclePropsType): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxProgressCircle } from './FxProgressCircle';
|
|
2
2
|
export type { ProgressCirclePropsType } from './progress_circle_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxScore } from './FxScore';
|
|
2
2
|
export type { ScorePropsType } from './score_types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ShowMorePropsType } from './show_more_types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function FxShowMore({ items, label, children, title }: ShowMorePropsType): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxShowMore } from './FxShowMore';
|
|
2
2
|
export type { ShowMorePropsType } from './show_more_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxSlider } from './FxSlider';
|
|
2
2
|
export type { SliderPropsType } from './slider_types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxStatisticsBar } from './FxStatisticsBar';
|
|
2
2
|
export type { StatisticsPropsType } from './statistics_bar_types';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const StatusBarCard: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
2
|
+
export declare const StatusBarTitle: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
3
|
+
export declare const StatusChipStyled: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FxTag } from "./FxTag";
|
|
2
2
|
export type { TagPropsType } from "./tag_types";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextFieldPropsType } from './text_field_types';
|
|
3
|
+
export declare const FxTextField: ({ autoFocus, droppedItem, defaultValue, onChange, structure, endAdornment, startAdornment, required, helperText, error, errorText, disabled }: TextFieldPropsType) => React.JSX.Element;
|
|
4
|
+
export default FxTextField;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TodoCard: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
2
|
+
export declare const TodoCardHeader: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
3
|
+
export declare const TodoCardPriority: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
4
|
+
export declare const TodoCardTag: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
5
|
+
export declare const TodoCardContent: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
6
|
+
export declare const TodoCardContentButton: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
7
|
+
export declare const TodoCardFooter: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
8
|
+
export declare const TodoCardFooterDueDate: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { FxActionsTray, ActionsTrayPropsType, ActionButtonPropsType } from './FxActionsTray';
|
|
2
|
+
export { FxAggregationsBar, AggreationsBarPropsType, AggregationsDataPropsType } from './FxAggregationsBar';
|
|
3
|
+
export { FxAsyncDropdown, AsyncDropdownPropsType } from './FxAsyncDropdown';
|
|
4
4
|
export { FxAvatar, AvatarPropsType } from './FxAvatar';
|
|
5
5
|
export { FxButton } from './FxButton';
|
|
6
6
|
export { FxChip, ChipPropsType } from './FxChip';
|
|
7
|
+
export { FxIcon, IconPropsType } from './FxIcon';
|
|
7
8
|
export { FxModal, ModalPropsType } from './FxModal';
|
|
9
|
+
export { FxNotes, NotesPropsType } from './FxNotes';
|
|
10
|
+
export { FxNumberField, NumberfieldPropsType } from './FxNumberField';
|
|
11
|
+
export { FxProgressCircle, ProgressCirclePropsType } from './FxProgressCircle';
|
|
8
12
|
export { FxProgressCounter, ProgressCounterPropsType } from './FxProgressCounter';
|
|
9
|
-
export {
|
|
13
|
+
export { FxScore, ScorePropsType } from './FxScore';
|
|
14
|
+
export { FxShowMore, ShowMorePropsType } from './FxShowMore';
|
|
15
|
+
export { FxSlider, SliderPropsType } from './FxSlider';
|
|
16
|
+
export { FxStatisticsBar, StatisticsPropsType } from './FxStatisticsBar';
|
|
17
|
+
export { FxStatusBar, StatusBarPropsType } from './FxStatusBar';
|
|
18
|
+
export { FxTag, TagPropsType } from './FxTag';
|
|
19
|
+
export { FxTextField, TextFieldPropsType } from './FxTextField';
|
|
20
|
+
export { FxTodo, TodoPropsType } from './FxTodo';
|
|
21
|
+
export { FxWizard, WizardPropsType, WizardContext, WizardContextProvider } from './FxWizard';
|
package/package.json
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@apollo/client": "^3.8.4",
|
|
8
|
-
"@fixefy/fixefy-ui-utils": "^0.0.
|
|
8
|
+
"@fixefy/fixefy-ui-utils": "^0.0.6",
|
|
9
9
|
"@mui/icons-material": "^5.14.11",
|
|
10
10
|
"@mui/material": "^5.14.11",
|
|
11
11
|
"@mui/styled-engine": "^5.14.11",
|
|
12
12
|
"@mui/styles": "^5.14.11",
|
|
13
|
+
"@react-spring/web": "^9.7.3",
|
|
13
14
|
"graphql-tag": "^2.12.6",
|
|
14
15
|
"next": "^13.5.3",
|
|
15
16
|
"react": "^18.2.0",
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
"types": "./dist-types/index.d.ts",
|
|
64
|
-
"version": "0.0.
|
|
65
|
+
"version": "0.0.8"
|
|
65
66
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionsTray = void 0;
|
|
4
|
-
var ActionsTray_1 = require("./ActionsTray");
|
|
5
|
-
Object.defineProperty(exports, "ActionsTray", { enumerable: true, get: function () { return ActionsTray_1.ActionsTray; } });
|