@firedesktop/react-base 1.6.0 → 1.9.0

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 (39) hide show
  1. package/debug.log +1 -0
  2. package/dist/ConfigurationLoader.js +57 -9
  3. package/dist/ConfigurationLoader.js.map +1 -1
  4. package/dist/LanguageLoader.d.ts +2 -2
  5. package/dist/LanguageLoader.js +55 -11
  6. package/dist/LanguageLoader.js.map +1 -1
  7. package/dist/components/AppIcon.d.ts +14 -0
  8. package/dist/components/AppIcon.js +163 -0
  9. package/dist/components/AppIcon.js.map +1 -0
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/components/index.js +3 -0
  12. package/dist/components/index.js.map +1 -0
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.js +2 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/styles/base.css +348 -0
  17. package/package.json +18 -18
  18. package/src/App.tsx +5 -3
  19. package/src/lib/ConfigurationLoader.tsx +13 -10
  20. package/src/lib/LanguageLoader.tsx +17 -13
  21. package/src/lib/components/AppIcon.tsx +764 -0
  22. package/src/lib/components/index.ts +3 -0
  23. package/src/lib/index.ts +3 -1
  24. package/src/lib/styles/base.css +348 -0
  25. package/src/types/ConfigurationLoader.js +1 -0
  26. package/src/types/ConfigurationLoader.js.map +1 -0
  27. package/src/types/ConfigurationManager.d.ts +2 -1
  28. package/src/types/ConfigurationManager.js +26 -7
  29. package/src/types/ConfigurationManager.js.map +1 -0
  30. package/src/types/LanguageLoader.js +2 -1
  31. package/src/types/LanguageLoader.js.map +1 -0
  32. package/src/types/LanguageManager.d.ts +2 -1
  33. package/src/types/LanguageManager.js +26 -7
  34. package/src/types/LanguageManager.js.map +1 -0
  35. package/src/types/components/AppIcon.d.ts +14 -0
  36. package/src/types/components/AppIcon.js +163 -0
  37. package/src/types/components/AppIcon.js.map +1 -0
  38. package/src/types/index.js +1 -0
  39. package/src/types/index.js.map +1 -0
@@ -0,0 +1,348 @@
1
+ :root {
2
+ --background-color: linear-gradient(
3
+ 180deg,
4
+ #0057ff 0%,
5
+ rgba(0, 87, 255, 0.7) 100%,
6
+ rgba(0, 87, 255, 0.7) 100%
7
+ );
8
+ --background-gradient-active: linear-gradient(
9
+ 270deg,
10
+ rgba(0, 87, 255, 0.7) 0%,
11
+ #0057ff 100%
12
+ );
13
+
14
+ --background-progress-circle: linear-gradient(
15
+ 270deg,
16
+ rgba(0, 87, 255, 0.7) 0%,
17
+ #0057ff 78.42%
18
+ );
19
+
20
+ --background-progress-fill: linear-gradient(
21
+ 270deg,
22
+ rgba(106, 157, 255, 0.7) 0%,
23
+ #6a9dff 50.95%
24
+ );
25
+ --background-progress: linear-gradient(
26
+ 270deg,
27
+ rgba(106, 157, 255, 0.7) 0%,
28
+ #6a9dff 100%
29
+ );
30
+ --font-Josefin-sans: "Josefin Sans", sans-serif !important;
31
+ --font-Roboto: "Roboto", sans-serif !important;
32
+ --primary-color: #0057ff;
33
+ --warning-color: #ffc14e;
34
+ --danger-color: #e80026;
35
+ --tertiary-color: #b1aeae;
36
+ --success-color: #00854d;
37
+ --light-color: #c0c0c0;
38
+ --white-color: #ffffff;
39
+ --dark-pink-color: #de31d2;
40
+ --menu-dropdown-background: rgba(238, 238, 238, 0.9);
41
+ }
42
+
43
+ body {
44
+ background: #f7f7f7 !important;
45
+ font-family: var(--font-Roboto);
46
+ overflow-x: hidden;
47
+ }
48
+
49
+ p {
50
+ color: var(--para-color);
51
+ }
52
+
53
+ .tertiary-text {
54
+ color: var(--tertiary-color);
55
+ }
56
+
57
+ .primary-text {
58
+ color: var(--primary-color);
59
+ }
60
+
61
+ .white-text {
62
+ color: var(--white-color);
63
+ }
64
+
65
+ .light-text {
66
+ color: var(--light-color);
67
+ }
68
+
69
+ .danger-text {
70
+ color: var(--danger-color);
71
+ }
72
+
73
+ .success-text {
74
+ color: var(--success-color);
75
+ }
76
+
77
+ .dark-pink-text {
78
+ color: var(--dark-pink-color);
79
+ }
80
+
81
+
82
+ /* SVG Start */
83
+ .warning-svg {
84
+ fill: var(--warning-color);
85
+ }
86
+
87
+ .tertiary-svg {
88
+ fill: var(--tertiary-color);
89
+ }
90
+
91
+ .primary-svg {
92
+ fill: var(--primary-color);
93
+ }
94
+
95
+ .white-svg {
96
+ fill: var(--white-color);
97
+ }
98
+
99
+ .light-svg {
100
+ fill: var(--light-color);
101
+ }
102
+
103
+ .danger-svg {
104
+ fill: var(--danger-color);
105
+ }
106
+
107
+ .success-svg {
108
+ fill: var(--success-color);
109
+ }
110
+
111
+ .dark-pink-svg {
112
+ fill: var(--dark-pink-color);
113
+ }
114
+
115
+ .warning-svg-stroke {
116
+ stroke: var(--warning-color);
117
+ }
118
+
119
+ .tertiary-svg-stroke {
120
+ stroke: var(--tertiary-color);
121
+ }
122
+
123
+ .primary-svg-stroke {
124
+ stroke: var(--primary-color);
125
+ }
126
+
127
+ .white-svg-stroke {
128
+ stroke: var(--white-color);
129
+ }
130
+
131
+ .light-svg-stroke {
132
+ stroke: var(--light-color);
133
+ }
134
+
135
+ .danger-svg-stroke {
136
+ stroke: var(--danger-color);
137
+ }
138
+
139
+ .success-svg-stroke {
140
+ stroke: var(--success-color);
141
+ }
142
+
143
+ .dark-pink-svg-stroke {
144
+ stroke: var(--dark-pink-color);
145
+ }
146
+ /* SVG End */
147
+
148
+ /* Fonts Start */
149
+ .fz10 {
150
+ font-size: 10px;
151
+ }
152
+
153
+ .fz11 {
154
+ font-size: 11px;
155
+ }
156
+
157
+ .fz12 {
158
+ font-size: 12px;
159
+ }
160
+
161
+ .fz13 {
162
+ font-size: 13px;
163
+ }
164
+
165
+ .fz14 {
166
+ font-size: 14px;
167
+ }
168
+
169
+ .fz15 {
170
+ font-size: 15px;
171
+ }
172
+
173
+ .fz16 {
174
+ font-size: 16px;
175
+ }
176
+
177
+ .fz17 {
178
+ font-size: 17px;
179
+ }
180
+
181
+ .fz18 {
182
+ font-size: 18px;
183
+ }
184
+
185
+ .fz19 {
186
+ font-size: 19px;
187
+ }
188
+
189
+ .fz20 {
190
+ font-size: 20px;
191
+ }
192
+
193
+ .fz21 {
194
+ font-size: 21px;
195
+ }
196
+
197
+ .fz22 {
198
+ font-size: 22px;
199
+ }
200
+
201
+ .fz24 {
202
+ font-size: 24px;
203
+ }
204
+
205
+ .fz25 {
206
+ font-size: 25px;
207
+ }
208
+
209
+ .fz26 {
210
+ font-size: 26px;
211
+ }
212
+
213
+ .fz28 {
214
+ font-size: 28px;
215
+ }
216
+
217
+ .fz30 {
218
+ font-size: 30px;
219
+ }
220
+
221
+ .fz32 {
222
+ font-size: 32px;
223
+ }
224
+
225
+ .fz34 {
226
+ font-size: 34px;
227
+ }
228
+
229
+ .fz36 {
230
+ font-size: 36px;
231
+ }
232
+
233
+ .fz38 {
234
+ font-size: 38px;
235
+ }
236
+
237
+ .fz40 {
238
+ font-size: 40px;
239
+ }
240
+
241
+ .fz45 {
242
+ font-size: 45px;
243
+ }
244
+
245
+ .fz50 {
246
+ font-size: 50px;
247
+ }
248
+
249
+ .fz60 {
250
+ font-size: 60px;
251
+ }
252
+
253
+ .fz70 {
254
+ font-size: 70px;
255
+ }
256
+ /* Fonts End */
257
+
258
+
259
+ /* breadcrumb */
260
+ .breadcrumb_text {
261
+ position: relative;
262
+ color: var(--primary-color);
263
+ }
264
+
265
+ .breadcrumb_text::after {
266
+ content: "";
267
+ width: 100%;
268
+ height: 5px;
269
+ background: var(--primary-color);
270
+ position: absolute;
271
+ left: 0;
272
+ bottom: -16px;
273
+ border-radius: 2px;
274
+ }
275
+
276
+ .warning-text {
277
+ color: var(--warning-color);
278
+ }
279
+
280
+ .success-border {
281
+ border: 2px solid var(--success-color);
282
+ }
283
+
284
+ .danger-border {
285
+ border: 2px solid var(--danger-color);
286
+ }
287
+
288
+ .warning-border {
289
+ border: 2px solid var(--warning-color);
290
+ }
291
+ .white-border {
292
+ border: 2px solid var(--primary-color);
293
+ }
294
+ .success-background {
295
+ background: var(--success-color);
296
+ color: var(--white-color);
297
+ }
298
+
299
+ .white-background {
300
+ background: var(--primary-color);
301
+ color: var(--white-color);
302
+ }
303
+ .danger-background {
304
+ background: var(--danger-color);
305
+ color: var(--white-color);
306
+ }
307
+
308
+ .warning-background {
309
+ background: var(--warning-color);
310
+ color: var(--white-color);
311
+ }
312
+ .rounded10 {
313
+ border-radius: 10px;
314
+ }
315
+ .custom-control-label::before {
316
+ border-color: var(--primary-color) !important;
317
+ }
318
+ .custom-control-input:checked ~ .custom-control-label::before {
319
+ color: #fff;
320
+ border-color: var(--primary-color) !important;
321
+ background-color: #fff !important;
322
+ }
323
+ .custom-radio .custom-control-input:checked ~ .custom-control-label::after {
324
+ background-color: var(--primary-color) !important;
325
+ background-image: none !important;
326
+ }
327
+ .custom-control-label::after {
328
+ position: absolute;
329
+ top: 0.4rem !important;
330
+ left: -1.35rem !important;
331
+ display: block;
332
+ width: 0.7rem !important;
333
+ height: 0.7rem !important;
334
+ content: "";
335
+ background: no-repeat 50% / 50% 50%;
336
+ border-radius: 100%;
337
+ }
338
+ .btn-info {
339
+ opacity: 0;
340
+ cursor: no-drop;
341
+ width: 0px;
342
+ height: 0px;
343
+ background-color: var(--primary-color) !important;
344
+ }
345
+
346
+ .MuiAutocomplete-proper *{
347
+ transition: none !important;
348
+ }
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
1
  {
2
2
  "name": "@firedesktop/react-base",
3
- "version": "1.6.0",
3
+ "version": "1.9.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
7
  "author": "alessandro.gambaro",
8
8
  "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
9
  "dependencies": {
10
- "react": "^17.0.1",
11
- "react-dom": "^17.0.1",
12
- "react-redux": "^7.2.1",
13
- "redux": "^4.0.5"
10
+ "react": "^16.14.0",
11
+ "react-dom": "^16.14.0",
12
+ "react-redux": "^7.2.1"
14
13
  },
15
14
  "devDependencies": {
16
- "@types/jest": "^26.0.15",
17
- "@types/node": "^12.19.1",
18
- "@types/react": "^16.9.53",
19
- "@types/react-dom": "^16.9.8",
20
- "@types/react-redux": "^7.1.9",
21
- "@testing-library/jest-dom": "^5.11.5",
22
- "@testing-library/react": "^11.1.0",
23
- "@testing-library/user-event": "^12.1.10",
24
15
  "@babel/cli": "^7.10.5",
25
16
  "@babel/core": "^7.10.5",
26
17
  "@babel/plugin-proposal-class-properties": "7.10.4",
27
18
  "@babel/plugin-transform-arrow-functions": "^7.12.1",
28
19
  "@babel/preset-typescript": "^7.12.1",
29
- "babel-preset-minify": "0.5.1",
20
+ "@testing-library/jest-dom": "^5.11.5",
21
+ "@testing-library/react": "^11.1.0",
22
+ "@testing-library/user-event": "^12.1.10",
23
+ "@types/jest": "^26.0.15",
24
+ "@types/node": "^12.19.1",
25
+ "@types/react": "^16.9.53",
26
+ "@types/react-dom": "^16.9.8",
27
+ "@types/react-redux": "^7.1.9",
30
28
  "babel-plugin-minify-builtins": "^0.5.0",
29
+ "babel-preset-minify": "0.5.1",
30
+ "copyfiles": "^2.4.0",
31
31
  "react-scripts": "^3.4.3",
32
32
  "typescript": "^4.0.3",
33
- "web-vitals": "^0.2.4",
34
- "@firedesktop/react-base": "1.2.0"
33
+ "web-vitals": "^0.2.4"
35
34
  },
36
35
  "peerDependencies": {},
37
36
  "scripts": {
38
37
  "distribute_not_working": "rmdir /s /q dist & mkdir dist && npx babel src/lib --out-dir dist --extensions \".js,.ts,.tsx\" --source-maps inline",
39
- "start": "react-scripts start",
40
- "distribute": "rmdir /s /q dist & mkdir dist && tsc"
38
+ "start": "react-scripts start && copy ./src/lib/styles/* ./dist/styles/ && tsc",
39
+ "distribute": "rmdir /s /q dist & mkdir dist\\styles && tsc && copyfiles -f src/lib/styles/* dist/styles",
40
+ "suca": "copyfiles -f src/lib/styles/* dist/styles"
41
41
  },
42
42
  "eslintConfig": {
43
43
  "extends": [
package/src/App.tsx CHANGED
@@ -5,6 +5,9 @@ import { createStore } from 'redux';
5
5
  import ConfigurationLoader from './types/ConfigurationLoader';
6
6
  // import LanguageLoader from './types/LanguageLoader';
7
7
  import TestLabelFunction from './TestLabelFunction';
8
+ import AppIcon from './lib/components/AppIcon';
9
+
10
+ import './lib/styles/base.css';
8
11
 
9
12
  export const UPDATE_APP_STATE = 'UPDATE_APP_STATE';
10
13
  const appReducer = (state = {}, action: any) => {
@@ -38,11 +41,10 @@ function App() {
38
41
  return (
39
42
 
40
43
  <Provider store={store}>
41
-
44
+ <AppIcon name={"Pin"} className='dark-pink-svg'/>
42
45
  <TestLabelFunction />
43
46
  <ConfigurationLoader updateAppState={updateAppState} path={null} />
44
- {/*
45
- <LanguageLoader updateAppState={updateAppState} locale='it-IT' path={null} /> */}
47
+ {/* <LanguageLoader updateAppState={updateAppState} locale='it-IT' path={null} /> */}
46
48
  </Provider >
47
49
  );
48
50
  }
@@ -19,17 +19,20 @@ function ConfigurationLoader({ updateAppState, path }: configurationLoaderParams
19
19
  fullPath = path;
20
20
 
21
21
  useEffect(() => {
22
- if (!configuration) {
23
- console.log(`Loading Configuration for this Site in this path: ${fullPath}`);
24
- loadConfiguration(fullPath).then((response: any) => {
25
- console.log(`Loaded Configuration for this Site in this path: ${fullPath}`, response);
26
- dispatch(updateAppState("configuration", response));
27
- })
28
- .catch((err: any) => {
29
- console.log(`Problem loading the Site Configuration in this path: ${fullPath}`);
30
- });
22
+ async function justAsync() {
23
+ if (!configuration) {
24
+ console.log(`Loading Configuration for this Site in this path: ${fullPath}`);
25
+ await loadConfiguration(fullPath).then((response: any) => {
26
+ console.log(`Loaded Configuration for this Site in this path: ${fullPath}`, response);
27
+ dispatch(updateAppState("configuration", response));
28
+
29
+ }).catch((err: any) => {
30
+ console.log(`Problem loading the Site Configuration in this path: ${fullPath}`);
31
+ });
32
+ }
31
33
  }
32
- }, [configuration, dispatch, loadConfiguration, fullPath, updateAppState]);
34
+ justAsync();
35
+ }, []);
33
36
 
34
37
  return (
35
38
  <React.Fragment>
@@ -5,34 +5,38 @@ import LanguageManager from './LanguageManager';
5
5
 
6
6
  export type languageLoaderParamsType = {
7
7
  updateAppState: any,
8
- locale: string,
8
+ language: string,
9
9
  path: string | null,
10
10
  // toggle: (confirm: boolean) => void
11
11
  }
12
12
 
13
- function LanguageLoader({ updateAppState, locale, path }: languageLoaderParamsType) {
13
+ function LanguageLoader({ updateAppState, language, path }: languageLoaderParamsType) {
14
14
  const dispatch = useDispatch();
15
15
  const { labels }: any = useSelector(state => state);
16
16
  const { loadLabels } = LanguageManager();
17
17
 
18
- const fileName = `${locale}.json`;
18
+ const fileName = `${language}.json`;
19
19
 
20
20
  let fullPath = `./labels/${fileName}`;
21
21
  if (path)
22
22
  fullPath = `./${path}/${fileName}`;
23
23
 
24
+ // Do it on change language
24
25
  useEffect(() => {
25
- if (!labels.language || labels.language !== locale) {
26
- console.log(`Loading Language Labels for this Site in this path: ${fullPath}`);
27
- loadLabels(fullPath).then((response: any) => {
28
- console.log(`Loaded Language Labels for this Site in this path: ${fullPath}`, response);
29
- dispatch(updateAppState("labels", response));
30
- })
31
- .catch((err: any) => {
32
- console.log(`Problem loading the Site Language Labels in this path: ${fullPath}`);
33
- });
26
+ async function justAsync() {
27
+ if (!labels.language || labels.language !== language) {
28
+ console.log(`Loading Language Labels for this Site in this path: ${fullPath}`);
29
+ loadLabels(fullPath).then((response: any) => {
30
+ console.log(`Loaded Language Labels for this Site in this path: ${fullPath}`, response);
31
+ dispatch(updateAppState("labels", response));
32
+ })
33
+ .catch((err: any) => {
34
+ console.log(`Problem loading the Site Language Labels in this path: ${fullPath}`);
35
+ });
36
+ }
34
37
  }
35
- }, [labels, dispatch, loadLabels, fullPath, updateAppState]);
38
+ justAsync();
39
+ }, [language]);
36
40
 
37
41
  return (
38
42
  <React.Fragment>