@fixefy/fixefy-ui-components 0.0.51 → 0.0.53

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.
@@ -0,0 +1,27 @@
1
+ import React, { ReactElement } from 'react';
2
+ export declare const Card: any;
3
+ export declare const PageHeader: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
4
+ export declare const Label: any;
5
+ export declare const BoldValue: any;
6
+ export declare const Value: any;
7
+ export declare const PageTitle: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
8
+ export declare const Link: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
9
+ export declare const Text: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
10
+ export declare const ShowMore: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
11
+ export declare const ShowMoreContainer: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
12
+ export declare const DataWrapper: ({ values, title, icon, columns, cardStyle, wrapperStyle, }: {
13
+ values: ReactElement[];
14
+ title?: string | undefined;
15
+ columns?: number | undefined;
16
+ icon?: any;
17
+ cardStyle?: any;
18
+ wrapperStyle?: any;
19
+ }) => React.JSX.Element;
20
+ interface field {
21
+ value: number;
22
+ color: string;
23
+ }
24
+ export declare const Bars: ({ fields }: {
25
+ fields: field[];
26
+ }) => React.JSX.Element;
27
+ export {};
@@ -0,0 +1,310 @@
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
+ Bars: function() {
13
+ return Bars;
14
+ },
15
+ BoldValue: function() {
16
+ return BoldValue;
17
+ },
18
+ Card: function() {
19
+ return Card;
20
+ },
21
+ DataWrapper: function() {
22
+ return DataWrapper;
23
+ },
24
+ Label: function() {
25
+ return Label;
26
+ },
27
+ Link: function() {
28
+ return Link;
29
+ },
30
+ PageHeader: function() {
31
+ return PageHeader;
32
+ },
33
+ PageTitle: function() {
34
+ return PageTitle;
35
+ },
36
+ ShowMore: function() {
37
+ return ShowMore;
38
+ },
39
+ ShowMoreContainer: function() {
40
+ return ShowMoreContainer;
41
+ },
42
+ Text: function() {
43
+ return Text;
44
+ },
45
+ Value: function() {
46
+ return Value;
47
+ }
48
+ });
49
+ const _jsxruntime = require("react/jsx-runtime");
50
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
51
+ const _styles = require("@mui/material/styles");
52
+ const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
53
+ const _material = require("@mui/material");
54
+ function _define_property(obj, key, value) {
55
+ if (key in obj) {
56
+ Object.defineProperty(obj, key, {
57
+ value: value,
58
+ enumerable: true,
59
+ configurable: true,
60
+ writable: true
61
+ });
62
+ } else {
63
+ obj[key] = value;
64
+ }
65
+ return obj;
66
+ }
67
+ function _getRequireWildcardCache(nodeInterop) {
68
+ if (typeof WeakMap !== "function") return null;
69
+ var cacheBabelInterop = new WeakMap();
70
+ var cacheNodeInterop = new WeakMap();
71
+ return (_getRequireWildcardCache = function(nodeInterop) {
72
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
73
+ })(nodeInterop);
74
+ }
75
+ function _interop_require_wildcard(obj, nodeInterop) {
76
+ if (!nodeInterop && obj && obj.__esModule) {
77
+ return obj;
78
+ }
79
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
80
+ return {
81
+ default: obj
82
+ };
83
+ }
84
+ var cache = _getRequireWildcardCache(nodeInterop);
85
+ if (cache && cache.has(obj)) {
86
+ return cache.get(obj);
87
+ }
88
+ var newObj = {
89
+ __proto__: null
90
+ };
91
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
92
+ for(var key in obj){
93
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
94
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
95
+ if (desc && (desc.get || desc.set)) {
96
+ Object.defineProperty(newObj, key, desc);
97
+ } else {
98
+ newObj[key] = obj[key];
99
+ }
100
+ }
101
+ }
102
+ newObj.default = obj;
103
+ if (cache) {
104
+ cache.set(obj, newObj);
105
+ }
106
+ return newObj;
107
+ }
108
+ function _object_spread(target) {
109
+ for(var i = 1; i < arguments.length; i++){
110
+ var source = arguments[i] != null ? arguments[i] : {};
111
+ var ownKeys = Object.keys(source);
112
+ if (typeof Object.getOwnPropertySymbols === "function") {
113
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
114
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
115
+ }));
116
+ }
117
+ ownKeys.forEach(function(key) {
118
+ _define_property(target, key, source[key]);
119
+ });
120
+ }
121
+ return target;
122
+ }
123
+ function ownKeys(object, enumerableOnly) {
124
+ var keys = Object.keys(object);
125
+ if (Object.getOwnPropertySymbols) {
126
+ var symbols = Object.getOwnPropertySymbols(object);
127
+ if (enumerableOnly) {
128
+ symbols = symbols.filter(function(sym) {
129
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
130
+ });
131
+ }
132
+ keys.push.apply(keys, symbols);
133
+ }
134
+ return keys;
135
+ }
136
+ function _object_spread_props(target, source) {
137
+ source = source != null ? source : {};
138
+ if (Object.getOwnPropertyDescriptors) {
139
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
140
+ } else {
141
+ ownKeys(Object(source)).forEach(function(key) {
142
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
143
+ });
144
+ }
145
+ return target;
146
+ }
147
+ const Card = (0, _styles.styled)(_material.Paper)(({})=>({
148
+ borderRadius: 8,
149
+ padding: 16,
150
+ // transition: "max-height 1000ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
151
+ overflow: 'hidden',
152
+ position: 'relative'
153
+ }));
154
+ const PageHeader = (0, _styles.styled)(_material.Box)(({})=>({
155
+ backgroundColor: '#E2EEF1',
156
+ width: '100%',
157
+ height: 220,
158
+ padding: 32
159
+ }));
160
+ const Label = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.overLineCaption), {
161
+ color: theme.palette.statistics.label
162
+ }));
163
+ const BoldValue = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.subtitle2), {
164
+ fontWeight: 700,
165
+ lineHeight: '16px',
166
+ color: theme.palette.typography.title
167
+ }));
168
+ const Value = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
169
+ fontFamily: theme.typography.fontFamily,
170
+ lineHeight: '20px',
171
+ color: theme.palette.typography.title
172
+ }));
173
+ const PageTitle = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.h4), {
174
+ color: theme.palette.common.black
175
+ }));
176
+ const Link = (0, _styles.styled)(_material.Link)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
177
+ lineHeight: '20px',
178
+ fontStyle: 'italic',
179
+ color: theme.palette.primary[500],
180
+ cursor: 'pointer',
181
+ textDecoration: 'none'
182
+ }));
183
+ const Text = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
184
+ color: theme.palette.typography.title,
185
+ textOverflow: 'ellipsis',
186
+ whiteSpace: 'nowrap',
187
+ overflow: 'hidden'
188
+ }));
189
+ const ShowMore = (0, _styles.styled)(_material.Typography)(({ theme })=>_object_spread_props(_object_spread({}, theme.typography.body1), {
190
+ color: theme.palette.primary['500'],
191
+ fontWeight: 600,
192
+ fontSize: '12px',
193
+ letterSpacing: '0.5px',
194
+ lineHeight: '24px',
195
+ cursor: 'pointer'
196
+ }));
197
+ const ShowMoreContainer = (0, _styles.styled)(_material.Grid)(({ theme })=>({
198
+ backgroundColor: theme.palette.common.white,
199
+ width: '100%',
200
+ display: 'flex',
201
+ justifyContent: 'center',
202
+ cursor: 'pointer'
203
+ }));
204
+ const DataWrapper = ({ values = [], title, icon, columns = 4, cardStyle = {}, wrapperStyle = {} })=>{
205
+ const normalizedValues = values.length % columns !== 0 ? [
206
+ ...values,
207
+ ...new Array(columns - values.length % columns)
208
+ ] : values;
209
+ const last4Items = normalizedValues.splice(-columns);
210
+ const containerColumns = columns === 5 ? 10 : 12;
211
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
212
+ sx: _object_spread({}, wrapperStyle),
213
+ children: [
214
+ (title || icon) && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
215
+ display: "flex",
216
+ alignItems: "center",
217
+ sx: {
218
+ ml: 2,
219
+ mb: 1
220
+ },
221
+ children: [
222
+ icon && icon,
223
+ title && /*#__PURE__*/ (0, _jsxruntime.jsx)(BoldValue, {
224
+ sx: {
225
+ ml: 1
226
+ },
227
+ children: (0, _fixefyuiutils.titleCase)(title)
228
+ })
229
+ ]
230
+ }),
231
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(Card, {
232
+ elevation: 0,
233
+ sx: _object_spread({
234
+ border: `1px solid #F0F0F0`
235
+ }, cardStyle),
236
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Grid, {
237
+ container: true,
238
+ columns: containerColumns,
239
+ children: [
240
+ normalizedValues.map((value, index)=>{
241
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
242
+ sx: {
243
+ minHeight: 74,
244
+ padding: 2,
245
+ borderRight: value && (index + 1) % columns !== 0 && `1px solid #F0F0F0`,
246
+ borderBottom: value && `1px solid #F0F0F0`,
247
+ display: 'flex',
248
+ alignItems: 'center'
249
+ },
250
+ item: true,
251
+ xs: containerColumns / columns,
252
+ children: value && /*#__PURE__*/ _react.default.cloneElement(value)
253
+ }, index);
254
+ }),
255
+ last4Items.map((value, index)=>{
256
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
257
+ sx: {
258
+ minHeight: 74,
259
+ padding: 2,
260
+ borderRight: value && (index + 1) % columns !== 0 && `1px solid #F0F0F0`,
261
+ display: 'flex',
262
+ alignItems: 'center'
263
+ },
264
+ item: true,
265
+ xs: containerColumns / columns,
266
+ children: value && /*#__PURE__*/ _react.default.cloneElement(value)
267
+ }, index);
268
+ })
269
+ ]
270
+ })
271
+ })
272
+ ]
273
+ });
274
+ };
275
+ const Bars = ({ fields })=>{
276
+ const max = (0, _react.useMemo)(()=>{
277
+ return fields.reduce((total, acc)=>{
278
+ return acc.value > total ? acc.value : total;
279
+ }, 0);
280
+ }, [
281
+ fields
282
+ ]);
283
+ const calculateTheValue = (value)=>{
284
+ const calculatedValue = value * 24 / max;
285
+ if (calculatedValue > 0 && calculatedValue < 2) {
286
+ return 2;
287
+ }
288
+ if (calculatedValue < 1) {
289
+ return 1;
290
+ }
291
+ return calculatedValue;
292
+ };
293
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
294
+ style: {
295
+ display: 'flex',
296
+ alignItems: 'flex-end'
297
+ },
298
+ children: fields.map((field, index)=>{
299
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
300
+ style: {
301
+ width: 8,
302
+ borderRadius: '0.75px',
303
+ height: calculateTheValue(field.value),
304
+ backgroundColor: field.color,
305
+ marginRight: 2
306
+ }
307
+ }, index);
308
+ })
309
+ });
310
+ };
package/dist/index.d.ts CHANGED
@@ -18,3 +18,4 @@ export { FxStatusBar, StatusBarPropsType, Options } from './FxStatusBar';
18
18
  export { FxTag, TagPropsType } from './FxTag';
19
19
  export { FxTextField, TextFieldPropsType } from './FxTextField';
20
20
  export { FxTodo, TodoItemType, TodoPropsType } from './FxTodo';
21
+ export { Card, PageHeader, Label, BoldValue, Value, PageTitle, Link, Text, ShowMore, ShowMoreContainer, DataWrapper, Bars } from './FxStyledComponents';
package/dist/index.js CHANGED
@@ -27,12 +27,24 @@ _export(exports, {
27
27
  BackgroundColorsType: function() {
28
28
  return _FxAvatar.BackgroundColorsType;
29
29
  },
30
+ Bars: function() {
31
+ return _FxStyledComponents.Bars;
32
+ },
33
+ BoldValue: function() {
34
+ return _FxStyledComponents.BoldValue;
35
+ },
30
36
  ButtonPropsType: function() {
31
37
  return _FxButton.ButtonPropsType;
32
38
  },
39
+ Card: function() {
40
+ return _FxStyledComponents.Card;
41
+ },
33
42
  ChipPropsType: function() {
34
43
  return _FxChip.ChipPropsType;
35
44
  },
45
+ DataWrapper: function() {
46
+ return _FxStyledComponents.DataWrapper;
47
+ },
36
48
  FxActionsTray: function() {
37
49
  return _FxActionsTray.FxActionsTray;
38
50
  },
@@ -96,6 +108,12 @@ _export(exports, {
96
108
  IconPropsType: function() {
97
109
  return _FxIcon.IconPropsType;
98
110
  },
111
+ Label: function() {
112
+ return _FxStyledComponents.Label;
113
+ },
114
+ Link: function() {
115
+ return _FxStyledComponents.Link;
116
+ },
99
117
  ModalPropsType: function() {
100
118
  return _FxModal.ModalPropsType;
101
119
  },
@@ -114,6 +132,12 @@ _export(exports, {
114
132
  Options: function() {
115
133
  return _FxStatusBar.Options;
116
134
  },
135
+ PageHeader: function() {
136
+ return _FxStyledComponents.PageHeader;
137
+ },
138
+ PageTitle: function() {
139
+ return _FxStyledComponents.PageTitle;
140
+ },
117
141
  ProgressCirclePropsType: function() {
118
142
  return _FxProgressCircle.ProgressCirclePropsType;
119
143
  },
@@ -123,6 +147,12 @@ _export(exports, {
123
147
  ScorePropsType: function() {
124
148
  return _FxScore.ScorePropsType;
125
149
  },
150
+ ShowMore: function() {
151
+ return _FxStyledComponents.ShowMore;
152
+ },
153
+ ShowMoreContainer: function() {
154
+ return _FxStyledComponents.ShowMoreContainer;
155
+ },
126
156
  ShowMorePropsType: function() {
127
157
  return _FxShowMore.ShowMorePropsType;
128
158
  },
@@ -141,6 +171,9 @@ _export(exports, {
141
171
  TagPropsType: function() {
142
172
  return _FxTag.TagPropsType;
143
173
  },
174
+ Text: function() {
175
+ return _FxStyledComponents.Text;
176
+ },
144
177
  TextFieldPropsType: function() {
145
178
  return _FxTextField.TextFieldPropsType;
146
179
  },
@@ -149,6 +182,9 @@ _export(exports, {
149
182
  },
150
183
  TodoPropsType: function() {
151
184
  return _FxTodo.TodoPropsType;
185
+ },
186
+ Value: function() {
187
+ return _FxStyledComponents.Value;
152
188
  }
153
189
  });
154
190
  const _FxActionsTray = require("./FxActionsTray");
@@ -171,3 +207,4 @@ const _FxStatusBar = require("./FxStatusBar");
171
207
  const _FxTag = require("./FxTag");
172
208
  const _FxTextField = require("./FxTextField");
173
209
  const _FxTodo = require("./FxTodo");
210
+ const _FxStyledComponents = require("./FxStyledComponents");
package/package.json CHANGED
@@ -13,8 +13,8 @@
13
13
  "@react-spring/web": "^9.7.3",
14
14
  "graphql-tag": "^2.12.6",
15
15
  "next": "^13.5.3",
16
- "react": "17.0.2",
17
- "react-dom": "17.0.2",
16
+ "react": "18.2.0",
17
+ "react-dom": "18.2.0",
18
18
  "swc-loader": "^0.2.3"
19
19
  },
20
20
  "devDependencies": {
@@ -68,5 +68,5 @@
68
68
  "require": "./dist/index.js"
69
69
  }
70
70
  },
71
- "version": "0.0.51"
71
+ "version": "0.0.53"
72
72
  }