ish-ui 1.0.2

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 (126) hide show
  1. package/.eslintrc.json +39 -0
  2. package/.gitattributes +3 -0
  3. package/.github/workflows/release-package.yml +33 -0
  4. package/.prettierrc +5 -0
  5. package/README.md +80 -0
  6. package/assets/fonts/inter/Inter-Italic.var.woff2 +0 -0
  7. package/assets/fonts/inter/Inter-Roman.var.woff2 +0 -0
  8. package/assets/fonts/inter/LICENSE.txt +92 -0
  9. package/assets/fonts/inter/index.d.ts +10 -0
  10. package/assets/fonts/inter/inter.scss +17 -0
  11. package/package.json +108 -0
  12. package/src/actions/FieldProcessing.ts +21 -0
  13. package/src/actions/index.ts +10 -0
  14. package/src/appBar/AppBarHelpMenu.tsx +139 -0
  15. package/src/appBar/index.ts +9 -0
  16. package/src/buttons/AddButton.tsx +30 -0
  17. package/src/buttons/TimetableButton.tsx +19 -0
  18. package/src/buttons/index.ts +10 -0
  19. package/src/colorPicker/ColorPicker.tsx +223 -0
  20. package/src/colorPicker/index.ts +9 -0
  21. package/src/dialog/BrowserWarning.tsx +24 -0
  22. package/src/dialog/confirm/ConfirmBase.tsx +59 -0
  23. package/src/dialog/index.ts +11 -0
  24. package/src/dialog/message/Message.tsx +140 -0
  25. package/src/documents/DocumentIconsChooser.tsx +69 -0
  26. package/src/documents/index.ts +10 -0
  27. package/src/documents/utils/index.tsx +71 -0
  28. package/src/dynamicSizeList/DynamicSizeList.tsx +208 -0
  29. package/src/dynamicSizeList/index.ts +9 -0
  30. package/src/fieldMessage/ErrorMessage.tsx +28 -0
  31. package/src/fieldMessage/WarningMessage.tsx +28 -0
  32. package/src/fieldMessage/index.ts +11 -0
  33. package/src/fieldMessage/styles.ts +21 -0
  34. package/src/fileUploader/FileUploaderDialog.tsx +158 -0
  35. package/src/fileUploader/index.ts +9 -0
  36. package/src/formFields/CheckboxField.tsx +90 -0
  37. package/src/formFields/CodeEditorField.tsx +103 -0
  38. package/src/formFields/ColoredCheckBox.tsx +74 -0
  39. package/src/formFields/DateTimeField.tsx +61 -0
  40. package/src/formFields/EditInPlaceDateTimeField.tsx +285 -0
  41. package/src/formFields/EditInPlaceDurationField.tsx +79 -0
  42. package/src/formFields/EditInPlaceField.tsx +131 -0
  43. package/src/formFields/EditInPlaceFieldBase.tsx +241 -0
  44. package/src/formFields/EditInPlaceFileField.tsx +67 -0
  45. package/src/formFields/EditInPlaceMoneyField.tsx +64 -0
  46. package/src/formFields/EditInPlacePhoneField.tsx +97 -0
  47. package/src/formFields/EditInPlaceSearchSelect.tsx +562 -0
  48. package/src/formFields/FieldAdornments.tsx +70 -0
  49. package/src/formFields/FilePreview.tsx +149 -0
  50. package/src/formFields/FormRadioButtons.tsx +62 -0
  51. package/src/formFields/SelectCustomComponents.tsx +228 -0
  52. package/src/formFields/Switch.tsx +146 -0
  53. package/src/formFields/TextField.tsx +60 -0
  54. package/src/formFields/UneditableBase.tsx +101 -0
  55. package/src/formFields/index.ts +27 -0
  56. package/src/index.ts +26 -0
  57. package/src/layout/InfoPill.tsx +36 -0
  58. package/src/layout/index.ts +10 -0
  59. package/src/layout/resizable/ResizableWrapper.tsx +87 -0
  60. package/src/markdownEditor/HtmlEditor.tsx +44 -0
  61. package/src/markdownEditor/WysiwygEditor.tsx +137 -0
  62. package/src/markdownEditor/index.ts +12 -0
  63. package/src/markdownEditor/style.ts +188 -0
  64. package/src/markdownEditor/utils/index.ts +48 -0
  65. package/src/model/AppBar.ts +20 -0
  66. package/src/model/CommomObjects.ts +8 -0
  67. package/src/model/CommonFunctions.ts +20 -0
  68. package/src/model/Confirm.ts +27 -0
  69. package/src/model/Fields.ts +254 -0
  70. package/src/model/NestedEntity.ts +14 -0
  71. package/src/model/Theme.ts +42 -0
  72. package/src/model/index.ts +16 -0
  73. package/src/styles/GlobalStylesProvider.tsx +520 -0
  74. package/src/styles/StylesProviderCustom.tsx +8 -0
  75. package/src/styles/animateStyles.ts +94 -0
  76. package/src/styles/bootstrap.ts +503 -0
  77. package/src/styles/hooks.ts +44 -0
  78. package/src/styles/index.ts +18 -0
  79. package/src/styles/makeStyles.ts +21 -0
  80. package/src/styles/mixins/common.ts +40 -0
  81. package/src/styles/mixins/keyframes.ts +16 -0
  82. package/src/styles/mixins/prefixer.ts +21 -0
  83. package/src/tagsInput/AddTagMenu.tsx +74 -0
  84. package/src/tagsInput/AddTagMenuItem.tsx +50 -0
  85. package/src/tagsInput/TagInputList.tsx +428 -0
  86. package/src/tagsInput/index.ts +4 -0
  87. package/src/themes/appTheme.ts +324 -0
  88. package/src/themes/index.ts +10 -0
  89. package/src/themes/ishTheme.ts +401 -0
  90. package/src/timetable/datePeriodFilter/DayPeriodIcons.tsx +95 -0
  91. package/src/timetable/datePeriodFilter/index.ts +10 -0
  92. package/src/timetable/index.ts +11 -0
  93. package/src/timetable/miniCalendar/CalendarDay.tsx +109 -0
  94. package/src/timetable/miniCalendar/CalendarHeader.tsx +37 -0
  95. package/src/timetable/miniCalendar/CalendarWeekPanel.tsx +35 -0
  96. package/src/timetable/miniCalendar/WeekDay.tsx +49 -0
  97. package/src/timetable/miniCalendar/index.ts +13 -0
  98. package/src/utils/DOM/Links.ts +17 -0
  99. package/src/utils/DOM/getCaretCoordinates.ts +122 -0
  100. package/src/utils/DOM/getOS.ts +32 -0
  101. package/src/utils/DOM/index.ts +34 -0
  102. package/src/utils/dates/datesNormalizing.ts +4 -0
  103. package/src/utils/dates/format.ts +52 -0
  104. package/src/utils/dates/formatRelative.ts +22 -0
  105. package/src/utils/dates/formatString.ts +233 -0
  106. package/src/utils/dates/formatTimezone.ts +37 -0
  107. package/src/utils/dates/index.ts +15 -0
  108. package/src/utils/dates/timetable.ts +46 -0
  109. package/src/utils/events/index.ts +8 -0
  110. package/src/utils/fields/index.ts +23 -0
  111. package/src/utils/formatting/PhoneMasks.ts +320 -0
  112. package/src/utils/formatting/index.tsx +20 -0
  113. package/src/utils/hooks/index.ts +19 -0
  114. package/src/utils/index.ts +15 -0
  115. package/src/utils/numbers/decimalCalculation.ts +26 -0
  116. package/src/utils/numbers/index.ts +11 -0
  117. package/src/utils/numbers/numbersNormalizing.ts +52 -0
  118. package/src/utils/stubs/index.tsx +12 -0
  119. package/src/utils/tags/index.ts +53 -0
  120. package/tools/webpack/webpack.aliases.js +13 -0
  121. package/tools/webpack/webpack.config.dev.js +29 -0
  122. package/tools/webpack/webpack.config.prod.js +36 -0
  123. package/tools/webpack/webpack.helpers.js +26 -0
  124. package/tools/webpack/webpack.plugins.js +15 -0
  125. package/tools/webpack/webpack.rules.js +51 -0
  126. package/tsconfig.json +24 -0
@@ -0,0 +1,503 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2022.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+
9
+ import { alpha } from '@mui/material/styles';
10
+ import { AppTheme } from '@src/model';
11
+ import { prefixer } from './mixins/prefixer';
12
+
13
+ export const bootstrap = (theme: AppTheme) => ({
14
+ strong: {
15
+ fontWeight: 'bold'
16
+ },
17
+ '.fontWeight-normal': {
18
+ fontWeight: 'normal'
19
+ },
20
+ '.fontWeight600': {
21
+ fontWeight: 600
22
+ },
23
+ '.text-bold': {
24
+ fontWeight: theme.typography.fontWeightBold
25
+ },
26
+ '.text-bolder': {
27
+ fontWeight: 'bolder'
28
+ },
29
+ '.fs2': {
30
+ fontSize: theme.spacing(2)
31
+ },
32
+ '.fs3': {
33
+ fontSize: theme.spacing(3)
34
+ },
35
+ '.fs4': {
36
+ fontSize: theme.spacing(4)
37
+ },
38
+ '.fs8': {
39
+ fontSize: theme.spacing(8)
40
+ },
41
+ '.fs10': {
42
+ fontSize: theme.spacing(10)
43
+ },
44
+ '.fs19': {
45
+ fontSize: theme.spacing(19)
46
+ },
47
+ '.fw300': {
48
+ fontWeight: 300
49
+ },
50
+ '.fsInherit': {
51
+ fontSize: 'inherit'
52
+ },
53
+ '.relative': {
54
+ position: 'relative'
55
+ },
56
+ '.absolute': {
57
+ position: 'absolute'
58
+ },
59
+ '.fixed': {
60
+ position: 'fixed'
61
+ },
62
+ '.sticky': {
63
+ position: 'sticky'
64
+ },
65
+ '.left-0': {
66
+ left: 0
67
+ },
68
+ '.top-0': {
69
+ top: 0
70
+ },
71
+ '.right-0': {
72
+ right: 0
73
+ },
74
+ '.bottom-0': {
75
+ bottom: 0
76
+ },
77
+ '.pt-10': {
78
+ paddingTop: theme.spacing(10)
79
+ },
80
+ '.pr-6': {
81
+ paddingRight: theme.spacing(6)
82
+ },
83
+ '.p-4': {
84
+ padding: theme.spacing(4)
85
+ },
86
+ '.pr-4': {
87
+ paddingRight: theme.spacing(4)
88
+ },
89
+ '.p-3': {
90
+ padding: theme.spacing(3)
91
+ },
92
+ '.pt-3': {
93
+ paddingTop: theme.spacing(3)
94
+ },
95
+ '.pl-3': {
96
+ paddingLeft: theme.spacing(3)
97
+ },
98
+ '.pr-3': {
99
+ paddingRight: theme.spacing(3)
100
+ },
101
+ '.pb-3': {
102
+ paddingBottom: theme.spacing(3)
103
+ },
104
+ '.p-2': {
105
+ padding: theme.spacing(2)
106
+ },
107
+ '.pl-2': {
108
+ paddingLeft: theme.spacing(2)
109
+ },
110
+ '.pr-2': {
111
+ paddingRight: theme.spacing(2)
112
+ },
113
+ '.pb-2': {
114
+ paddingBottom: theme.spacing(2)
115
+ },
116
+ '.pt-2': {
117
+ paddingTop: theme.spacing(2)
118
+ },
119
+ '.p-1': {
120
+ padding: theme.spacing(1)
121
+ },
122
+ '.pt-1': {
123
+ paddingTop: theme.spacing(1)
124
+ },
125
+ '.pb-1': {
126
+ paddingBottom: theme.spacing(1)
127
+ },
128
+ '.pl-1': {
129
+ paddingLeft: theme.spacing(1)
130
+ },
131
+ '.pr-1': {
132
+ paddingRight: theme.spacing(1)
133
+ },
134
+ '.p-0-5': {
135
+ padding: theme.spacing(0.5)
136
+ },
137
+ '.pl-0-5': {
138
+ paddingLeft: theme.spacing(0.5)
139
+ },
140
+ '.pt-0-5': {
141
+ paddingTop: theme.spacing(0.5)
142
+ },
143
+ '.pr-0-5': {
144
+ paddingRight: theme.spacing(0.5)
145
+ },
146
+ '.pb-0-5': {
147
+ paddingBottom: theme.spacing(0.5)
148
+ },
149
+ '.p-0': {
150
+ padding: 0
151
+ },
152
+ '.pl-0': {
153
+ paddingLeft: 0
154
+ },
155
+ '.pt-0': {
156
+ paddingTop: 0
157
+ },
158
+ '.pr-0': {
159
+ paddingRight: 0
160
+ },
161
+ '.pb-0': {
162
+ paddingBottom: 0
163
+ },
164
+ '.m-3': {
165
+ margin: theme.spacing(3)
166
+ },
167
+ '.mt-5': {
168
+ marginTop: theme.spacing(5)
169
+ },
170
+ '.mt-4': {
171
+ marginTop: theme.spacing(4)
172
+ },
173
+ '.mt-3': {
174
+ marginTop: theme.spacing(3)
175
+ },
176
+ '.ml-3': {
177
+ marginLeft: theme.spacing(3)
178
+ },
179
+ '.mr-5': {
180
+ marginRight: theme.spacing(5)
181
+ },
182
+ '.mr-4': {
183
+ marginRight: theme.spacing(4)
184
+ },
185
+ '.mr-3': {
186
+ marginRight: theme.spacing(3)
187
+ },
188
+ '.mb-5': {
189
+ marginBottom: theme.spacing(5)
190
+ },
191
+ '.mb-4': {
192
+ marginBottom: theme.spacing(4)
193
+ },
194
+ '.mb-3': {
195
+ marginBottom: theme.spacing(3)
196
+ },
197
+ '.m-2': {
198
+ margin: theme.spacing(2)
199
+ },
200
+ '.mt-2': {
201
+ marginTop: theme.spacing(2)
202
+ },
203
+ '.ml-2': {
204
+ marginLeft: theme.spacing(2)
205
+ },
206
+ '.mr-2': {
207
+ marginRight: theme.spacing(2)
208
+ },
209
+ '.mb-2': {
210
+ marginBottom: theme.spacing(2)
211
+ },
212
+ '.m-1': {
213
+ margin: theme.spacing(1)
214
+ },
215
+ '.mt-1': {
216
+ marginTop: theme.spacing(1)
217
+ },
218
+ '.ml-1': {
219
+ marginLeft: theme.spacing(1)
220
+ },
221
+ '.mr-1': {
222
+ marginRight: theme.spacing(1)
223
+ },
224
+ '.mr-auto': {
225
+ marginRight: 'auto'
226
+ },
227
+ '.ml-auto': {
228
+ marginLeft: 'auto'
229
+ },
230
+ '.mb-1': {
231
+ marginBottom: theme.spacing(1)
232
+ },
233
+ '.mt-0-5': {
234
+ marginTop: theme.spacing(0.5)
235
+ },
236
+ '.mr-0-5': {
237
+ marginRight: theme.spacing(0.5)
238
+ },
239
+ '.ml-0-5': {
240
+ marginLeft: theme.spacing(0.5)
241
+ },
242
+ '.mb-0-5': {
243
+ marginBottom: theme.spacing(0.5)
244
+ },
245
+ '.m-0': {
246
+ margin: 0
247
+ },
248
+ '.mt-auto': {
249
+ marginTop: 'auto'
250
+ },
251
+ '.mb-auto': {
252
+ marginBottom: 'auto'
253
+ },
254
+ '.ml-0': {
255
+ marginLeft: 0
256
+ },
257
+ '.mt-0': {
258
+ marginTop: 0
259
+ },
260
+ '.mr-0': {
261
+ marginRight: 0
262
+ },
263
+ '.mb-0': {
264
+ marginBottom: 0
265
+ },
266
+ '.text-uppercase': {
267
+ textTransform: 'uppercase'
268
+ },
269
+ '.overflow-visible': {
270
+ overflow: 'visible'
271
+ },
272
+ '.overflow-hidden': {
273
+ overflow: 'hidden'
274
+ },
275
+ '.overflow-x-hidden': {
276
+ overflowX: 'hidden'
277
+ },
278
+ '.overflow-y-auto': {
279
+ overflowY: 'auto'
280
+ },
281
+ '.overflow-auto': {
282
+ overflow: 'auto'
283
+ },
284
+ '.overflow-initial': {
285
+ overflow: 'initial'
286
+ },
287
+ '.d-block': {
288
+ display: 'block'
289
+ },
290
+ '.d-inline': {
291
+ display: 'inline'
292
+ },
293
+ '.d-inline-block': {
294
+ display: 'inline-block'
295
+ },
296
+ '.d-grid': {
297
+ display: 'grid'
298
+ },
299
+ '.d-flex': {
300
+ display: 'flex'
301
+ },
302
+ '.d-inline-flex': {
303
+ display: 'inline-flex'
304
+ },
305
+ '.flex-row': {
306
+ display: 'flex',
307
+ flexDirection: 'row'
308
+ },
309
+ '.flex-column': {
310
+ display: 'flex',
311
+ flexDirection: 'column'
312
+ },
313
+ '.centeredFlex': {
314
+ display: 'flex',
315
+ alignItems: 'center'
316
+ },
317
+ '.d-flex-start': {
318
+ display: 'flex',
319
+ alignItems: 'flex-start'
320
+ },
321
+ '.d-inline-flex-center': {
322
+ display: 'inline-flex',
323
+ alignItems: 'center'
324
+ },
325
+ '.d-none': {
326
+ display: 'none'
327
+ },
328
+ '.flex-fill': {
329
+ flex: 1
330
+ },
331
+ '.flex-nowrap': {
332
+ flexWrap: 'nowrap'
333
+ },
334
+ '.flex-wrap': {
335
+ flexWrap: 'wrap'
336
+ },
337
+ '.align-items-baseline': {
338
+ alignItems: 'baseline'
339
+ },
340
+ '.align-items-center': {
341
+ alignItems: 'center'
342
+ },
343
+ '.align-items-start': {
344
+ alignItems: 'flex-start'
345
+ },
346
+ '.align-items-end': {
347
+ alignItems: 'flex-end'
348
+ },
349
+ '.align-content-between': {
350
+ alignContent: 'space-between'
351
+ },
352
+ '.align-content-start': {
353
+ alignContent: 'flex-start'
354
+ },
355
+ '.justify-content-end': {
356
+ justifyContent: 'flex-end'
357
+ },
358
+ '.justify-content-start': {
359
+ justifyContent: 'flex-start'
360
+ },
361
+ '.justify-content-center': {
362
+ justifyContent: 'center'
363
+ },
364
+ '.justify-content-space-between': {
365
+ justifyContent: 'space-between'
366
+ },
367
+ '.outline-none': {
368
+ outline: 'none'
369
+ },
370
+ '.disabled': {
371
+ opacity: theme.palette.action.disabledOpacity,
372
+ pointerEvents: 'none'
373
+ },
374
+ '.text-op065': {
375
+ color: alpha(theme.palette.text.primary, 0.65),
376
+ },
377
+ '.text-op05': {
378
+ color: alpha(theme.palette.text.primary, 0.5),
379
+ },
380
+ '.invisible': {
381
+ visibility: 'hidden'
382
+ },
383
+ '.visible': {
384
+ visibility: 'visible'
385
+ },
386
+ '.text-left': {
387
+ textAlign: 'left'
388
+ },
389
+ '.text-center': {
390
+ textAlign: 'center'
391
+ },
392
+ '.text-end': {
393
+ textAlign: 'end'
394
+ },
395
+ '.text-disabled': {
396
+ color: theme.palette.text.disabled
397
+ },
398
+ '.cursor-grab': {
399
+ cursor: 'grab'
400
+ },
401
+ '.cursor-pointer': {
402
+ cursor: 'pointer'
403
+ },
404
+ '.cursor-text': {
405
+ cursor: 'text'
406
+ },
407
+ '.pointer-events-none': {
408
+ pointerEvents: 'none'
409
+ },
410
+ '.text-truncate': {
411
+ overflow: 'hidden',
412
+ textOverflow: 'ellipsis'
413
+ },
414
+ '.text-nowrap': {
415
+ whiteSpace: 'nowrap'
416
+ },
417
+ '.text-pre-wrap': {
418
+ whiteSpace: 'pre-wrap'
419
+ },
420
+ '.text-pre-line': {
421
+ whiteSpace: 'pre-line'
422
+ },
423
+ '.text-pre': {
424
+ whiteSpace: 'pre'
425
+ },
426
+ '.text-break-spaces': {
427
+ whiteSpace: 'break-spaces'
428
+ },
429
+ '.word-break-all': {
430
+ wordBreak: 'break-all'
431
+ },
432
+ '.h-100': {
433
+ height: '100%'
434
+ },
435
+ '.w-100': {
436
+ width: '100%'
437
+ },
438
+ '.mw-100': {
439
+ maxWidth: '100%'
440
+ },
441
+ '.w-50': {
442
+ width: '50%'
443
+ },
444
+ '.mw-800': {
445
+ maxWidth: theme.spacing(100)
446
+ },
447
+ '.mw-500': {
448
+ maxWidth: theme.spacing(62.5)
449
+ },
450
+ '.mw-600': {
451
+ maxWidth: theme.spacing(75)
452
+ },
453
+ '.mw-400': {
454
+ maxWidth: theme.spacing(50)
455
+ },
456
+ '.text-reset': {
457
+ color: 'inherit'
458
+ },
459
+ '.text-white': {
460
+ color: '#fff'
461
+ },
462
+ '.zIndex1401': {
463
+ zIndex: theme.zIndex.snackbar + 1
464
+ },
465
+ '.zIndex9': {
466
+ zIndex: 9
467
+ },
468
+ '.zIndex2': {
469
+ zIndex: 2
470
+ },
471
+ '.zIndex1': {
472
+ zIndex: 1
473
+ },
474
+ '.zIndex0': {
475
+ zIndex: 0
476
+ },
477
+ '.box-shadow-none': {
478
+ boxShadow: 'none'
479
+ },
480
+ '.user-select-none': {
481
+ WebkitTouchCallout: 'none',
482
+ KhtmlUserSelect: 'none',
483
+ ...prefixer('userSelect', 'none')
484
+ },
485
+ '.vert-align-mid': {
486
+ verticalAlign: 'middle'
487
+ },
488
+ '.vert-align-bl': {
489
+ verticalAlign: 'baseline'
490
+ },
491
+ '.grid-temp-col-3-fr': {
492
+ gridTemplateColumns: '1fr 1fr 1fr'
493
+ },
494
+ '.grid-temp-col-2-fr': {
495
+ gridTemplateColumns: '1fr 1fr'
496
+ },
497
+ '.lh-1': {
498
+ lineHeight: 1,
499
+ },
500
+ '.text-decoration-underline': {
501
+ textDecoration: 'underline',
502
+ },
503
+ });
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
+ * No copying or use of this code is allowed without permission in writing from ish.
4
+ */
5
+
6
+ import { useEffect, useState } from 'react';
7
+ import { makeStyles } from '@mui/styles';
8
+ import * as Colors from '@mui/material/colors';
9
+
10
+ export const useHoverShowStyles = makeStyles({
11
+ container: {
12
+ '&:hover $target': {
13
+ visibility: 'visible'
14
+ }
15
+ },
16
+ target: {
17
+ visibility: 'hidden'
18
+ }
19
+ });
20
+
21
+ export const useWindowSize = () => {
22
+ const [windowSize, setWindowSize] = useState({
23
+ width: undefined,
24
+ height: undefined,
25
+ });
26
+
27
+ useEffect(() => {
28
+ const handleResize = () => {
29
+ setWindowSize({
30
+ width: window.innerWidth,
31
+ height: window.innerHeight,
32
+ });
33
+ };
34
+ window.addEventListener('resize', handleResize);
35
+ handleResize();
36
+ return () => window.removeEventListener('resize', handleResize);
37
+ }, []);
38
+
39
+ return windowSize;
40
+ };
41
+
42
+ export const getColor = (i, code) => {
43
+ return Colors[Object.keys(Colors)[i]][code];
44
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+
9
+
10
+ export * from './mixins/keyframes';
11
+ export * from './mixins/common';
12
+ export * from './mixins/prefixer';
13
+ export * from './animateStyles';
14
+ export * from './bootstrap';
15
+ export * from './GlobalStylesProvider';
16
+ export * from './hooks';
17
+ export * from './makeStyles';
18
+ export * from './StylesProviderCustom';
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2021.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+
9
+ import {
10
+ makeStyles, Styles, WithStylesOptions, ClassNameMap
11
+ } from '@mui/styles';
12
+ import { AppTheme } from '@src/model';
13
+
14
+ export const makeAppStyles = <
15
+ Props extends object = {},
16
+ ClassKey extends string = string>(
17
+ styles: Styles<AppTheme, Props, ClassKey>,
18
+ options?: Omit<WithStylesOptions<AppTheme>, 'withTheme'>
19
+ ): keyof Props extends never
20
+ ? (props?: any) => ClassNameMap<ClassKey>
21
+ : (props: Props) => ClassNameMap<ClassKey> => makeStyles<AppTheme>(styles, options);
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
+ * No copying or use of this code is allowed without permission in writing from ish.
4
+ */
5
+
6
+ import { prefixer } from './prefixer';
7
+
8
+ export const transform = (value = 'none') => prefixer('transform', value);
9
+
10
+ export const transition = (theme, value = 'none', options = null) => {
11
+ const optionItems = options || {
12
+ duration: theme.transitions.duration.standard,
13
+ easing: theme.transitions.easing.easeInOut
14
+ };
15
+
16
+ if (value === 'none') {
17
+ return {
18
+ transition: 'none',
19
+ };
20
+ }
21
+
22
+ if (value === 'all') {
23
+ return {
24
+ willChange: 'auto',
25
+ transition: theme.transitions.create(value, optionItems),
26
+ };
27
+ }
28
+
29
+ const values = value.split(',').map(v => v.trim());
30
+ const transitionValue = [];
31
+
32
+ values.forEach(v => {
33
+ transitionValue.push(theme.transitions.create(v, optionItems));
34
+ });
35
+
36
+ return {
37
+ willChange: value,
38
+ transition: transitionValue.join(', ')
39
+ };
40
+ };
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
+ * No copying or use of this code is allowed without permission in writing from ish.
4
+ */
5
+
6
+ import { prefixer } from './prefixer';
7
+
8
+ export const keyframes = (name, content, otherStyle = {}) => ({
9
+ [`@keyframes ${name}`]: {
10
+ ...content
11
+ },
12
+ [`.${name}`]: {
13
+ ...prefixer('animationName', name, ['webkit', 'spec']),
14
+ ...otherStyle
15
+ }
16
+ });
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
+ * No copying or use of this code is allowed without permission in writing from ish.
4
+ */
5
+
6
+ export const prefixer = (property, value, prefixes = ['webkit', 'moz', 'ms', 'spec']) => {
7
+ const prefixedItem = {};
8
+ const propertyKey = property.charAt(0).toUpperCase() + property.slice(1);
9
+ prefixes.forEach(item => {
10
+ if (item === 'webkit') {
11
+ prefixedItem[`Webkit${propertyKey}`] = value;
12
+ } else if (item === 'moz') {
13
+ prefixedItem[`Moz${propertyKey}`] = value;
14
+ } else if (item === 'ms') {
15
+ prefixedItem[`Ms${propertyKey}`] = value;
16
+ } else if (item === 'spec') {
17
+ prefixedItem[property] = value;
18
+ }
19
+ });
20
+ return prefixedItem;
21
+ };