@fixefy/fixefy-ui-components 0.0.37 → 0.0.38

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 (102) hide show
  1. package/.prettierrc.json +10 -0
  2. package/.swcrc +20 -0
  3. package/build/FxTag/FxTag.js +41 -0
  4. package/build/FxTag/fxtag_types.d.js +4 -0
  5. package/build/FxTag/index.js +20 -0
  6. package/build/FxTag/styles/tag.styles.js +94 -0
  7. package/package.json +3 -5
  8. package/src/FxActionsTray/FxActionsTray.tsx +293 -0
  9. package/src/FxActionsTray/actions_tray_types.d.ts +15 -0
  10. package/src/FxActionsTray/index.ts +3 -0
  11. package/src/FxActionsTray/styles/actions_tray.styles.tsx +90 -0
  12. package/src/FxAggregationsBar/FxAggregations.tsx +32 -0
  13. package/src/FxAggregationsBar/aggregations_types.d.ts +21 -0
  14. package/src/FxAggregationsBar/helpers/structureReader.tsx +66 -0
  15. package/src/FxAggregationsBar/index.ts +2 -0
  16. package/src/FxAggregationsBar/operations/query.ts +64 -0
  17. package/src/FxAsyncDropdown/FxAsyncDropdown.tsx +362 -0
  18. package/src/FxAsyncDropdown/async_dropdown_types.d.ts +40 -0
  19. package/src/FxAsyncDropdown/helpers/helpers.ts +105 -0
  20. package/src/FxAsyncDropdown/index.ts +2 -0
  21. package/src/FxAsyncDropdown/styles/dropdown.styles.tsx +162 -0
  22. package/src/FxAvatar/FxAvatar.tsx +50 -0
  23. package/src/FxAvatar/avatar_types.d.ts +11 -0
  24. package/src/FxAvatar/helpers/stringToColor.ts +16 -0
  25. package/src/FxAvatar/index.ts +2 -0
  26. package/src/FxAvatar/styles/avatar.styles.tsx +82 -0
  27. package/src/FxButton/FxButton.tsx +11 -0
  28. package/src/FxButton/index.ts +2 -0
  29. package/src/FxButton/styles/button.styles.jsx +16 -0
  30. package/src/FxButton/styles/button.styles.tsx +14 -0
  31. package/src/FxChip/FxChip.tsx +14 -0
  32. package/src/FxChip/chip_types.d.ts +34 -0
  33. package/src/FxChip/index.ts +2 -0
  34. package/src/FxChip/styles/chip.styles.tsx +51 -0
  35. package/src/FxIcon/FxIcon.tsx +34 -0
  36. package/src/FxIcon/content/dynamic_icon.tsx +3 -0
  37. package/src/FxIcon/content/index.ts +2 -0
  38. package/src/FxIcon/content/lazy_icon.tsx +48 -0
  39. package/src/FxIcon/icon_types.d.ts +10 -0
  40. package/src/FxIcon/index.ts +2 -0
  41. package/src/FxModal/FxModal.tsx +44 -0
  42. package/src/FxModal/index.ts +2 -0
  43. package/src/FxModal/modal_types.d.ts +10 -0
  44. package/src/FxModal/styles/modal.style.tsx +40 -0
  45. package/src/FxNotes/FxNotes.tsx +165 -0
  46. package/src/FxNotes/helpers/stringToColor.ts +19 -0
  47. package/src/FxNotes/index.ts +2 -0
  48. package/src/FxNotes/note_types.d.ts +12 -0
  49. package/src/FxNotes/operations/queries.ts +21 -0
  50. package/src/FxNotes/styles/notes.styles.tsx +135 -0
  51. package/src/FxNumberField/FxNumberField.tsx +37 -0
  52. package/src/FxNumberField/index.ts +2 -0
  53. package/src/FxNumberField/number_field_types.d.ts +7 -0
  54. package/src/FxNumberField/styles/number_field.styles.ts +85 -0
  55. package/src/FxProgressCircle/FxProgressCircle.tsx +40 -0
  56. package/src/FxProgressCircle/index.ts +2 -0
  57. package/src/FxProgressCircle/progress_circle_types.d.ts +9 -0
  58. package/src/FxProgressCircle/styles/progress_circle.styles.tsx +33 -0
  59. package/src/FxProgressCounter/ProgressCounter.tsx +81 -0
  60. package/src/FxProgressCounter/index.ts +2 -0
  61. package/src/FxProgressCounter/progress_counter_types.d.ts +10 -0
  62. package/src/FxProgressCounter/styles/progress_counter.styles.ts +40 -0
  63. package/src/FxScore/FxScore.tsx +75 -0
  64. package/src/FxScore/index.ts +2 -0
  65. package/src/FxScore/score_types.d.ts +16 -0
  66. package/src/FxScore/styles/score.styles.ts +42 -0
  67. package/src/FxShowMore/FxShowMore.tsx +60 -0
  68. package/src/FxShowMore/index.ts +2 -0
  69. package/src/FxShowMore/show_more_types.d.ts +8 -0
  70. package/src/FxShowMore/styles/show_more.styles.ts +67 -0
  71. package/src/FxSlider/FxSlider.tsx +8 -0
  72. package/src/FxSlider/index.ts +2 -0
  73. package/src/FxSlider/slider_types.d.ts +3 -0
  74. package/src/FxStatisticsBar/FxStatisticsBar.tsx +112 -0
  75. package/src/FxStatisticsBar/index.ts +2 -0
  76. package/src/FxStatisticsBar/statistics_bar_types.d.ts +8 -0
  77. package/src/FxStatisticsBar/styles/statistics.styles.ts +41 -0
  78. package/src/FxStatusBar/FxStatusBar.tsx +66 -0
  79. package/src/FxStatusBar/helpers/constants.ts +12 -0
  80. package/src/FxStatusBar/index.ts +2 -0
  81. package/src/FxStatusBar/status_bar_types.d.ts +14 -0
  82. package/src/FxStatusBar/styles/statusBar.styles.tsx +67 -0
  83. package/src/FxStyledComponents/index.tsx +196 -0
  84. package/src/FxTag/FxTag.tsx +14 -0
  85. package/src/FxTag/fxtag_types.d.ts +4 -0
  86. package/src/FxTag/index.ts +2 -0
  87. package/src/FxTag/styles/tag.styles.tsx +24 -0
  88. package/src/FxTextField/FxTextField.tsx +117 -0
  89. package/src/FxTextField/index.ts +2 -0
  90. package/src/FxTextField/text_field_types.d.ts +20 -0
  91. package/src/FxTodo/FxTodo.tsx +58 -0
  92. package/src/FxTodo/index.ts +2 -0
  93. package/src/FxTodo/styles/todo.styles.tsx +113 -0
  94. package/src/FxTodo/todo_types.d.ts +19 -0
  95. package/src/FxWizard/FxWizard.tsx +56 -0
  96. package/src/FxWizard/WizardContext.tsx +108 -0
  97. package/src/FxWizard/index.ts +3 -0
  98. package/src/FxWizard/styles/wizard.styles.tsx +22 -0
  99. package/src/FxWizard/wizard_types.d.ts +37 -0
  100. package/src/index.ts +23 -0
  101. package/tsconfig.json +22 -0
  102. package/webpack.config.js +35 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "bracketSpacing": true,
3
+ "singleQuote": true,
4
+ "trailingComma": "all",
5
+ "tabWidth": 2,
6
+ "semi": false,
7
+ "printWidth": 120,
8
+ "jsxSingleQuote": true,
9
+ "endOfLine": "auto"
10
+ }
package/.swcrc ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "jsc": {
3
+ "externalHelpers": false,
4
+ "target": "es2016",
5
+ "parser": {
6
+ "syntax": "typescript",
7
+ "tsx": true,
8
+ "decorators": false,
9
+ "dynamicImport": true
10
+ },
11
+ "transform": {
12
+ "react": {
13
+ "runtime": "automatic"
14
+ }
15
+ }
16
+ },
17
+ "module": {
18
+ "type": "commonjs"
19
+ }
20
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxTag", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxTag;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
+ const _material = require("@mui/material");
14
+ const _ = require("@fixefy/fixefy-ui-utils/");
15
+ const _tagstyles = require("./styles/tag.styles");
16
+ function _interop_require_default(obj) {
17
+ return obj && obj.__esModule ? obj : {
18
+ default: obj
19
+ };
20
+ }
21
+ const FxTag = ({ name, count = 0 })=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
22
+ display: "flex",
23
+ alignItems: "center",
24
+ justifyContent: "center",
25
+ sx: {
26
+ maxWidth: 'fit-content',
27
+ mb: 1
28
+ },
29
+ children: [
30
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_tagstyles.StyledTag, {
31
+ name: name,
32
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_tagstyles.StyledLabel, {
33
+ children: (0, _.titleCase)(name)
34
+ })
35
+ }),
36
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_tagstyles.StyledCount, {
37
+ name: name,
38
+ children: count
39
+ })
40
+ ]
41
+ });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ FxTag: function() {
13
+ return _FxTag.FxTag;
14
+ },
15
+ TagPropsType: function() {
16
+ return _fxtag_types.TagPropsType;
17
+ }
18
+ });
19
+ const _FxTag = require("./FxTag");
20
+ const _fxtag_types = require("./fxtag_types");
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ StyledCount: function() {
13
+ return StyledCount;
14
+ },
15
+ StyledLabel: function() {
16
+ return StyledLabel;
17
+ },
18
+ StyledTag: function() {
19
+ return StyledTag;
20
+ }
21
+ });
22
+ const _styles = require("@mui/material/styles");
23
+ const _material = require("@mui/material");
24
+ function _define_property(obj, key, value) {
25
+ if (key in obj) {
26
+ Object.defineProperty(obj, key, {
27
+ value: value,
28
+ enumerable: true,
29
+ configurable: true,
30
+ writable: true
31
+ });
32
+ } else {
33
+ obj[key] = value;
34
+ }
35
+ return obj;
36
+ }
37
+ function _object_spread(target) {
38
+ for(var i = 1; i < arguments.length; i++){
39
+ var source = arguments[i] != null ? arguments[i] : {};
40
+ var ownKeys = Object.keys(source);
41
+ if (typeof Object.getOwnPropertySymbols === "function") {
42
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
43
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
44
+ }));
45
+ }
46
+ ownKeys.forEach(function(key) {
47
+ _define_property(target, key, source[key]);
48
+ });
49
+ }
50
+ return target;
51
+ }
52
+ function ownKeys(object, enumerableOnly) {
53
+ var keys = Object.keys(object);
54
+ if (Object.getOwnPropertySymbols) {
55
+ var symbols = Object.getOwnPropertySymbols(object);
56
+ if (enumerableOnly) {
57
+ symbols = symbols.filter(function(sym) {
58
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
59
+ });
60
+ }
61
+ keys.push.apply(keys, symbols);
62
+ }
63
+ return keys;
64
+ }
65
+ function _object_spread_props(target, source) {
66
+ source = source != null ? source : {};
67
+ if (Object.getOwnPropertyDescriptors) {
68
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
69
+ } else {
70
+ ownKeys(Object(source)).forEach(function(key) {
71
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
72
+ });
73
+ }
74
+ return target;
75
+ }
76
+ const StyledTag = (0, _styles.styled)(_material.Box)(({ theme, name })=>({
77
+ background: name === 'in_dispute' ? '#56CCF2' : name === '' ? '#BB6BD9' : theme.palette.reconcilation[name].background,
78
+ borderRadius: 8,
79
+ padding: '2px 8px',
80
+ border: `1px solid ${name === 'in_dispute' ? '#56CCF2' : name === '' ? '#BB6BD9' : theme.palette.reconcilation[name].border}`,
81
+ display: 'flex',
82
+ alignItems: 'center',
83
+ width: 'fit-content'
84
+ }));
85
+ const StyledLabel = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
86
+ lineHeight: '20px',
87
+ color: theme.palette.common.white
88
+ }));
89
+ const StyledCount = (0, _styles.styled)(_material.Typography)(({ theme, name })=>_object_spread_props(_object_spread({}, theme.typography.subtitle2), {
90
+ lineHeight: '16px',
91
+ fontWeight: 700,
92
+ color: name === 'in_dispute' ? '#56CCF2' : name === '' ? '#BB6BD9' : theme.palette.reconcilation[name].background,
93
+ marginLeft: 8
94
+ }));
package/package.json CHANGED
@@ -56,9 +56,7 @@
56
56
  "engines": {
57
57
  "node": "18.17.1"
58
58
  },
59
- "files": [
60
- "dist-*/**/*"
61
- ],
59
+
62
60
  "private": false,
63
61
  "main": "./index.js",
64
62
  "module": "./index.js",
@@ -68,6 +66,6 @@
68
66
  "require": "./index.js"
69
67
  }
70
68
  },
71
- "types": "./index.ts",
72
- "version": "0.0.37"
69
+ "types": "./index.d.ts",
70
+ "version": "0.0.38"
73
71
  }
@@ -0,0 +1,293 @@
1
+ import React from 'react'
2
+ import Image from 'next/image'
3
+
4
+ import { Slide } from '@mui/material'
5
+ import { imageLoader } from '@fixefy/fixefy-ui-utils'
6
+ import { ActionsTrayPropsType } from './actions_tray_types'
7
+
8
+ import { ActionBtn, ActionTitle, ChargesCount, ChargesTitle, Close, Container, Divider, TitleWrapper } from './styles/actions_tray.styles'
9
+
10
+ export function FxActionsTray({ type, onApprove, onChallenge, show, onClose, chargesCount, container, direction = 'up' }: ActionsTrayPropsType) {
11
+ const renderActions = () => {
12
+ switch (type) {
13
+ case 'approved':
14
+ return <ApprovedActions onChallenge={onChallenge} />
15
+ case 'challenge':
16
+ return <ChallengeActions onChallenge={onChallenge} onApprove={onApprove} />
17
+ case 'pending':
18
+ return <PendingActions onApprove={onApprove} onChallenge={onChallenge} />
19
+ case 'no_pricing':
20
+ return <NoPricingActions onApprove={onApprove} onChallenge={onChallenge} />
21
+ default:
22
+ return <ApprovedActions onChallenge={onChallenge} />
23
+ }
24
+ }
25
+ return (
26
+ <div>
27
+ <Slide direction={direction} in={show} mountOnEnter unmountOnExit timeout={400} container={container}>
28
+ <Container>
29
+ <TitleWrapper>
30
+ <ChargesCount>{chargesCount}</ChargesCount>
31
+ <ChargesTitle>charges selected</ChargesTitle>
32
+ </TitleWrapper>
33
+ <Divider />
34
+ <div>
35
+ {renderActions()}
36
+ {/* {actions.map(({ title, name, onClick, ...action }, index) => (
37
+ <ActionBtn key={index} onClick={(event) => onClick(event, name)}>
38
+ <Image
39
+ loader={() =>
40
+ imageLoader({
41
+ root: "https://cdn-dev.fixefy.me/",
42
+ src: `actions/${action.extended.icon}}.svg`,
43
+ })
44
+ }
45
+ src={`actions/${action.extended.icon}}.svg`}
46
+ width={20}
47
+ height={20}
48
+ onLoad={() => console.log("loaded")}
49
+ onError={(e) => console.log("error:", e)}
50
+ />
51
+ <ActionTitle>{titleCase(title)}</ActionTitle>
52
+ </ActionBtn>
53
+ ))} */}
54
+ </div>
55
+ <Divider />
56
+ <div onClick={onClose}>
57
+ <Close>close</Close>
58
+ </div>
59
+ </Container>
60
+ </Slide>
61
+ </div>
62
+ )
63
+ }
64
+
65
+ const ChallengeActions = ({ onChallenge, onApprove }: { onChallenge?: () => void; onApprove?: () => void }) => {
66
+ return (
67
+ <>
68
+ <ActionBtn onClick={onChallenge} type="low">
69
+ <Image
70
+ alt="challenge"
71
+ loader={() =>
72
+ imageLoader({
73
+ root: 'https://cdn-dev.fixefy.me/',
74
+ src: 'actions/challenge.svg',
75
+ })
76
+ }
77
+ src={'actions/challenge.svg'}
78
+ width={20}
79
+ height={20}
80
+ onLoad={() => console.log('loaded')}
81
+ onError={(e: any) => console.log('error:', e)}
82
+ />
83
+ <ActionTitle>challenge</ActionTitle>
84
+ </ActionBtn>
85
+ <ActionBtn onClick={onApprove}>
86
+ <Image
87
+ alt="approve"
88
+ loader={() =>
89
+ imageLoader({
90
+ root: 'https://cdn-dev.fixefy.me/',
91
+ src: 'actions/approve.svg',
92
+ })
93
+ }
94
+ src={'actions/approve.svg'}
95
+ width={20}
96
+ height={20}
97
+ onLoad={() => console.log('loaded')}
98
+ onError={(e: any) => console.log('error:', e)}
99
+ />
100
+ <ActionTitle>approve</ActionTitle>
101
+ </ActionBtn>
102
+ <ActionBtn onClick={onApprove}>
103
+ <Image
104
+ alt="ignore and approve"
105
+ loader={() =>
106
+ imageLoader({
107
+ root: 'https://cdn-dev.fixefy.me/',
108
+ src: 'actions/ignore_and_approve.svg',
109
+ })
110
+ }
111
+ src={'actions/ignore_and_approve.svg'}
112
+ width={20}
113
+ height={20}
114
+ onLoad={() => console.log('loaded')}
115
+ onError={(e: any) => console.log('error:', e)}
116
+ />
117
+ <ActionTitle>ignore & approve</ActionTitle>
118
+ </ActionBtn>
119
+ <ActionBtn onClick={onApprove}>
120
+ <Image
121
+ alt="change exception"
122
+ loader={() =>
123
+ imageLoader({
124
+ root: 'https://cdn-dev.fixefy.me/',
125
+ src: 'actions/change_exception.svg',
126
+ })
127
+ }
128
+ src={'actions/change_exception.svg'}
129
+ width={20}
130
+ height={20}
131
+ onLoad={() => console.log('loaded')}
132
+ onError={(e: any) => console.log('error:', e)}
133
+ />
134
+ <ActionTitle>Change exeption</ActionTitle>
135
+ </ActionBtn>
136
+ </>
137
+ )
138
+ }
139
+ const PendingActions = ({ onApprove, onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
140
+ return (
141
+ <>
142
+ <ActionBtn onClick={onApprove} type="excellent">
143
+ <Image
144
+ alt="approve"
145
+ loader={() =>
146
+ imageLoader({
147
+ root: 'https://cdn-dev.fixefy.me/',
148
+ src: 'actions/approve.svg',
149
+ })
150
+ }
151
+ src={'actions/approve.svg'}
152
+ width={20}
153
+ height={20}
154
+ onLoad={() => console.log('loaded')}
155
+ onError={(e: any) => console.log('error:', e)}
156
+ />
157
+ <ActionTitle>approve</ActionTitle>
158
+ </ActionBtn>
159
+ <ActionBtn onClick={onChallenge}>
160
+ <Image
161
+ alt="challenge"
162
+ loader={() =>
163
+ imageLoader({
164
+ root: 'https://cdn-dev.fixefy.me/',
165
+ src: 'actions/challenge.svg',
166
+ })
167
+ }
168
+ src={'actions/challenge.svg'}
169
+ width={20}
170
+ height={20}
171
+ onLoad={() => console.log('loaded')}
172
+ onError={(e: any) => console.log('error:', e)}
173
+ />
174
+ <ActionTitle>challenge</ActionTitle>
175
+ </ActionBtn>
176
+
177
+ <ActionBtn onClick={onChallenge}>
178
+ <Image
179
+ alt="dive in"
180
+ loader={() =>
181
+ imageLoader({
182
+ root: 'https://cdn-dev.fixefy.me/',
183
+ src: 'actions/dive_in.svg',
184
+ })
185
+ }
186
+ src={'actions/dive_in.svg'}
187
+ width={20}
188
+ height={20}
189
+ onLoad={() => console.log('loaded')}
190
+ onError={(e: any) => console.log('error:', e)}
191
+ />
192
+ <ActionTitle>dive in</ActionTitle>
193
+ </ActionBtn>
194
+ </>
195
+ )
196
+ }
197
+ const NoPricingActions = ({ onApprove, onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
198
+ return (
199
+ <>
200
+ <ActionBtn onClick={onChallenge}>
201
+ <Image
202
+ alt="dive in"
203
+ loader={() =>
204
+ imageLoader({
205
+ root: 'https://cdn-dev.fixefy.me/',
206
+ src: 'actions/dive_in.svg',
207
+ })
208
+ }
209
+ src={'actions/dive_in.svg'}
210
+ width={20}
211
+ height={20}
212
+ onLoad={() => console.log('loaded')}
213
+ onError={(e: any) => console.log('error:', e)}
214
+ />
215
+ <ActionTitle>dive in</ActionTitle>
216
+ </ActionBtn>
217
+ <ActionBtn onClick={onApprove}>
218
+ <Image
219
+ alt="solve"
220
+ loader={() =>
221
+ imageLoader({
222
+ root: 'https://cdn-dev.fixefy.me/',
223
+ src: 'actions/solve.svg',
224
+ })
225
+ }
226
+ src={'actions/solve.svg'}
227
+ width={20}
228
+ height={20}
229
+ onLoad={() => console.log('loaded')}
230
+ onError={(e: any) => console.log('error:', e)}
231
+ />
232
+ <ActionTitle>solve</ActionTitle>
233
+ </ActionBtn>
234
+ <ActionBtn onClick={onApprove}>
235
+ <Image
236
+ alt="ignore and approve"
237
+ loader={() =>
238
+ imageLoader({
239
+ root: 'https://cdn-dev.fixefy.me/',
240
+ src: 'actions/ignore_and_approve.svg',
241
+ })
242
+ }
243
+ src={'actions/ignore_and_approve.svg'}
244
+ width={20}
245
+ height={20}
246
+ onLoad={() => console.log('loaded')}
247
+ onError={(e: any) => console.log('error:', e)}
248
+ />
249
+ <ActionTitle>ignore & approve</ActionTitle>
250
+ </ActionBtn>
251
+ </>
252
+ )
253
+ }
254
+ const ApprovedActions = ({ onChallenge }: { onChallenge?: () => void; onApprove?: () => void }) => {
255
+ return (
256
+ <>
257
+ <ActionBtn onClick={onChallenge}>
258
+ <Image
259
+ alt="dive in"
260
+ loader={() =>
261
+ imageLoader({
262
+ root: 'https://cdn-dev.fixefy.me/',
263
+ src: 'actionsCards/check_exceptions.svg',
264
+ })
265
+ }
266
+ src={'actionsCards/check_exceptions.svg'}
267
+ width={20}
268
+ height={20}
269
+ onLoad={() => console.log('loaded')}
270
+ onError={(e: any) => console.log('error:', e)}
271
+ />
272
+ <ActionTitle>dive in</ActionTitle>
273
+ </ActionBtn>
274
+ <ActionBtn onClick={onChallenge}>
275
+ <Image
276
+ alt="challenge"
277
+ loader={() =>
278
+ imageLoader({
279
+ root: 'https://cdn-dev.fixefy.me/',
280
+ src: 'actions/undo.svg',
281
+ })
282
+ }
283
+ src={'actions/undo.svg'}
284
+ width={20}
285
+ height={20}
286
+ onLoad={() => console.log('loaded')}
287
+ onError={(e: any) => console.log('error:', e)}
288
+ />
289
+ <ActionTitle>undo</ActionTitle>
290
+ </ActionBtn>
291
+ </>
292
+ )
293
+ }
@@ -0,0 +1,15 @@
1
+ export type ActionsTrayPropsType = {
2
+ type: 'approved' | 'challenge' | 'pending' | 'no_pricing'
3
+ onApprove?: () => void
4
+ onChallenge?: () => void
5
+ onClick?: () => void
6
+ onClose?: () => void
7
+ show: boolean
8
+ chargesCount: number
9
+ container?: any
10
+ direction?: 'down' | 'left' | 'right' | 'up'
11
+ }
12
+
13
+ export type ActionButtonPropsType = {
14
+ type?: 'excellent' | 'high' | 'medium' | 'low' | 'bad'
15
+ }
@@ -0,0 +1,3 @@
1
+ export { FxActionsTray } from './FxActionsTray'
2
+
3
+ export type { ActionsTrayPropsType, ActionButtonPropsType } from './actions_tray_types'
@@ -0,0 +1,90 @@
1
+ import { FxButton } from '../../FxButton'
2
+ import { Typography } from '@mui/material'
3
+ import { styled } from '@mui/material/styles'
4
+
5
+ import { ActionButtonPropsType } from '../actions_tray_types'
6
+
7
+ // const filterWhite = 'invert(99%) sepia(74%) saturate(0%) hue-rotate(253deg) brightness(108%) contrast(100%)'
8
+ const filterPrimary = 'invert(46%) sepia(48%) saturate(297%) hue-rotate(145deg) brightness(97%) contrast(90%)'
9
+
10
+ export const Container = styled('div')(({ theme }: { theme: any }) => ({
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ justifyContent: 'space-between',
14
+
15
+ background: theme.palette.common.white,
16
+ border: '1px solid #C6DDE2',
17
+ boxShadow: '0px 0px 10px rgba(86, 135, 147, 0.2)',
18
+ borderRadius: 8,
19
+ padding: '16px 24px',
20
+ height: 38,
21
+ width: 'fit-content',
22
+ margin: 4,
23
+ }))
24
+
25
+ export const ChargesCount = styled(Typography)(({ theme }: { theme: any }) => ({
26
+ ...theme.typography.table,
27
+ color: theme.palette.typography.title,
28
+ fontWeight: 700,
29
+ marginRight: 4,
30
+ }))
31
+
32
+ export const ChargesTitle = styled(Typography)(({ theme }: { theme: any }) => ({
33
+ ...theme.typography.table,
34
+ color: theme.palette.typography.title,
35
+ }))
36
+
37
+ export const Close = styled(Typography)(({ theme }: { theme: any }) => ({
38
+ ...theme.typography.body1,
39
+ color: theme.palette.primary['500'],
40
+ textTransform: 'uppercase',
41
+ fontWeight: 600,
42
+ letterSpacing: '0.5px',
43
+ cursor: 'pointer',
44
+ }))
45
+
46
+ export const TitleWrapper = styled('div')(({ }: { theme: any }) => ({
47
+ display: 'flex',
48
+ alignItems: 'center',
49
+ justifyContent: 'center',
50
+ }))
51
+
52
+ export const Divider = styled('div')(({ theme }: { theme: any }) => ({
53
+ width: 1,
54
+ height: '100%',
55
+ background: theme.palette.greyscale.contrastText,
56
+ marginRight: 24,
57
+ marginLeft: 24,
58
+ }))
59
+
60
+ export const ActionBtn = styled(FxButton)<ActionButtonPropsType>(({ theme, type }: { theme: any; type: any }) => ({
61
+ height: 40,
62
+ maxHeight: 40,
63
+ borderRadius: 100,
64
+
65
+ padding: '8px 16px',
66
+ color: type ? theme.palette.common.white : theme.palette.primary['500'],
67
+ borderColor: type ? theme.palette.score[type] : theme.palette.primary['500'],
68
+ background: type ? theme.palette.score[type] : theme.palette.common.white,
69
+ marginRight: 8,
70
+
71
+ ['& img']: {
72
+ filter: type ? 'none' : filterPrimary,
73
+ },
74
+ ['&:hover']: {
75
+ background: type ? theme.palette.score[type] : theme.palette.common.white,
76
+ color: type ? theme.palette.common.white : theme.palette.primary['500'],
77
+ borderColor: type ? theme.palette.score[type] : theme.palette.primary['500'],
78
+ },
79
+ }))
80
+
81
+ export const ActionTitle = styled('span')(({ theme }: { theme: any }) => ({
82
+ ...theme.typography.body1,
83
+ color: 'inherit',
84
+ textTransform: 'uppercase',
85
+ fontWeight: 600,
86
+ letterSpacing: '0.5px',
87
+ cursor: 'pointer',
88
+ marginLeft: 4,
89
+ marginTop: 2,
90
+ }))
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import Stack from '@mui/material/Stack'
3
+ import { structureReader } from './helpers/structureReader'
4
+
5
+ import { AggreationsBarPropsType } from './aggregations_types'
6
+
7
+ export const FxAggregationsBar = (props: AggreationsBarPropsType) => {
8
+ const { structure, minWidth, mb, filter, initialValues } = props
9
+ const { children, extended } = structure
10
+ const { variables } = extended
11
+ const { collapsed } = variables
12
+
13
+ return (
14
+ <Stack
15
+ direction="row"
16
+ spacing={1.5}
17
+ sx={{
18
+ mb: mb ? mb : 0,
19
+ ['& div']: {
20
+ minWidth: minWidth,
21
+ },
22
+ ['& > span']: {
23
+ minWidth: minWidth,
24
+ },
25
+ }}
26
+ >
27
+ {children.map((child: any) => {
28
+ return structureReader(child, filter, collapsed, initialValues)
29
+ })}
30
+ </Stack>
31
+ )
32
+ }
@@ -0,0 +1,21 @@
1
+ export type AggregationsDataPropsType = {
2
+ title: string
3
+ value: number
4
+ type?: 'currency' | 'percentage'
5
+ loading?: boolean
6
+ }
7
+
8
+ export type AggreationsBarPropsType = {
9
+ structure: any
10
+ minWidth?: string | number
11
+ mb?: string | number
12
+ filter?: object
13
+ initialValues?: {
14
+ score?: number
15
+ originalCharge?: number
16
+ underContractCharges?: number
17
+ fairValue?: number
18
+ spendRisk?: number
19
+ [x: string]: any
20
+ }
21
+ }