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,48 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2020.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the
5
+ * GNU Affero General Public License version 3 as published by the Free Software Foundation.
6
+ *
7
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
+ * See the GNU Affero General Public License for more details.
10
+ */
11
+
12
+ export type ContentMode = 'textile' | 'html' | 'md';
13
+
14
+ export const CONTENT_MODES: {
15
+ id: ContentMode,
16
+ title: string
17
+ }[] = [
18
+ { id: 'md', title: 'rich text' },
19
+ { id: 'textile', title: 'legacy' },
20
+ { id: 'html', title: 'advanced (html)' }
21
+ ];
22
+
23
+ export const getContentMarker = text => {
24
+ if (!text) return CONTENT_MODES[0].id;
25
+ const match = text.match(/\s*{render:"(.*)"}/, '');
26
+ return match && match[1] ? match[1] : CONTENT_MODES[1].id;
27
+ };
28
+
29
+ export const removeContentMarker = text => {
30
+ if (!text) return text;
31
+ return text.replace(/\s*{render:.*/g, '');
32
+ };
33
+
34
+ export const addContentMarker = (text, contentMode) => (
35
+ `${text}
36
+ {render:"${contentMode}"}`
37
+ );
38
+
39
+ export const getEditorModeLabel = (mode: ContentMode) => {
40
+ switch (mode) {
41
+ case 'md':
42
+ return 'RICH';
43
+ case 'html':
44
+ return 'HTML';
45
+ case 'textile':
46
+ return 'LEGACY';
47
+ }
48
+ };
@@ -0,0 +1,20 @@
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
+ import { ReactNode } from 'react';
10
+ import { AnyArgFunction } from '@src/model/CommonFunctions';
11
+
12
+ export interface AppBarAction {
13
+ action: AnyArgFunction;
14
+ icon: ReactNode;
15
+ tooltip: string;
16
+ confirmText?: string;
17
+ confirmButtonText?: string;
18
+ disabled?: boolean;
19
+ tooltipError?: boolean;
20
+ }
@@ -0,0 +1,8 @@
1
+ export type StringKeyObject<V = any> = { [key: string]: V };
2
+
3
+ export type StringKeyAndValueObject = StringKeyObject<string>;
4
+
5
+ // Helper type for creating types from string arrays
6
+ export type StringValueType<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType>
7
+ ? ElementType
8
+ : never;
@@ -0,0 +1,20 @@
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 type StringArgFunction = (arg: string) => void;
7
+
8
+ export type BooleanArgFunction = (arg: boolean) => void;
9
+
10
+ export type NumberArgFunction = (arg: number) => void;
11
+
12
+ export type HTMLTagArgFunction = (arg: HTMLElement) => void;
13
+
14
+ export type DateArgFunction = (arg: Date) => void;
15
+
16
+ export type AnyArgFunction<R = void, A = any> = (...args: A[]) => R;
17
+
18
+ export type NoArgFunction = () => void;
19
+
20
+ export type PromiseReturnFunction = (...args: any[]) => Promise<any>;
@@ -0,0 +1,27 @@
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
+ import { ReactNode } from 'react';
10
+ import { AnyArgFunction } from '@src/model/CommonFunctions';
11
+
12
+ export interface ConfirmProps {
13
+ onCancel?: AnyArgFunction;
14
+ onConfirm?: AnyArgFunction;
15
+ title?: string;
16
+ confirmMessage?: ReactNode;
17
+ cancelButtonText?: string;
18
+ confirmButtonText?: string;
19
+ onCancelCustom?: AnyArgFunction;
20
+ confirmCustomComponent?: ReactNode;
21
+ }
22
+
23
+ export interface ConfirmState extends ConfirmProps {
24
+ open: boolean;
25
+ }
26
+
27
+ export type ShowConfirmCaller = (props: ConfirmProps) => any;
@@ -0,0 +1,254 @@
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
+ import { ChangeEvent, DragEvent, FocusEvent, MutableRefObject, ReactElement, ReactNode } from 'react';
10
+ import { Dispatch } from 'redux';
11
+ import { InputProps } from '@mui/material/Input/Input';
12
+ import { AnyArgFunction } from '@src/model/CommonFunctions';
13
+ import { ShowConfirmCaller } from '@src/model/Confirm';
14
+
15
+ export type EventHandler<Event> = (event: Event, name?: string) => void;
16
+
17
+ export interface EventOrValueHandler<Event> extends EventHandler<Event> {
18
+ (value: any): void;
19
+ }
20
+
21
+ export interface TagLike {
22
+ id?: number;
23
+ name?: string;
24
+ color?: string;
25
+ system?: boolean;
26
+ urlPath?: string;
27
+ content?: string;
28
+ weight?: number;
29
+ taggedRecordsCount?: number;
30
+ childrenCount?: number;
31
+ created?: string;
32
+ modified?: string;
33
+ childTags?: TagLike[];
34
+ }
35
+
36
+ export interface MenuTag<T> {
37
+ active: boolean;
38
+ tagBody: T;
39
+ children: MenuTag<T>[];
40
+ parent?: MenuTag<T>;
41
+ entity?: string;
42
+ path?: string;
43
+ prefix?: string;
44
+ queryPrefix?: string;
45
+ indeterminate?: boolean;
46
+ }
47
+
48
+ export interface FieldInputProps {
49
+ checked?: boolean | undefined;
50
+ value: any;
51
+ name: string;
52
+ onBlur: EventOrValueHandler<FocusEvent<any>>;
53
+ onChange: EventOrValueHandler<ChangeEvent<any>>;
54
+ onDragStart: EventHandler<DragEvent<any>>;
55
+ onDrop: EventHandler<DragEvent<any>>;
56
+ onFocus: EventHandler<FocusEvent<any>>;
57
+ }
58
+
59
+ export interface FieldMetaProps {
60
+ active?: boolean | undefined;
61
+ dispatch: Dispatch<any>;
62
+ error?: any;
63
+ invalid: boolean;
64
+ touched: boolean;
65
+ }
66
+
67
+ export interface FieldClasses {
68
+ input?: string;
69
+ text?: string;
70
+ underline?: string;
71
+ label?: string;
72
+ selectMenu?: string;
73
+ loading?: string;
74
+ listbox?: string;
75
+ }
76
+
77
+ export interface SelectItemRendererProps<E = any> {
78
+ content: string;
79
+ data: E;
80
+ parentProps: any;
81
+ search?: string
82
+ }
83
+
84
+ export interface ColoredCheckboxFieldProps<IP, MP> {
85
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
86
+ meta?: Partial<MP>;
87
+ color: string;
88
+ label?: string;
89
+ className?: string;
90
+ disabled?: boolean;
91
+ }
92
+
93
+ export interface EditInPlaceFieldProps<IP, MP> {
94
+ inputRef?: MutableRefObject<any>;
95
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
96
+ meta?: Partial<MP>;
97
+ InputProps?: Partial<InputProps>;
98
+ label?: ReactNode,
99
+ maxLength?: number,
100
+ disabled?: boolean,
101
+ min?: string,
102
+ max?: string,
103
+ step?: string,
104
+ className?: string,
105
+ defaultValue?: any,
106
+ onKeyPress?: any,
107
+ placeholder?: string,
108
+ warning?: string,
109
+ labelAdornment?: any,
110
+ preformatDisplayValue?: any,
111
+ truncateLines?: number,
112
+ fieldClasses?: FieldClasses,
113
+ rightAligned?: boolean,
114
+ disableInputOffsets?: boolean,
115
+ onKeyDown?: any,
116
+ multiline?: boolean,
117
+ inline?: boolean,
118
+ }
119
+
120
+ export interface EditInPlaceDateTimeFieldProps<IP, MP> {
121
+ inputRef?: MutableRefObject<any>;
122
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
123
+ meta?: Partial<MP>;
124
+ fieldClasses?: FieldClasses,
125
+ onKeyPress?: AnyArgFunction;
126
+ labelAdornment?: ReactNode;
127
+ processActionId?: string;
128
+ formatDate?: string;
129
+ formatTime?: string;
130
+ formatDateTime?: string;
131
+ defaultValue?: any;
132
+ timezone?: string;
133
+ label?: ReactNode,
134
+ formatValue?: string;
135
+ className?: string;
136
+ placeholder?: string;
137
+ warning?: string;
138
+ inline?: boolean;
139
+ disabled?: boolean;
140
+ persistValue?: boolean;
141
+ rightAligned?: boolean;
142
+ }
143
+
144
+ export interface EditInPlaceSearchSelectFieldProps<IP, MP> {
145
+ inputRef?: MutableRefObject<any>;
146
+ input?: Partial<Omit<IP, 'onBlur'>> & ({ onBlur?: AnyArgFunction });
147
+ meta?: Partial<MP>;
148
+ items?: any[];
149
+ label?: ReactNode,
150
+ disabled?: boolean;
151
+ className?: string;
152
+ labelAdornment?: any;
153
+ inline?: boolean;
154
+ rightAligned?: boolean;
155
+ loading?: boolean;
156
+ hideLabel?: boolean;
157
+ colors?: any;
158
+ creatable?: boolean;
159
+ endAdornment?: any;
160
+ allowEmpty?: boolean;
161
+ fieldClasses?: FieldClasses;
162
+ selectLabelCondition?: any;
163
+ selectFilterCondition?: any;
164
+ defaultValue?: any;
165
+ rowHeight?: number;
166
+ remoteRowCount?: number;
167
+ loadMoreRows?: AnyArgFunction;
168
+ onCreateOption?: AnyArgFunction;
169
+ itemRenderer?: (content, data, search, parentProps) => ReactElement;
170
+ valueRenderer?: (content, data, search, parentProps) => ReactElement;
171
+ onInputChange?: AnyArgFunction;
172
+ onClearRows?: AnyArgFunction;
173
+ onInnerValueChange?: AnyArgFunction;
174
+ selectValueMark?: string;
175
+ remoteData?: boolean;
176
+ disableUnderline?: boolean;
177
+ createLabel?: string;
178
+ selectLabelMark?: string;
179
+ returnType?: 'object' | 'string';
180
+ alwaysDisplayDefault?: boolean;
181
+ popperAnchor?: any;
182
+ placeholder?: string;
183
+ sort?: ((a: any, b: any) => number) | boolean;
184
+ sortPropKey?: string;
185
+ hasError?: boolean;
186
+ multiple?: boolean;
187
+ hideMenuOnNoResults?: boolean;
188
+ hideEditIcon?: boolean;
189
+ warning?: string;
190
+ categoryKey?: string;
191
+ selectAdornment?: { position: 'start' | 'end', content: ReactElement }
192
+ }
193
+
194
+ export interface CodeFieldProps<IP, MP> {
195
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
196
+ meta?: Partial<MP>;
197
+ classes?: any;
198
+ className?: string;
199
+ errorMessage?: string;
200
+ disabled?: boolean;
201
+ onFocus?: AnyArgFunction;
202
+ }
203
+
204
+ export interface FormSwitchProps<IP> {
205
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
206
+ color?: string;
207
+ disabled?: boolean;
208
+ stringValue?: boolean;
209
+ label?: ReactNode;
210
+ className?: string;
211
+ inline?: boolean;
212
+ onChangeHandler?: AnyArgFunction;
213
+ onClick?: AnyArgFunction;
214
+ }
215
+
216
+ export interface CheckboxFieldProps<IP> {
217
+ input?: Partial<Omit<IP, 'onBlur'>> & { onBlur?: AnyArgFunction };
218
+ color?: string;
219
+ disabled?: boolean;
220
+ stringValue?: boolean;
221
+ className?: string;
222
+ uncheckedClass?: string;
223
+ onChangeHandler?: AnyArgFunction;
224
+ stopPropagation?: boolean;
225
+ }
226
+
227
+ export interface TagsFieldProps<T, IP, MP> extends EditInPlaceFieldProps<IP, MP> {
228
+ tags: T[];
229
+ showConfirm?: ShowConfirmCaller;
230
+ classes?: any;
231
+ validateEntity?: string;
232
+ }
233
+
234
+ interface FormFieldBaseProps {
235
+ required?: boolean;
236
+ format?: AnyArgFunction;
237
+ onClick?: AnyArgFunction;
238
+
239
+ // Performance optimization property that handles field value rendering outside of Redux Form life circle.
240
+ // It is true by default
241
+ // Should be set to false when Redux Form lificircle handlers are used (onChange,onBlur and etc)
242
+ debounced?: boolean;
243
+ }
244
+
245
+ export type FormFieldProps =
246
+ ({ type: 'phone' | 'duration' | 'text' | 'multilineText' | 'password' | 'number' | 'file' | 'money' } & FormFieldBaseProps & EditInPlaceFieldProps<FieldInputProps, FieldMetaProps>)
247
+ | ({ type: 'select' } & FormFieldBaseProps & EditInPlaceSearchSelectFieldProps<FieldInputProps, FieldMetaProps>)
248
+ | ({ type: 'date' | 'time' | 'dateTime' } & FormFieldBaseProps & EditInPlaceDateTimeFieldProps<FieldInputProps, FieldMetaProps>)
249
+ | ({ type: 'code' } & FormFieldBaseProps & CodeFieldProps<FieldInputProps, FieldMetaProps>)
250
+ | ({ type: 'coloredCheckbox' } & FormFieldBaseProps & ColoredCheckboxFieldProps<FieldInputProps, FieldMetaProps>)
251
+ | ({ type: 'switch' } & FormFieldBaseProps & FormSwitchProps<FieldInputProps>)
252
+ | ({ type: 'checkbox' } & FormFieldBaseProps & CheckboxFieldProps<FieldInputProps>)
253
+ | ({ type: 'tags' } & FormFieldBaseProps & TagsFieldProps<TagLike, FieldInputProps, FieldMetaProps>)
254
+ | ({ type: 'stub' })
@@ -0,0 +1,14 @@
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 interface EntityType {
7
+ name: string;
8
+ count: number;
9
+ disabled?: boolean;
10
+ link?: string;
11
+ timetableLink?: string;
12
+ linkHandler?: any;
13
+ grayOut?: boolean;
14
+ }
@@ -0,0 +1,42 @@
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
+ import { Theme, Palette, SimplePaletteColorOptions, TypeText } from '@mui/material';
10
+ import { StringKeyObject } from '@src/model/CommomObjects';
11
+
12
+ enum ThemeValuesEnum {
13
+ 'default',
14
+ 'dark',
15
+ 'monochrome',
16
+ 'highcontrast'
17
+ }
18
+
19
+ export type ThemeValues = keyof typeof ThemeValuesEnum;
20
+
21
+ export const DefaultThemeKey: ThemeValues = 'default';
22
+
23
+ export const DarkThemeKey: ThemeValues = 'dark';
24
+ export const MonochromeThemeKey: ThemeValues = 'monochrome';
25
+ export const HighcontrastThemeKey: ThemeValues = 'highcontrast';
26
+
27
+ type ColorGetter = string | ((props: {}) => string);
28
+
29
+ type TextExtended = TypeText & { primaryEditable: string; hint: string; grey: string };
30
+
31
+ export interface AppTheme extends Theme {
32
+ heading: StringKeyObject<ColorGetter>;
33
+ blog: StringKeyObject<StringKeyObject<ColorGetter>>;
34
+ share: StringKeyObject<StringKeyObject<ColorGetter>>;
35
+ statistics: StringKeyObject<StringKeyObject<ColorGetter>>;
36
+ appBar: StringKeyObject<StringKeyObject<ColorGetter>>;
37
+ appBarButton: StringKeyObject<StringKeyObject<ColorGetter>>;
38
+ tabList: StringKeyObject<StringKeyObject<ColorGetter>>;
39
+ table: StringKeyObject<SimplePaletteColorOptions>;
40
+ palette: Palette & { text: TextExtended };
41
+ addButtonColor: StringKeyObject<ColorGetter>;
42
+ }
@@ -0,0 +1,16 @@
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 './AppBar';
11
+ export * from './Confirm';
12
+ export * from './Fields';
13
+ export * from './NestedEntity';
14
+ export * from './Theme';
15
+ export * from './CommomObjects';
16
+ export * from './CommonFunctions';