@fixefy/fixefy-ui-components 0.0.42 → 0.0.44

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 (99) hide show
  1. package/package.json +7 -7
  2. package/.prettierrc.json +0 -10
  3. package/.swcrc +0 -20
  4. package/src/FxActionsTray/FxActionsTray.tsx +0 -293
  5. package/src/FxActionsTray/actions_tray_types.d.ts +0 -15
  6. package/src/FxActionsTray/index.ts +0 -3
  7. package/src/FxActionsTray/styles/actions_tray.styles.tsx +0 -90
  8. package/src/FxAggregationsBar/FxAggregations.tsx +0 -32
  9. package/src/FxAggregationsBar/aggregations_types.d.ts +0 -21
  10. package/src/FxAggregationsBar/helpers/structureReader.tsx +0 -66
  11. package/src/FxAggregationsBar/index.ts +0 -2
  12. package/src/FxAggregationsBar/operations/query.ts +0 -64
  13. package/src/FxAsyncDropdown/FxAsyncDropdown.tsx +0 -362
  14. package/src/FxAsyncDropdown/async_dropdown_types.d.ts +0 -40
  15. package/src/FxAsyncDropdown/helpers/helpers.ts +0 -105
  16. package/src/FxAsyncDropdown/index.ts +0 -2
  17. package/src/FxAsyncDropdown/styles/dropdown.styles.tsx +0 -162
  18. package/src/FxAvatar/FxAvatar.tsx +0 -50
  19. package/src/FxAvatar/avatar_types.d.ts +0 -11
  20. package/src/FxAvatar/helpers/stringToColor.ts +0 -16
  21. package/src/FxAvatar/index.ts +0 -2
  22. package/src/FxAvatar/styles/avatar.styles.tsx +0 -82
  23. package/src/FxButton/FxButton.tsx +0 -11
  24. package/src/FxButton/index.ts +0 -2
  25. package/src/FxButton/styles/button.styles.jsx +0 -16
  26. package/src/FxButton/styles/button.styles.tsx +0 -14
  27. package/src/FxChip/FxChip.tsx +0 -14
  28. package/src/FxChip/chip_types.d.ts +0 -34
  29. package/src/FxChip/index.ts +0 -2
  30. package/src/FxChip/styles/chip.styles.tsx +0 -51
  31. package/src/FxIcon/FxIcon.tsx +0 -34
  32. package/src/FxIcon/content/dynamic_icon.tsx +0 -3
  33. package/src/FxIcon/content/index.ts +0 -2
  34. package/src/FxIcon/content/lazy_icon.tsx +0 -48
  35. package/src/FxIcon/icon_types.d.ts +0 -10
  36. package/src/FxIcon/index.ts +0 -2
  37. package/src/FxModal/FxModal.tsx +0 -44
  38. package/src/FxModal/index.ts +0 -2
  39. package/src/FxModal/modal_types.d.ts +0 -10
  40. package/src/FxModal/styles/modal.style.tsx +0 -40
  41. package/src/FxNotes/FxNotes.tsx +0 -165
  42. package/src/FxNotes/helpers/stringToColor.ts +0 -19
  43. package/src/FxNotes/index.ts +0 -2
  44. package/src/FxNotes/note_types.d.ts +0 -12
  45. package/src/FxNotes/operations/queries.ts +0 -21
  46. package/src/FxNotes/styles/notes.styles.tsx +0 -135
  47. package/src/FxNumberField/FxNumberField.tsx +0 -37
  48. package/src/FxNumberField/index.ts +0 -2
  49. package/src/FxNumberField/number_field_types.d.ts +0 -7
  50. package/src/FxNumberField/styles/number_field.styles.ts +0 -85
  51. package/src/FxProgressCircle/FxProgressCircle.tsx +0 -40
  52. package/src/FxProgressCircle/index.ts +0 -2
  53. package/src/FxProgressCircle/progress_circle_types.d.ts +0 -9
  54. package/src/FxProgressCircle/styles/progress_circle.styles.tsx +0 -33
  55. package/src/FxProgressCounter/ProgressCounter.tsx +0 -81
  56. package/src/FxProgressCounter/index.ts +0 -2
  57. package/src/FxProgressCounter/progress_counter_types.d.ts +0 -10
  58. package/src/FxProgressCounter/styles/progress_counter.styles.ts +0 -40
  59. package/src/FxScore/FxScore.tsx +0 -75
  60. package/src/FxScore/index.ts +0 -2
  61. package/src/FxScore/score_types.d.ts +0 -16
  62. package/src/FxScore/styles/score.styles.ts +0 -42
  63. package/src/FxShowMore/FxShowMore.tsx +0 -60
  64. package/src/FxShowMore/index.ts +0 -2
  65. package/src/FxShowMore/show_more_types.d.ts +0 -8
  66. package/src/FxShowMore/styles/show_more.styles.ts +0 -67
  67. package/src/FxSlider/FxSlider.tsx +0 -8
  68. package/src/FxSlider/index.ts +0 -2
  69. package/src/FxSlider/slider_types.d.ts +0 -3
  70. package/src/FxStatisticsBar/FxStatisticsBar.tsx +0 -112
  71. package/src/FxStatisticsBar/index.ts +0 -2
  72. package/src/FxStatisticsBar/statistics_bar_types.d.ts +0 -8
  73. package/src/FxStatisticsBar/styles/statistics.styles.ts +0 -41
  74. package/src/FxStatusBar/FxStatusBar.tsx +0 -66
  75. package/src/FxStatusBar/helpers/constants.ts +0 -12
  76. package/src/FxStatusBar/index.ts +0 -2
  77. package/src/FxStatusBar/status_bar_types.d.ts +0 -14
  78. package/src/FxStatusBar/styles/statusBar.styles.tsx +0 -67
  79. package/src/FxStyledComponents/index.tsx +0 -196
  80. package/src/FxTag/FxTag.tsx +0 -14
  81. package/src/FxTag/fxtag_types.d.ts +0 -4
  82. package/src/FxTag/index.ts +0 -2
  83. package/src/FxTag/styles/tag.styles.tsx +0 -24
  84. package/src/FxTextField/FxTextField.tsx +0 -117
  85. package/src/FxTextField/index.ts +0 -2
  86. package/src/FxTextField/text_field_types.d.ts +0 -20
  87. package/src/FxTodo/FxTodo.tsx +0 -58
  88. package/src/FxTodo/index.ts +0 -2
  89. package/src/FxTodo/styles/todo.styles.tsx +0 -113
  90. package/src/FxTodo/todo_types.d.ts +0 -19
  91. package/src/FxWizard/FxWizard.tsx +0 -56
  92. package/src/FxWizard/WizardContext.tsx +0 -108
  93. package/src/FxWizard/index.ts +0 -3
  94. package/src/FxWizard/styles/wizard.styles.tsx +0 -22
  95. package/src/FxWizard/wizard_types.d.ts +0 -37
  96. package/src/index.ts +0 -23
  97. package/tsconfig.json +0 -22
  98. package/webpack.config.js +0 -35
  99. package/yarn-error.log +0 -95
@@ -1,165 +0,0 @@
1
- import React, { useEffect, useState, useRef } from 'react'
2
-
3
- import {
4
- StyledAvatar,
5
- CommentWrapper,
6
- CommentInput,
7
- CommentsWrapper,
8
- UserComment,
9
- CommentUserTitle,
10
- CommentDate,
11
- CommentDesc,
12
- CommentsContainer,
13
- UserCommentWrapper,
14
- CommentsScrollWrapper,
15
- } from './styles/notes.styles'
16
-
17
- import { ME } from './operations/queries'
18
- import { useQuery } from '@apollo/client'
19
- import { NotesPropsType } from './note_types'
20
- import { stringToColor } from './helpers/stringToColor'
21
- import { normalizeTimestamp, titleCase } from '@fixefy/fixefy-ui-utils'
22
-
23
- type BackgroundColorsType = {
24
- [key: string]: string
25
- }
26
-
27
- export const FxNotes = ({ notes, onChange, onSend }: NotesPropsType) => {
28
- const [comment, setComment] = useState('')
29
- const [backgroundcolors, setBackgroundColors] = useState({} as BackgroundColorsType)
30
- // const [anchorEl] = React.useState<HTMLButtonElement | null>(null)
31
-
32
- const inputRef: HTMLInputElement | any = useRef()
33
-
34
- const { data } = useQuery(ME)
35
- const { me } = data
36
-
37
- // const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
38
- // setAnchorEl(event.currentTarget)
39
- // }
40
-
41
- // const handleClose = () => {
42
- // setAnchorEl(null)
43
- // }
44
-
45
- const handleEnterKeyPressed = () => {
46
- setComment((prevState) => {
47
- if (prevState) {
48
- onSend &&
49
- onSend({
50
- created_at: new Date().getTime(),
51
- created_by: me.username,
52
- text: prevState,
53
- })
54
- }
55
-
56
- return ''
57
- })
58
- }
59
-
60
- useEffect(() => {
61
- onChange && onChange(comment)
62
- }, [comment])
63
-
64
- useEffect(() => {
65
- if (inputRef.current) {
66
- inputRef.current.addEventListener('keyup', (event: any) => {
67
- if (event.keyCode === 13) {
68
- event.preventDefault()
69
- handleEnterKeyPressed()
70
- }
71
- })
72
- }
73
-
74
- return inputRef && inputRef.current && inputRef.current.removeEventListener('keyup', handleEnterKeyPressed)
75
- }, [])
76
-
77
- // const open = Boolean(anchorEl)
78
- // const id = open ? 'simple-popover' : undefined
79
-
80
- return (
81
- <CommentsContainer>
82
- {/* <StyledPopover
83
- id={id}
84
- open={open}
85
- anchorEl={anchorEl}
86
- onClose={handleClose}
87
- anchorOrigin={{
88
- vertical: 'bottom',
89
- horizontal: 'left',
90
- }}>
91
- <span>asd</span>
92
- <span>asd</span>
93
- <span>asd</span>
94
- <span>asd</span>
95
- </StyledPopover> */}
96
- <CommentWrapper>
97
- <StyledAvatar
98
- sx={{
99
- backgroundColor: backgroundcolors[me.username]
100
- ? backgroundcolors[me.username]
101
- : stringToColor(me.username, (color) => {
102
- setBackgroundColors({
103
- ...backgroundcolors,
104
- [me.username]: color,
105
- })
106
- }),
107
- }}
108
- src={me && me.image_url}
109
- >
110
- {me && titleCase(me.username.slice(0, 1))}
111
- </StyledAvatar>
112
- <CommentInput
113
- type='text'
114
- value={comment}
115
- ref={inputRef}
116
- onChange={(e: React.FormEvent<HTMLInputElement>) => {
117
- setComment(e.currentTarget.value)
118
- }}
119
- />
120
- {/* <Button aria-describedby={id} onClick={handleClick}>
121
- asd
122
- </Button> */}
123
- </CommentWrapper>
124
- {notes && notes.length ? (
125
- <CommentsWrapper>
126
- <CommentsScrollWrapper>
127
- {notes
128
- .slice()
129
- .reverse()
130
- .map((comment, index) => {
131
- return (
132
- <UserCommentWrapper key={index}>
133
- <StyledAvatar
134
- sx={{
135
- backgroundColor: backgroundcolors[comment.created_by]
136
- ? backgroundcolors[comment.created_by]
137
- : stringToColor(comment.created_by, (color) => {
138
- setBackgroundColors({
139
- ...backgroundcolors,
140
- [comment.created_by]: color,
141
- })
142
- }),
143
- }}
144
- // src={comment.image_url}
145
- >
146
- {titleCase(comment.created_by.slice(0, 1))}
147
- </StyledAvatar>
148
- <UserComment>
149
- <CommentUserTitle>{comment.created_by}</CommentUserTitle>
150
- <CommentDate>
151
- {normalizeTimestamp(comment.created_at, {
152
- dateOnly: true,
153
- })}
154
- </CommentDate>
155
- <CommentDesc>{comment.text}</CommentDesc>
156
- </UserComment>
157
- </UserCommentWrapper>
158
- )
159
- })}
160
- </CommentsScrollWrapper>
161
- </CommentsWrapper>
162
- ) : null}
163
- </CommentsContainer>
164
- )
165
- }
@@ -1,19 +0,0 @@
1
- export const stringToColor = (string: string, callBack?: (color: string) => void) => {
2
- let hash = 0
3
- let color = '#'
4
- if (!string) {
5
- return '#000'
6
- }
7
- /* eslint-disable no-bitwise */
8
- for (let i = 0; i < string.length; i += 1) {
9
- hash = string.charCodeAt(i) + ((hash << 5) - hash)
10
- }
11
-
12
- for (let i = 0; i < 3; i += 1) {
13
- const value = (hash >> (i * 8)) & 0xff
14
- color += `00${value.toString(16)}`.substr(-2)
15
- }
16
- /* eslint-enable no-bitwise */
17
- callBack && callBack(color)
18
- return color
19
- }
@@ -1,2 +0,0 @@
1
- export { FxNotes } from './FxNotes'
2
- export type { NotesPropsType } from './note_types'
@@ -1,12 +0,0 @@
1
- type NoteCreateInput = {
2
- created_at: number
3
- created_by: string
4
- text: string
5
- }
6
-
7
- export type NotesPropsType = {
8
- notes?: NoteCreateInput[]
9
- onChange?: (comment: string) => void
10
- onSend?: (noteCreateInput: NoteCreateInput) => void
11
- sendOnEnter?: boolean
12
- }
@@ -1,21 +0,0 @@
1
- import gql from 'graphql-tag'
2
-
3
- export const ME = gql`
4
- query ME {
5
- me {
6
- _id
7
- username
8
- first_name
9
- last_name
10
- email
11
- workspaces {
12
- ...InsideWorkspace
13
- }
14
- }
15
- }
16
-
17
- fragment InsideWorkspace on Workspace {
18
- _id
19
- title
20
- }
21
- `
@@ -1,135 +0,0 @@
1
- import Popover from '@mui/material/Popover'
2
-
3
- import { styled } from '@mui/material/styles'
4
- import { Avatar as _Avatar } from '@mui/material'
5
-
6
- import '@fixefy/fixefy-ui-utils'
7
-
8
- export const CommentsContainer: any = styled('div')(() => ({
9
- display: 'flex',
10
- flexDirection: 'column',
11
- marginTop: 16,
12
- justifyContent: 'space-between',
13
- alignItems: 'flex-start',
14
- }))
15
-
16
- export const CommentsWrapper: any = styled('div')(({}) => ({
17
- display: 'flex',
18
- alignItems: 'flex-start',
19
- flexDirection: 'column',
20
- justifyContent: 'center',
21
- width: '100%',
22
- }))
23
-
24
- export const CommentsScrollWrapper: any = styled('div')(({}) => ({
25
- maxHeight: 170,
26
- overflow: 'auto',
27
- width: '100%',
28
- }))
29
-
30
- export const UserCommentWrapper: any = styled('div')(({}) => ({
31
- display: 'flex',
32
- alignItems: 'flex-start',
33
- marginTop: 16,
34
- '&:first-of-type': {
35
- marginTop: 0,
36
- },
37
- }))
38
-
39
- export const CommentWrapper: any = styled('div')(({}) => ({
40
- display: 'flex',
41
- alignItems: 'center',
42
- width: '100%',
43
- marginBottom: 16,
44
- }))
45
-
46
- export const CommentInput: any = styled('input')(({ theme }) => ({
47
- background: theme.palette.common.white,
48
- border: '1px solid #F0F0F0',
49
- borderRadius: '4px',
50
- height: 36,
51
- padding: '0 16px',
52
-
53
- fontStyle: 'normal',
54
- fontWeight: 'normal',
55
- fontSize: 14,
56
- lineHeight: '20px',
57
- letterSpacing: '0.15px',
58
- color: '#172326',
59
-
60
- width: '100%',
61
-
62
- '&::focus-visible': {
63
- outline: 'unset',
64
- },
65
- }))
66
-
67
- export const StyledAvatar: any = styled(_Avatar)(({ theme }) => ({
68
- width: 32,
69
- height: 32,
70
- border: `2px solid ${theme.palette.common.white}`,
71
- marginRight: '8px',
72
-
73
- fontFamily: 'Open Sans',
74
- fontStyle: 'normal',
75
- fontWeight: 'normal',
76
- fontSize: 14,
77
- lineHeight: '20px',
78
- letterSpacing: '0.15px',
79
- }))
80
-
81
- export const UserComment: any = styled('div')(({ theme }) => ({
82
- background: theme.palette.greyscale.contrastText,
83
- border: '1px solid #F0F0F0',
84
- borderRadius: '4px',
85
- padding: '8px 16px',
86
- minWidth: 300,
87
-
88
- display: 'flex',
89
- alignItems: 'flex-start',
90
- flexDirection: 'column',
91
- justifyContent: 'center',
92
- }))
93
-
94
- export const CommentUserTitle: any = styled('div')(({}) => ({
95
- fontStyle: 'normal',
96
- fontWeight: 'normal',
97
- fontSize: 11,
98
- lineHeight: '16px',
99
- letterSpacing: '0.15px',
100
- color: '#172326',
101
- }))
102
-
103
- export const CommentDate: any = styled('div')(({}) => ({
104
- fontStyle: 'normal',
105
- fontWeight: 'normal',
106
- fontSize: 11,
107
- lineHeight: '16px',
108
- letterSpacing: '0.15px',
109
- color: '#898989',
110
- }))
111
-
112
- export const CommentDesc: any = styled('div')(({}) => ({
113
- fontStyle: 'normal',
114
- fontWeight: 'normal',
115
- fontSize: 14,
116
- lineHeight: '20px',
117
- letterSpacing: '0.15px',
118
- color: '#172326',
119
- }))
120
-
121
- export const StyledPopover: any = styled(Popover)(({ theme }) => ({
122
- position: 'absolute',
123
- right: 12,
124
- width: 80,
125
- height: 16,
126
- background: '#F7F7F7',
127
- borderRadius: 4,
128
- fontFamily: 'Open Sans',
129
- fontStyle: 'normal',
130
- fontWeight: 'normal',
131
- fontSize: 11,
132
- lineHeight: '16px',
133
- letterSpacing: '0.1px',
134
- color: theme.palette.primary.light,
135
- }))
@@ -1,37 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { useStyles } from './styles/number_field.styles'
3
- import { NumberfieldPropsType } from './number_field_types'
4
-
5
- import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'
6
-
7
- export function FxNumberField({ placeholder, defaultValue, label, hint, onChange }: NumberfieldPropsType) {
8
- const _classes = useStyles()
9
- const [value, setValue] = useState(defaultValue || 0)
10
-
11
- useEffect(() => {
12
- onChange && onChange(value)
13
- }, [value])
14
- return (
15
- <div className={_classes.container}>
16
- {label && <span className={_classes.label}>{label}</span>}
17
- <div className={_classes.inputWrapper}>
18
- <input
19
- type="number"
20
- placeholder={placeholder}
21
- value={value}
22
- //@ts-ignore
23
- onChange={(e) => setValue(e.target.value)}
24
- />
25
- <div className={_classes.inputActions}>
26
- <button className={_classes.inputActionsPlus} onClick={() => setValue(value + 1)}>
27
- <KeyboardArrowRightIcon />
28
- </button>
29
- <button className={_classes.inputActionsMinus} onClick={() => setValue(value - 1)}>
30
- <KeyboardArrowRightIcon />
31
- </button>
32
- </div>
33
- </div>
34
- {hint && <span className={_classes.hint}>{hint}</span>}
35
- </div>
36
- )
37
- }
@@ -1,2 +0,0 @@
1
- export { FxNumberField } from './FxNumberField'
2
- export type { NumberfieldPropsType } from './number_field_types'
@@ -1,7 +0,0 @@
1
- export type NumberfieldPropsType = {
2
- placeholder?: string
3
- label?: string
4
- hint?: string
5
- defaultValue?: number
6
- onChange?: (value: number) => void
7
- }
@@ -1,85 +0,0 @@
1
- import { makeStyles } from '@mui/styles'
2
-
3
- export const useStyles = makeStyles(() => ({
4
- container: {},
5
- label: {
6
- fontFamily: 'Open Sans',
7
- fontStyle: 'normal',
8
- fontWeight: 'normal',
9
- fontSize: 11,
10
- lineHeight: '16px',
11
- letterSpacing: 0.1,
12
- color: '#505050',
13
- },
14
- hint: {
15
- fontStyle: 'normal',
16
- fontWeight: 'normal',
17
- fontSize: 11,
18
- lineHeight: '16px',
19
- display: 'flex',
20
- alignItems: 'center',
21
- letterSpacing: 0.1,
22
- color: '#8A8A8A',
23
- },
24
- inputWrapper: {
25
- background: '#FFFFFF',
26
- border: '1px solid #EEEEEE',
27
- borderRadius: 5,
28
- height: 40,
29
- display: 'flex',
30
- width: 'fit-content',
31
- ['& input']: {
32
- border: 'none',
33
- paddingLeft: 10,
34
- borderRadius: 5,
35
- ['&:focus-visible']: {
36
- outline: 'none',
37
- },
38
- ['&::-webkit-inner-spin-button']: {
39
- '-webkit-appearance': 'none',
40
- },
41
- ['&::-webkit-outer-spin-button']: {
42
- '-webkit-appearance': 'none',
43
- },
44
- },
45
- },
46
- inputActions: {
47
- display: 'flex',
48
- flexDirection: 'column',
49
- alignItems: 'center',
50
- justifyContent: 'center',
51
- },
52
- inputActionsPlus: {
53
- cursor: 'pointer',
54
- background: '#FFFFFF',
55
- height: '50%',
56
- padding: 0,
57
- width: 36,
58
- border: 'none',
59
- borderLeft: '1px solid #EEEEEE',
60
- borderBottom: '1px solid #EEEEEE',
61
- borderRadius: '0 5px 0 0',
62
- color: '#568793',
63
- ['& svg']: {
64
- transform: 'rotate(270deg)',
65
- width: 20,
66
- height: 20,
67
- },
68
- },
69
- inputActionsMinus: {
70
- cursor: 'pointer',
71
- background: '#FFFFFF',
72
- height: '50%',
73
- padding: 0,
74
- width: 36,
75
- border: 'none',
76
- borderLeft: '1px solid #EEEEEE',
77
- borderRadius: '0 0 5px 0',
78
- color: '#568793',
79
- ['& svg']: {
80
- transform: 'rotate(90deg)',
81
- width: 20,
82
- height: 20,
83
- },
84
- },
85
- }))
@@ -1,40 +0,0 @@
1
- import React from 'react'
2
- import { Container, Label, Slider, SliderCircle, SliderBar } from './styles/progress_circle.styles'
3
- import { ProgressCirclePropsType } from './progress_circle_types'
4
-
5
- export const FxProgressCircle = ({ radius = 70, border = 70, value, hasLabel = true, max = 100, color, type = 'progress' }: ProgressCirclePropsType) => {
6
- const _value = value ? value / max : 0
7
- const p = 2 * Math.PI * (radius - border / 2)
8
-
9
- const strokeWidth = border
10
- const strokeDashoffset = p * (1 - _value)
11
- const strokeDasharray = p
12
-
13
- const label = type === 'progress' ? `${value}/${max}` : `${value.toFixed()}%`
14
-
15
- return (
16
- <Container>
17
- {hasLabel && type === 'progress' && <Label>{label}</Label>}
18
- <Slider
19
- // ref={(potar) => (potar = potar)}
20
- viewBox={`0 0 ${radius * 2} ${radius * 2}`}
21
- // onMouseDown={this.handleMouseDown}
22
- >
23
- <SliderCircle style={{ strokeWidth }} r={radius - border / 2} cx={radius} cy={radius} color={color} />
24
-
25
- <SliderBar
26
- style={{
27
- strokeWidth,
28
- strokeDashoffset,
29
- strokeDasharray,
30
- }}
31
- r={radius - border / 2}
32
- cx={radius}
33
- cy={radius}
34
- color={color}
35
- />
36
- </Slider>
37
- {hasLabel && type === 'percentage' && <Label sx={{ ml: 1 }}>{label}</Label>}
38
- </Container>
39
- )
40
- }
@@ -1,2 +0,0 @@
1
- export { FxProgressCircle } from './FxProgressCircle'
2
- export type { ProgressCirclePropsType } from './progress_circle_types'
@@ -1,9 +0,0 @@
1
- export type ProgressCirclePropsType = {
2
- radius?: number
3
- border?: number
4
- value: number
5
- hasLabel?: boolean
6
- max?: number
7
- color?: string
8
- type?: 'percentage' | 'progress'
9
- }
@@ -1,33 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
-
3
- export const Container = styled("div")(({ }) => ({
4
- display: "flex",
5
- alignItems: "center",
6
- justifyContent: "center",
7
- }));
8
-
9
- export const Label = styled("span")(({ theme }) => ({
10
- ...theme.typography.body1,
11
- color: theme.palette.typography.title,
12
- marginRight: 8,
13
- }));
14
-
15
- export const Slider = styled("svg")(({ }) => ({
16
- display: "block",
17
- width: 22,
18
- height: 22,
19
- transform: "rotate(-90deg)",
20
- }));
21
-
22
- export const SliderCircle = styled("circle")(({ theme, color }) => ({
23
- fill: "transparent",
24
- stroke: color ?? theme.palette.green2scale.main,
25
- opacity: 0.1,
26
- }));
27
-
28
- export const SliderBar = styled("circle")(({ theme, color }) => ({
29
- fill: "transparent",
30
- stroke: color ?? theme.palette.green2scale.main,
31
- strokeDashoffset: 0,
32
- strokeDasharray: 0,
33
- }));
@@ -1,81 +0,0 @@
1
- // @ts-nocheck
2
- import React from 'react'
3
-
4
- import { Box, Typography } from '@mui/material'
5
- import { imageLoader } from '@fixefy/fixefy-ui-utils'
6
- import { ProgressCounterPropsType } from './progress_counter_types'
7
- import { Container, ProgressContainer, MainBar, BackgroundBar } from './styles/progress_counter.styles'
8
-
9
- import Image from 'next/image'
10
-
11
- export function FxProgressCounter({ values, structure, filter, ...rest }: ProgressCounterPropsType) {
12
- // const { extended, title } = structure ?? {};
13
- // const {
14
- // gql_operation,
15
- // object_path: objectPath,
16
- // title_path: titlePath,
17
- // filter: structureFilter,
18
- // } = extended ?? {};
19
- const initialValues = {
20
- count: values?.count ?? 0,
21
- current: values?.current ?? 0,
22
- }
23
-
24
- // let _filter = structureFilter;
25
-
26
- // if (filter) {
27
- // _filter = {
28
- // ..._filter,
29
- // ...filter,
30
- // };
31
- // }
32
-
33
- // const { data, error, loading } = useQuery(gql(gql_operation), {
34
- // variables: {
35
- // where: { ..._filter },
36
- // },
37
- // });
38
-
39
- const normalizeNumber = (number) => {
40
- return (number / initialValues.count) * 100
41
- }
42
-
43
- return (
44
- <Container>
45
- {/* {false ? (
46
- <Skeleton animation="wave" variant="text" width={68} height={68} />
47
- ) : ( */}
48
- <Box position={'relative'} textAlign={'center'} justifyContent={'center'} mt={1.2}>
49
- <Image
50
- alt={'approve'}
51
- width={16}
52
- height={16}
53
- loader={() =>
54
- imageLoader({
55
- root: 'https://cdn-dev.fixefy.me/',
56
- src: 'invoices/approve-small-white.svg',
57
- }) as any
58
- }
59
- src={'invoices/approve-small-white.svg'}
60
- onLoad={() => console.log('loaded')}
61
- onError={(e) => console.log('error:', e)}
62
- />
63
-
64
- <Box mt={0.5}>
65
- <Typography fontSize={19} fontWeight={600}>
66
- {initialValues.current}/{initialValues.count}
67
- </Typography>
68
- </Box>
69
-
70
- <Typography fontSize={11} sx={{ opacity: 0.6 }}>
71
- Charges
72
- </Typography>
73
- </Box>
74
-
75
- <ProgressContainer>
76
- <MainBar variant="determinate" value={normalizeNumber(initialValues.current)} color={'inherit'} {...rest} />
77
- <BackgroundBar variant="determinate" value={initialValues.count > 100 ? 100 : initialValues.count} color={'inherit'} {...rest} />
78
- </ProgressContainer>
79
- </Container>
80
- )
81
- }
@@ -1,2 +0,0 @@
1
- export { FxProgressCounter } from './ProgressCounter'
2
- export type { ProgressCounterPropsType } from './progress_counter_types'
@@ -1,10 +0,0 @@
1
- export type ProgressCounterPropsType = {
2
- values?: {
3
- count: number
4
- current: number
5
- }
6
- structure?: any
7
- [x: string]: any
8
- filter?: object
9
- ctx?: any
10
- }