@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.
Files changed (145) hide show
  1. package/dist-cjs/{ActionsTray/ActionsTray.jsx → FxActionsTray/FxActionsTray.jsx} +3 -3
  2. package/dist-cjs/FxActionsTray/index.js +5 -0
  3. package/dist-cjs/{AggregationsBar/Aggregations.jsx → FxAggregationsBar/FxAggregations.jsx} +3 -3
  4. package/dist-cjs/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.jsx +5 -5
  5. package/dist-cjs/FxAggregationsBar/index.js +5 -0
  6. package/dist-cjs/{AsyncDropdown/AsyncDropdown.jsx → FxAsyncDropdown/FxAsyncDropdown.jsx} +2 -2
  7. package/dist-cjs/FxAsyncDropdown/index.js +5 -0
  8. package/dist-cjs/FxIcon/index.js +2 -2
  9. package/dist-cjs/FxNumberField/index.js +2 -2
  10. package/dist-cjs/FxProgressCircle/FxProgressCircle.jsx +3 -3
  11. package/dist-cjs/FxProgressCircle/index.js +2 -2
  12. package/dist-cjs/{Score/Score.jsx → FxScore/FxScore.jsx} +3 -3
  13. package/dist-cjs/FxScore/index.js +5 -0
  14. package/dist-cjs/FxShowMore/FxShowMore.jsx +3 -3
  15. package/dist-cjs/FxShowMore/index.js +2 -2
  16. package/dist-cjs/FxSlider/FxSlider.jsx +3 -3
  17. package/dist-cjs/FxSlider/index.js +2 -2
  18. package/dist-cjs/{StatisticsBar/StatisticsBar.jsx → FxStatisticsBar/FxStatisticsBar.jsx} +3 -3
  19. package/dist-cjs/FxStatisticsBar/index.js +5 -0
  20. package/dist-cjs/FxStatusBar/FxStatusBar.jsx +64 -0
  21. package/dist-cjs/FxStatusBar/helpers/constants.js +15 -0
  22. package/dist-cjs/FxStatusBar/index.js +5 -0
  23. package/dist-cjs/FxStatusBar/styles/statusBar.styles.jsx +39 -0
  24. package/dist-cjs/{Tag/Tag.jsx → FxTag/FxTag.jsx} +3 -3
  25. package/dist-cjs/FxTag/index.js +5 -0
  26. package/dist-cjs/FxTextField/FxTextField.jsx +62 -0
  27. package/dist-cjs/FxTextField/index.js +5 -0
  28. package/dist-cjs/FxTodo/FxTodo.jsx +46 -0
  29. package/dist-cjs/FxTodo/index.js +5 -0
  30. package/dist-cjs/FxTodo/styles/todo.styles.jsx +75 -0
  31. package/dist-cjs/FxWizard/FxWizard.jsx +49 -0
  32. package/dist-cjs/FxWizard/WizardContext.jsx +86 -0
  33. package/dist-cjs/FxWizard/index.js +8 -0
  34. package/dist-cjs/FxWizard/styles/wizard.styles.jsx +17 -0
  35. package/dist-cjs/index.js +35 -7
  36. package/dist-es/{ActionsTray/ActionsTray.jsx → FxActionsTray/FxActionsTray.jsx} +1 -1
  37. package/dist-es/FxActionsTray/index.js +1 -0
  38. package/dist-es/{AggregationsBar/Aggregations.jsx → FxAggregationsBar/FxAggregations.jsx} +1 -1
  39. package/dist-es/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.jsx +5 -5
  40. package/dist-es/FxAggregationsBar/index.js +1 -0
  41. package/dist-es/{AsyncDropdown/AsyncDropdown.jsx → FxAsyncDropdown/FxAsyncDropdown.jsx} +1 -1
  42. package/dist-es/FxAsyncDropdown/index.js +1 -0
  43. package/dist-es/FxIcon/index.js +1 -1
  44. package/dist-es/FxNumberField/index.js +1 -1
  45. package/dist-es/FxProgressCircle/FxProgressCircle.jsx +1 -1
  46. package/dist-es/FxProgressCircle/index.js +1 -1
  47. package/dist-es/{Score/Score.jsx → FxScore/FxScore.jsx} +1 -1
  48. package/dist-es/FxScore/index.js +1 -0
  49. package/dist-es/FxShowMore/FxShowMore.jsx +1 -1
  50. package/dist-es/FxShowMore/index.js +1 -1
  51. package/dist-es/FxSlider/FxSlider.jsx +1 -1
  52. package/dist-es/FxSlider/index.js +1 -1
  53. package/dist-es/{StatisticsBar/StatisticsBar.jsx → FxStatisticsBar/FxStatisticsBar.jsx} +1 -1
  54. package/dist-es/FxStatisticsBar/index.js +1 -0
  55. package/dist-es/FxStatusBar/FxStatusBar.jsx +59 -0
  56. package/dist-es/FxStatusBar/helpers/constants.js +12 -0
  57. package/dist-es/FxStatusBar/index.js +1 -0
  58. package/dist-es/FxStatusBar/styles/statusBar.styles.jsx +39 -0
  59. package/dist-es/{Tag/Tag.jsx → FxTag/FxTag.jsx} +1 -1
  60. package/dist-es/FxTag/index.js +1 -0
  61. package/dist-es/FxTextField/FxTextField.jsx +63 -0
  62. package/dist-es/FxTextField/index.js +1 -0
  63. package/dist-es/FxTodo/FxTodo.jsx +41 -0
  64. package/dist-es/FxTodo/index.js +1 -0
  65. package/dist-es/FxTodo/styles/todo.styles.jsx +97 -0
  66. package/dist-es/FxWizard/FxWizard.jsx +46 -0
  67. package/dist-es/FxWizard/WizardContext.jsx +84 -0
  68. package/dist-es/FxWizard/index.js +2 -0
  69. package/dist-es/FxWizard/styles/wizard.styles.jsx +18 -0
  70. package/dist-es/index.js +16 -3
  71. package/dist-types/FxActionsTray/FxActionsTray.d.ts +3 -0
  72. package/dist-types/{ActionsTray → FxActionsTray}/index.d.ts +1 -1
  73. package/dist-types/FxAggregationsBar/FxAggregations.d.ts +3 -0
  74. package/dist-types/{AggregationsBar → FxAggregationsBar}/index.d.ts +1 -1
  75. package/dist-types/FxAsyncDropdown/FxAsyncDropdown.d.ts +3 -0
  76. package/dist-types/{AsyncDropdown → FxAsyncDropdown}/index.d.ts +1 -1
  77. package/dist-types/FxIcon/index.d.ts +2 -1
  78. package/dist-types/FxNumberField/index.d.ts +1 -1
  79. package/dist-types/FxProgressCircle/FxProgressCircle.d.ts +1 -1
  80. package/dist-types/FxProgressCircle/index.d.ts +1 -1
  81. package/dist-types/FxScore/FxScore.d.ts +3 -0
  82. package/dist-types/{Score → FxScore}/index.d.ts +1 -1
  83. package/dist-types/FxShowMore/FxShowMore.d.ts +1 -1
  84. package/dist-types/FxShowMore/index.d.ts +1 -1
  85. package/dist-types/FxSlider/FxSlider.d.ts +1 -1
  86. package/dist-types/FxSlider/index.d.ts +1 -1
  87. package/dist-types/FxStatisticsBar/FxStatisticsBar.d.ts +3 -0
  88. package/dist-types/{StatisticsBar → FxStatisticsBar}/index.d.ts +1 -1
  89. package/dist-types/FxStatusBar/FxStatusBar.d.ts +3 -0
  90. package/dist-types/FxStatusBar/helpers/constants.d.ts +12 -0
  91. package/dist-types/FxStatusBar/index.d.ts +2 -0
  92. package/dist-types/FxStatusBar/styles/statusBar.styles.d.ts +3 -0
  93. package/dist-types/FxTag/FxTag.d.ts +3 -0
  94. package/dist-types/{Tag → FxTag}/index.d.ts +1 -1
  95. package/dist-types/FxTextField/FxTextField.d.ts +4 -0
  96. package/dist-types/FxTextField/index.d.ts +2 -0
  97. package/dist-types/FxTodo/FxTodo.d.ts +3 -0
  98. package/dist-types/FxTodo/index.d.ts +2 -0
  99. package/dist-types/FxTodo/styles/todo.styles.d.ts +8 -0
  100. package/dist-types/FxWizard/FxWizard.d.ts +3 -0
  101. package/dist-types/FxWizard/WizardContext.d.ts +6 -0
  102. package/dist-types/FxWizard/index.d.ts +3 -0
  103. package/dist-types/FxWizard/styles/wizard.styles.d.ts +2 -0
  104. package/dist-types/index.d.ts +16 -4
  105. package/package.json +3 -2
  106. package/dist-cjs/ActionsTray/index.js +0 -5
  107. package/dist-cjs/AggregationsBar/index.js +0 -5
  108. package/dist-cjs/AsyncDropdown/index.js +0 -5
  109. package/dist-cjs/Score/index.js +0 -5
  110. package/dist-cjs/StatisticsBar/index.js +0 -5
  111. package/dist-cjs/Tag/index.js +0 -5
  112. package/dist-es/ActionsTray/index.js +0 -1
  113. package/dist-es/AggregationsBar/index.js +0 -1
  114. package/dist-es/AsyncDropdown/index.js +0 -1
  115. package/dist-es/Score/index.js +0 -1
  116. package/dist-es/StatisticsBar/index.js +0 -1
  117. package/dist-es/Tag/index.js +0 -1
  118. package/dist-types/ActionsTray/ActionsTray.d.ts +0 -3
  119. package/dist-types/AggregationsBar/Aggregations.d.ts +0 -3
  120. package/dist-types/AsyncDropdown/AsyncDropdown.d.ts +0 -3
  121. package/dist-types/Score/Score.d.ts +0 -3
  122. package/dist-types/StatisticsBar/StatisticsBar.d.ts +0 -3
  123. package/dist-types/Tag/Tag.d.ts +0 -3
  124. /package/dist-cjs/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.jsx +0 -0
  125. /package/dist-cjs/{AggregationsBar → FxAggregationsBar}/operations/query.js +0 -0
  126. /package/dist-cjs/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.js +0 -0
  127. /package/dist-cjs/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.jsx +0 -0
  128. /package/dist-cjs/{Score → FxScore}/styles/score.styles.js +0 -0
  129. /package/dist-cjs/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.js +0 -0
  130. /package/dist-cjs/{Tag → FxTag}/styles/tag.styles.jsx +0 -0
  131. /package/dist-es/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.jsx +0 -0
  132. /package/dist-es/{AggregationsBar → FxAggregationsBar}/operations/query.js +0 -0
  133. /package/dist-es/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.js +0 -0
  134. /package/dist-es/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.jsx +0 -0
  135. /package/dist-es/{Score → FxScore}/styles/score.styles.js +0 -0
  136. /package/dist-es/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.js +0 -0
  137. /package/dist-es/{Tag → FxTag}/styles/tag.styles.jsx +0 -0
  138. /package/dist-types/{ActionsTray → FxActionsTray}/styles/actions_tray.styles.d.ts +0 -0
  139. /package/dist-types/{AggregationsBar → FxAggregationsBar}/helpers/structureReader.d.ts +0 -0
  140. /package/dist-types/{AggregationsBar → FxAggregationsBar}/operations/query.d.ts +0 -0
  141. /package/dist-types/{AsyncDropdown → FxAsyncDropdown}/helpers/helpers.d.ts +0 -0
  142. /package/dist-types/{AsyncDropdown → FxAsyncDropdown}/styles/dropdown.styles.d.ts +0 -0
  143. /package/dist-types/{Score → FxScore}/styles/score.styles.d.ts +0 -0
  144. /package/dist-types/{StatisticsBar → FxStatisticsBar}/styles/statistics.styles.d.ts +0 -0
  145. /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,2 @@
1
+ export { FxWizard } from './FxWizard';
2
+ export { WizardContext, WizardContextProvider } from './WizardContext';
@@ -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 { AggregationsBar } from './AggregationsBar';
2
- export { AsyncDropdown } from './AsyncDropdown';
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 { Tag } from './Tag/';
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';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ActionsTrayPropsType } from './actions_tray_types';
3
+ export declare function FxActionsTray({ type, onApprove, onChallenge, onClick, show, onClose, chargesCount, container, direction }: ActionsTrayPropsType): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { ActionsTray } from './ActionsTray';
1
+ export { FxActionsTray } from './FxActionsTray';
2
2
  export type { ActionsTrayPropsType, ActionButtonPropsType } from './actions_tray_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { AggreationsBarPropsType } from './aggregations_types';
3
+ export declare const FxAggregationsBar: (props: AggreationsBarPropsType) => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { AggregationsBar } from './Aggregations';
1
+ export { FxAggregationsBar } from './FxAggregations';
2
2
  export type { AggregationsDataPropsType, AggreationsBarPropsType } from './aggregations_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { AsyncDropdownPropsType } from './async_dropdown_types';
3
+ export declare const FxAsyncDropdown: React.ForwardRefExoticComponent<Omit<AsyncDropdownPropsType, "ref"> & React.RefAttributes<unknown>>;
@@ -1,2 +1,2 @@
1
- export { AsyncDropdown } from './AsyncDropdown';
1
+ export { FxAsyncDropdown } from './FxAsyncDropdown';
2
2
  export type { AsyncDropdownPropsType } from './async_dropdown_types';
@@ -1 +1,2 @@
1
- export { FxIcon as Icon } from "./FxIcon";
1
+ export { FxIcon } from './FxIcon';
2
+ export { IconPropsType } from './icon_types';
@@ -1,2 +1,2 @@
1
- export { FxNumberField as Numberfield } from './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 ProgressCircle({ radius, border, value, hasLabel, max, color, type }: ProgressCirclePropsType): React.JSX.Element;
3
+ export declare function FxProgressCircle({ radius, border, value, hasLabel, max, color, type }: ProgressCirclePropsType): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { ProgressCircle } from './FxProgressCircle';
1
+ export { FxProgressCircle } from './FxProgressCircle';
2
2
  export type { ProgressCirclePropsType } from './progress_circle_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ScorePropsType } from './score_types';
3
+ export declare const FxScore: ({ value, structure, filter, variant, hasLabel, title: propsTitle, Sizes: propsSizes, ...rest }: ScorePropsType) => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { Score } from './Score';
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 ShowMore({ items, label, children, title }: ShowMorePropsType): React.JSX.Element;
3
+ export declare function FxShowMore({ items, label, children, title }: ShowMorePropsType): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { ShowMore } from './FxShowMore';
1
+ export { FxShowMore } from './FxShowMore';
2
2
  export type { ShowMorePropsType } from './show_more_types';
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { SliderPropsType } from './slider_types';
3
- export declare function Slider(props: SliderPropsType): React.JSX.Element;
3
+ export declare function FxSlider(props: SliderPropsType): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { Slider } from './FxSlider';
1
+ export { FxSlider } from './FxSlider';
2
2
  export type { SliderPropsType } from './slider_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { StatisticsPropsType } from './statistics_bar_types';
3
+ export declare function FxStatisticsBar({ value, type, label, structure, collapsed, filter }: StatisticsPropsType): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { StatisticsBar } from './StatisticsBar';
1
+ export { FxStatisticsBar } from './FxStatisticsBar';
2
2
  export type { StatisticsPropsType } from './statistics_bar_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { StatusBarPropsType } from './status_bar_types';
3
+ export declare const FxStatusBar: ({ onChangeStatus, onSearch, defaultStatus, title, options, chipsVariant }: StatusBarPropsType) => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ export declare const statuses: {
2
+ Declined: string;
3
+ Pending: string;
4
+ Approved: string;
5
+ Active: string;
6
+ Challenge: string;
7
+ in_review: string;
8
+ Discrepancy: string;
9
+ no_pricing: string;
10
+ in_progress: string;
11
+ Duplicated: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ export { FxStatusBar } from './FxStatusBar';
2
+ export { StatusBarPropsType } from './status_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>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { TagPropsType } from './tag_types';
3
+ export declare const FxTag: ({ name, count }: TagPropsType) => import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
- export { Tag } from "./Tag";
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,2 @@
1
+ export { FxTextField } from './FxTextField';
2
+ export type { TextFieldPropsType } from './text_field_types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TodoPropsType } from './todo_types';
3
+ export declare function FxTodo({ todo }: TodoPropsType): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { FxTodo } from './FxTodo';
2
+ export { PriorityPropsType, TodoPropsType } from './todo_types';
@@ -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>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { WizardPropsType } from './wizard_types';
3
+ export declare function FxWizard({ open, content, currentPage, reverse, onCancel, title, actions, icon, componentStyles, divider, ...rest }: WizardPropsType): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ContextType } from './wizard_types';
2
+ import React from 'react';
3
+ export declare const WizardContext: React.Context<Partial<ContextType>>;
4
+ export declare const WizardContextProvider: ({ children }: {
5
+ children: JSX.Element;
6
+ }) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { FxWizard } from './FxWizard';
2
+ export type { WizardPropsType } from './wizard_types';
3
+ export { WizardContext, WizardContextProvider } from './WizardContext';
@@ -0,0 +1,2 @@
1
+ export declare const StyledContent: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
2
+ export declare const StyledModal: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
@@ -1,9 +1,21 @@
1
- export type { ActionsTray, ActionsTrayPropsType, ActionButtonPropsType } from './ActionsTray';
2
- export { AggregationsBar, AggreationsBarPropsType, AggregationsDataPropsType } from './AggregationsBar';
3
- export { AsyncDropdown, AsyncDropdownPropsType } from './AsyncDropdown';
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 { Tag, TagPropsType } from './Tag/';
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.5",
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.6"
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; } });