@axinom/mosaic-ui 0.33.0-rc.0 → 0.33.0-rc.19

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 (112) hide show
  1. package/dist/components/Actions/Actions.models.d.ts +0 -13
  2. package/dist/components/Actions/Actions.models.d.ts.map +1 -1
  3. package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
  4. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +3 -1
  5. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
  6. package/dist/components/FormElements/CustomTags/CustomTags.d.ts.map +1 -1
  7. package/dist/components/FormElements/FileUploadControl/FileUploadControl.d.ts.map +1 -1
  8. package/dist/components/FormElements/Radio/Radio.d.ts.map +1 -1
  9. package/dist/components/FormElements/Tags/Tags.d.ts.map +1 -1
  10. package/dist/components/FormElements/formStoryHelper.d.ts.map +1 -1
  11. package/dist/components/FormStation/FormStation.d.ts.map +1 -1
  12. package/dist/components/FormStation/SaveOnNavigate/SaveOnNavigate.d.ts +2 -0
  13. package/dist/components/FormStation/SaveOnNavigate/SaveOnNavigate.d.ts.map +1 -1
  14. package/dist/components/FormStation/SaveOnNavigate/handleNavigationAttempt.d.ts +1 -1
  15. package/dist/components/FormStation/SaveOnNavigate/handleNavigationAttempt.d.ts.map +1 -1
  16. package/dist/components/FormStation/StationErrorStateType.d.ts +5 -0
  17. package/dist/components/FormStation/StationErrorStateType.d.ts.map +1 -0
  18. package/dist/components/FormStation/useValidationError.d.ts +15 -0
  19. package/dist/components/FormStation/useValidationError.d.ts.map +1 -0
  20. package/dist/components/InfoPanel/InfoImage/InfoImage.d.ts.map +1 -1
  21. package/dist/components/List/List.d.ts.map +1 -1
  22. package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts +2 -0
  23. package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
  24. package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts +1 -11
  25. package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts.map +1 -1
  26. package/dist/components/index.d.ts +1 -1
  27. package/dist/components/index.d.ts.map +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.es.js +3 -3
  31. package/dist/index.es.js.map +1 -1
  32. package/dist/index.js +3 -3
  33. package/dist/index.js.map +1 -1
  34. package/dist/initialize.d.ts +7 -4
  35. package/dist/initialize.d.ts.map +1 -1
  36. package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts +9 -0
  37. package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts.map +1 -0
  38. package/dist/utils/ErrorMapper/ErrorMapper.d.ts +15 -0
  39. package/dist/utils/ErrorMapper/ErrorMapper.d.ts.map +1 -0
  40. package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts +11 -0
  41. package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts.map +1 -0
  42. package/dist/utils/ErrorMapper/index.d.ts +4 -0
  43. package/dist/utils/ErrorMapper/index.d.ts.map +1 -0
  44. package/dist/utils/ErrorTypeToStationError.d.ts +1 -1
  45. package/dist/utils/ErrorTypeToStationError.d.ts.map +1 -1
  46. package/package.json +3 -3
  47. package/src/components/Accordion/Accordion.scss +1 -1
  48. package/src/components/Accordion/AccordionItem/AccordionItem.scss +1 -1
  49. package/src/components/Actions/Action/Action.scss +0 -2
  50. package/src/components/Actions/Actions.models.ts +0 -14
  51. package/src/components/Actions/Actions.stories.tsx +4 -1
  52. package/src/components/Buttons/Button/Button.scss +66 -20
  53. package/src/components/Buttons/CompositeButton/CompositeButton.scss +50 -18
  54. package/src/components/Buttons/TextButton/TextButton.scss +45 -16
  55. package/src/components/DateTime/DatePicker/DatePicker.scss +15 -6
  56. package/src/components/DateTime/DateTimePicker.scss +6 -2
  57. package/src/components/DynamicDataList/DynamicDataList.tsx +1 -0
  58. package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.scss +15 -5
  59. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.tsx +1 -1
  60. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.scss +36 -12
  61. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.tsx +2 -2
  62. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +26 -0
  63. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.tsx +7 -1
  64. package/src/components/Filters/Filter/Filter.scss +8 -2
  65. package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.scss +4 -1
  66. package/src/components/FormElements/Checkbox/Checkbox.scss +20 -0
  67. package/src/components/FormElements/CustomTags/CustomTags.scss +24 -0
  68. package/src/components/FormElements/CustomTags/CustomTags.tsx +8 -2
  69. package/src/components/FormElements/DateTimeField/DateTimeText.spec.tsx +1 -1
  70. package/src/components/FormElements/DateTimeField/DateTimeText.tsx +1 -1
  71. package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +4 -2
  72. package/src/components/FormElements/FileUploadControl/FileUploadControl.tsx +12 -3
  73. package/src/components/FormElements/Radio/Radio.scss +18 -3
  74. package/src/components/FormElements/Radio/Radio.tsx +2 -2
  75. package/src/components/FormElements/Select/Select.scss +10 -0
  76. package/src/components/FormElements/SingleLineText/SingleLineText.spec.tsx +2 -2
  77. package/src/components/FormElements/SingleLineText/SingleLineText.tsx +1 -1
  78. package/src/components/FormElements/Tags/Tags.scss +14 -0
  79. package/src/components/FormElements/Tags/Tags.tsx +5 -1
  80. package/src/components/FormElements/TextArea/TextArea.spec.tsx +2 -2
  81. package/src/components/FormElements/TextArea/TextArea.tsx +1 -1
  82. package/src/components/FormElements/formStoryHelper.tsx +163 -97
  83. package/src/components/FormStation/FormStation.spec.tsx +13 -3
  84. package/src/components/FormStation/FormStation.tsx +43 -19
  85. package/src/components/FormStation/SaveOnNavigate/SaveOnNavigate.tsx +5 -0
  86. package/src/components/FormStation/SaveOnNavigate/handleNavigationAttempt.spec.ts +21 -0
  87. package/src/components/FormStation/SaveOnNavigate/handleNavigationAttempt.ts +2 -0
  88. package/src/components/FormStation/StationErrorStateType.tsx +5 -0
  89. package/src/components/FormStation/useValidationError.tsx +59 -0
  90. package/src/components/InfoPanel/InfoImage/InfoImage.scss +8 -3
  91. package/src/components/InfoPanel/InfoImage/InfoImage.tsx +1 -0
  92. package/src/components/List/List.tsx +3 -1
  93. package/src/components/List/ListCheckBox/ListCheckBox.scss +8 -3
  94. package/src/components/List/ListRow/ListRow.scss +0 -4
  95. package/src/components/Loaders/ImageLoader/ImageLoader.scss +27 -21
  96. package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +8 -12
  97. package/src/components/Loaders/ImageLoader/ImageLoader.tsx +8 -3
  98. package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.model.ts +0 -10
  99. package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.scss +0 -1
  100. package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.stories.tsx +5 -0
  101. package/src/components/index.ts +1 -1
  102. package/src/index.ts +1 -0
  103. package/src/initialize.ts +15 -12
  104. package/src/styles/variables.scss +32 -2
  105. package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.spec.ts +32 -0
  106. package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.tsx +33 -0
  107. package/src/utils/ErrorMapper/ErrorMapper.spec.ts +67 -0
  108. package/src/utils/ErrorMapper/ErrorMapper.ts +31 -0
  109. package/src/utils/ErrorMapper/ErrorMapper.type.ts +11 -0
  110. package/src/utils/ErrorMapper/index.ts +3 -0
  111. package/src/utils/ErrorTypeToStationError.spec.tsx +12 -0
  112. package/src/utils/ErrorTypeToStationError.tsx +5 -1
@@ -20,6 +20,7 @@ describe('handleNavigationAttempt', () => {
20
20
  const isSubmitting = false;
21
21
  const canSubmit = true;
22
22
  const setCanSubmit = jest.fn();
23
+ const onNavigationCancelled = jest.fn();
23
24
 
24
25
  // Act
25
26
  await handleNavigationAttempt(
@@ -30,6 +31,7 @@ describe('handleNavigationAttempt', () => {
30
31
  isSubmitting,
31
32
  canSubmit,
32
33
  setCanSubmit,
34
+ onNavigationCancelled,
33
35
  );
34
36
 
35
37
  // Assert
@@ -38,6 +40,7 @@ describe('handleNavigationAttempt', () => {
38
40
  expect(navigation.cancel).not.toHaveBeenCalled();
39
41
  expect(submitForm).not.toHaveBeenCalled();
40
42
  expect(setCanSubmit).not.toHaveBeenCalled();
43
+ expect(onNavigationCancelled).not.toHaveBeenCalled();
41
44
  });
42
45
 
43
46
  it(`blocks navigation when 'isValid' is 'false' by calling 'navigation.cancel()'`, async () => {
@@ -48,6 +51,7 @@ describe('handleNavigationAttempt', () => {
48
51
  const isSubmitting = false;
49
52
  const canSubmit = true;
50
53
  const setCanSubmit = jest.fn();
54
+ const onNavigationCancelled = jest.fn();
51
55
 
52
56
  // Act
53
57
  await handleNavigationAttempt(
@@ -58,6 +62,7 @@ describe('handleNavigationAttempt', () => {
58
62
  isSubmitting,
59
63
  canSubmit,
60
64
  setCanSubmit,
65
+ onNavigationCancelled,
61
66
  );
62
67
 
63
68
  // Assert
@@ -66,6 +71,7 @@ describe('handleNavigationAttempt', () => {
66
71
  expect(navigation.cancel).toHaveBeenCalledTimes(1);
67
72
  expect(submitForm).not.toHaveBeenCalled();
68
73
  expect(setCanSubmit).not.toHaveBeenCalled();
74
+ expect(onNavigationCancelled).toHaveBeenCalled();
69
75
  });
70
76
 
71
77
  it(`pauses further navigation when 'dirty' is 'true' and 'isValid' is 'true' by calling 'navigation.pause()'`, async () => {
@@ -76,6 +82,7 @@ describe('handleNavigationAttempt', () => {
76
82
  const isSubmitting = true;
77
83
  const canSubmit = true;
78
84
  const setCanSubmit = jest.fn();
85
+ const onNavigationCancelled = jest.fn();
79
86
 
80
87
  // Act
81
88
  await handleNavigationAttempt(
@@ -86,6 +93,7 @@ describe('handleNavigationAttempt', () => {
86
93
  isSubmitting,
87
94
  canSubmit,
88
95
  setCanSubmit,
96
+ onNavigationCancelled,
89
97
  );
90
98
 
91
99
  // Assert
@@ -94,6 +102,7 @@ describe('handleNavigationAttempt', () => {
94
102
  expect(navigation.cancel).not.toHaveBeenCalled();
95
103
  expect(submitForm).not.toHaveBeenCalled();
96
104
  expect(setCanSubmit).not.toHaveBeenCalled();
105
+ expect(onNavigationCancelled).not.toHaveBeenCalled();
97
106
  });
98
107
 
99
108
  it(`while 'isSubmitting' is 'true' navigation should continue to be paused by not calling 'navigation.resume()'`, async () => {
@@ -104,6 +113,7 @@ describe('handleNavigationAttempt', () => {
104
113
  const isSubmitting = true;
105
114
  const canSubmit = true;
106
115
  const setCanSubmit = jest.fn();
116
+ const onNavigationCancelled = jest.fn();
107
117
 
108
118
  // Act
109
119
  await handleNavigationAttempt(
@@ -114,6 +124,7 @@ describe('handleNavigationAttempt', () => {
114
124
  isSubmitting,
115
125
  canSubmit,
116
126
  setCanSubmit,
127
+ onNavigationCancelled,
117
128
  );
118
129
 
119
130
  // Assert
@@ -122,6 +133,7 @@ describe('handleNavigationAttempt', () => {
122
133
  expect(navigation.cancel).not.toHaveBeenCalled();
123
134
  expect(submitForm).not.toHaveBeenCalled();
124
135
  expect(setCanSubmit).not.toHaveBeenCalled();
136
+ expect(onNavigationCancelled).not.toHaveBeenCalled();
125
137
  });
126
138
 
127
139
  it(`while 'canSubmit' is 'false' navigation should continue to be paused by not calling 'navigation.resume()'`, async () => {
@@ -132,6 +144,7 @@ describe('handleNavigationAttempt', () => {
132
144
  const isSubmitting = false;
133
145
  const canSubmit = false;
134
146
  const setCanSubmit = jest.fn();
147
+ const onNavigationCancelled = jest.fn();
135
148
 
136
149
  // Act
137
150
  await handleNavigationAttempt(
@@ -142,6 +155,7 @@ describe('handleNavigationAttempt', () => {
142
155
  isSubmitting,
143
156
  canSubmit,
144
157
  setCanSubmit,
158
+ onNavigationCancelled,
145
159
  );
146
160
 
147
161
  // Assert
@@ -150,6 +164,7 @@ describe('handleNavigationAttempt', () => {
150
164
  expect(navigation.cancel).not.toHaveBeenCalled();
151
165
  expect(submitForm).not.toHaveBeenCalled();
152
166
  expect(setCanSubmit).not.toHaveBeenCalled();
167
+ expect(onNavigationCancelled).not.toHaveBeenCalled();
153
168
  });
154
169
 
155
170
  it(`navigation can resume after the submitForm promise was successfully resolved by calling 'navigation.resume()'`, async () => {
@@ -160,6 +175,7 @@ describe('handleNavigationAttempt', () => {
160
175
  const isSubmitting = false;
161
176
  const canSubmit = true;
162
177
  const setCanSubmit = jest.fn();
178
+ const onNavigationCancelled = jest.fn();
163
179
 
164
180
  // Act
165
181
  await handleNavigationAttempt(
@@ -170,6 +186,7 @@ describe('handleNavigationAttempt', () => {
170
186
  isSubmitting,
171
187
  canSubmit,
172
188
  setCanSubmit,
189
+ onNavigationCancelled,
173
190
  );
174
191
 
175
192
  // Assert
@@ -179,6 +196,7 @@ describe('handleNavigationAttempt', () => {
179
196
  expect(submitForm).toHaveBeenCalledTimes(1);
180
197
  expect(setCanSubmit).toHaveBeenCalledTimes(1);
181
198
  expect(setCanSubmit).toHaveBeenCalledWith(false);
199
+ expect(onNavigationCancelled).not.toHaveBeenCalledWith(false);
182
200
  });
183
201
 
184
202
  it(`navigation is cancelled when the 'submitForm' promise was rejected by calling 'navigation.cancel()'`, async () => {
@@ -191,6 +209,7 @@ describe('handleNavigationAttempt', () => {
191
209
  const isSubmitting = false;
192
210
  const canSubmit = true;
193
211
  const setCanSubmit = jest.fn();
212
+ const onNavigationCancelled = jest.fn();
194
213
 
195
214
  // Act
196
215
  await handleNavigationAttempt(
@@ -201,6 +220,7 @@ describe('handleNavigationAttempt', () => {
201
220
  isSubmitting,
202
221
  canSubmit,
203
222
  setCanSubmit,
223
+ onNavigationCancelled,
204
224
  );
205
225
 
206
226
  // Assert
@@ -211,5 +231,6 @@ describe('handleNavigationAttempt', () => {
211
231
  expect(setCanSubmit).toHaveBeenCalledTimes(2);
212
232
  expect(setCanSubmit).toHaveBeenNthCalledWith(1, false);
213
233
  expect(setCanSubmit).toHaveBeenNthCalledWith(2, true);
234
+ expect(onNavigationCancelled).not.toHaveBeenCalled();
214
235
  });
215
236
  });
@@ -10,6 +10,7 @@ export const handleNavigationAttempt = async (
10
10
  isSubmitting: boolean,
11
11
  canSubmit: boolean,
12
12
  setCanSubmit: React.Dispatch<React.SetStateAction<boolean>>,
13
+ onNavigationCancelled: () => void,
13
14
  ): Promise<void> => {
14
15
  if (!dirty) {
15
16
  // Form values didn't change, just navigate away
@@ -20,6 +21,7 @@ export const handleNavigationAttempt = async (
20
21
  // Form is invalid, cancel navigation
21
22
  // TODO: Add a message here (probably connected to "Error handling")
22
23
  navigation.cancel();
24
+ onNavigationCancelled();
23
25
  return;
24
26
  }
25
27
  // Form values have changed and form is valid, attempt save
@@ -0,0 +1,5 @@
1
+ import { StationError } from '../models';
2
+
3
+ export interface StationErrorStateType extends StationError {
4
+ type?: string;
5
+ }
@@ -0,0 +1,59 @@
1
+ import { useFormikContext } from 'formik';
2
+ import React, { useCallback, useEffect, useState } from 'react';
3
+ import { StationErrorStateType } from './StationErrorStateType';
4
+
5
+ /**
6
+ * Component that watches for changes in the form validation state
7
+ * and calls the callback with the current state.
8
+ */
9
+ const ValidationWatcher: React.FC<{
10
+ callback: (isValid: boolean) => void;
11
+ }> = ({ callback: isValid }) => {
12
+ const formik = useFormikContext();
13
+ useEffect(() => {
14
+ isValid(formik.isValid);
15
+ }, [formik.isValid, isValid]);
16
+ return null;
17
+ };
18
+ /**
19
+ * Cares for showing (and removing) validation errors.
20
+ * @param stationError the currently showing error
21
+ * @param setStationError the setter for the currently showing error
22
+ * @returns
23
+ * `setValidationError` - call this method to set the validation error.
24
+ * `validationWatcher` - place this JSX somewhere inside the <Formik /> component children.
25
+ */
26
+ export function useValidationError(
27
+ stationError: StationErrorStateType | undefined,
28
+ setStationError: React.Dispatch<
29
+ React.SetStateAction<StationErrorStateType | undefined>
30
+ >,
31
+ ): {
32
+ setValidationError: () => void;
33
+ validationWatcher: JSX.Element;
34
+ } {
35
+ // Track validation state of the from using the validationWatcher
36
+ const [isValid, setIsValid] = useState<boolean>(true);
37
+
38
+ useEffect(() => {
39
+ // if the form became valid, remove the validation error
40
+ if (isValid && stationError && stationError.type === 'validation') {
41
+ setStationError(undefined);
42
+ }
43
+ }, [isValid, setStationError, stationError]);
44
+
45
+ const setValidationError = useCallback((): void => {
46
+ // set the validation error
47
+ setStationError({
48
+ title: 'Please fix the errors in the form to proceed.',
49
+ type: 'validation',
50
+ });
51
+ }, [setStationError]);
52
+
53
+ return {
54
+ setValidationError,
55
+ validationWatcher: (
56
+ <ValidationWatcher callback={(valid) => setIsValid(valid)} />
57
+ ),
58
+ };
59
+ }
@@ -9,10 +9,15 @@
9
9
 
10
10
  place-items: center;
11
11
 
12
+ .image,
12
13
  .inlineMenu {
13
- position: absolute;
14
- bottom: 0;
15
- right: 0;
14
+ grid-row: 1;
15
+ grid-column: 1;
16
+ align-self: end;
17
+ }
18
+
19
+ .inlineMenu {
20
+ justify-self: end;
16
21
  }
17
22
 
18
23
  img {
@@ -36,6 +36,7 @@ export const InfoImage: React.FC<InfoImageProps> = ({
36
36
  data-test-id="info-image"
37
37
  >
38
38
  <ImageLoader
39
+ imageClassName={classes.image}
39
40
  imgSrc={imgSrc}
40
41
  height={420}
41
42
  width={419} /*1px border*/
@@ -320,7 +320,9 @@ export const List = <T extends Data>({
320
320
  horizontalTextAlign={horizontalTextAlign}
321
321
  verticalTextAlign={verticalTextAlign}
322
322
  showItemCheckbox={
323
- enableSelectAll && selectionMode === ListSelectMode.Multi
323
+ enableSelectAll &&
324
+ selectionMode === ListSelectMode.Multi &&
325
+ listItems.length > 0
324
326
  }
325
327
  isCheckboxDisabled={listItems.length === 0}
326
328
  onCheckboxToggled={headerCheckboxHandler}
@@ -9,8 +9,13 @@
9
9
 
10
10
  .disabled {
11
11
  background-color: var(
12
- --page-header-action-context-background-color,
13
- $page-header-action-context-background-color
14
- ) !important;
12
+ --actions-disabled-bg-color,
13
+ $actions-disabled-bg-color
14
+ );
15
+
16
+ // background-color: var(
17
+ // --page-header-action-context-background-color,
18
+ // $page-header-action-context-background-color
19
+ // ) !important;
15
20
  }
16
21
  }
@@ -30,10 +30,6 @@
30
30
  }
31
31
  }
32
32
 
33
- &.disabled {
34
- cursor: not-allowed;
35
- }
36
-
37
33
  .cell {
38
34
  white-space: nowrap;
39
35
  text-overflow: ellipsis;
@@ -1,29 +1,35 @@
1
1
  @import '../../../styles/common.scss';
2
2
 
3
3
  .container {
4
- @include boxSizing;
5
-
6
- width: 50px;
7
- height: 50px;
8
4
  display: grid;
9
- grid-template-columns: 1fr;
10
- grid-template-rows: 1fr;
11
- place-items: center;
12
- }
5
+ grid: 1fr / 1fr;
13
6
 
14
- .fallback {
15
- background-color: var(--fallback-image-bg-color, $fallback-image-bg-color);
16
- }
7
+ .loader {
8
+ @include boxSizing;
17
9
 
18
- .fallBackImage {
19
- height: 50px;
20
- width: 50px;
21
- align-self: center;
22
- }
10
+ width: 50px;
11
+ height: 50px;
12
+ display: grid;
13
+ grid: 1fr / 1fr;
14
+ place-items: center;
15
+ }
16
+
17
+ .imageContainer {
18
+ display: grid;
19
+ grid: 1fr / 1fr;
20
+ place-items: center;
21
+
22
+ .fallback {
23
+ background-color: var(
24
+ --fallback-image-bg-color,
25
+ $fallback-image-bg-color
26
+ );
27
+ }
23
28
 
24
- .imageContainer {
25
- position: relative;
26
- display: flex;
27
- height: 100%;
28
- width: fit-content;
29
+ .fallBackImage {
30
+ height: 50px;
31
+ width: 50px;
32
+ align-self: center;
33
+ }
34
+ }
29
35
  }
@@ -99,7 +99,7 @@ describe('ImageLoader', () => {
99
99
 
100
100
  const loader = wrapper.find(ContentLoader);
101
101
  const imgDisplay = wrapper.find('img').prop('style')?.display;
102
- const fallbackContainer = wrapper.find('.container');
102
+ const fallbackContainer = wrapper.find('.container').at(1);
103
103
 
104
104
  expect(loader.exists()).toBe(false);
105
105
  expect(imgDisplay).toBe('none');
@@ -116,7 +116,7 @@ describe('ImageLoader', () => {
116
116
 
117
117
  const loader = wrapper.find(ContentLoader);
118
118
  const images = wrapper.find('img');
119
- const fallbackContainer = wrapper.find('.container');
119
+ const fallbackContainer = wrapper.find('.container').at(1);
120
120
 
121
121
  expect(loader.exists()).toBe(false);
122
122
  expect(images.at(0).prop('style')?.display).toBe('none'); // hidden failed image
@@ -198,12 +198,10 @@ describe('ImageLoader', () => {
198
198
  it(`loader dimensions defaults to '50px' by '50px'`, () => {
199
199
  const wrapper = shallow(<ImageLoader imgSrc="" />);
200
200
 
201
- const container = wrapper
202
- .find('.container')
203
- .prop('style') as React.CSSProperties;
201
+ const loader = wrapper.find('.loader').prop('style') as React.CSSProperties;
204
202
 
205
- expect(container.height).toBe('50px');
206
- expect(container.width).toBe('50px');
203
+ expect(loader.height).toBe('50px');
204
+ expect(loader.width).toBe('50px');
207
205
  });
208
206
 
209
207
  it('sets the height and width of the loader', () => {
@@ -213,11 +211,9 @@ describe('ImageLoader', () => {
213
211
  <ImageLoader imgSrc="" height={mockHeight} width={mockWidth} />,
214
212
  );
215
213
 
216
- const container = wrapper
217
- .find('.container')
218
- .prop('style') as React.CSSProperties;
214
+ const loader = wrapper.find('.loader').prop('style') as React.CSSProperties;
219
215
 
220
- expect(container.height).toBe(`${mockHeight}px`);
221
- expect(container.width).toBe(`${mockWidth}px`);
216
+ expect(loader.height).toBe(`${mockHeight}px`);
217
+ expect(loader.width).toBe(`${mockWidth}px`);
222
218
  });
223
219
  });
@@ -40,6 +40,9 @@ export interface ImageLoaderProps {
40
40
  onImageClick?: (
41
41
  event: React.MouseEvent<HTMLImageElement, MouseEvent>,
42
42
  ) => void;
43
+
44
+ /** CSS Class name for additional img element styles */
45
+ imageClassName?: string;
43
46
  }
44
47
 
45
48
  /**
@@ -65,6 +68,7 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
65
68
  onError = noop,
66
69
  onImageClick = noop,
67
70
  children,
71
+ imageClassName = '',
68
72
  }) => {
69
73
  const actualViewBox = viewBox || `0 0 ${width} ${height}`;
70
74
 
@@ -106,9 +110,9 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
106
110
  }, [imgSrc, onError]);
107
111
 
108
112
  return (
109
- <>
113
+ <div className={classes.container}>
110
114
  {isLoading && (
111
- <div className={classes.container} style={customStyles}>
115
+ <div className={classes.loader} style={customStyles}>
112
116
  <ContentLoader
113
117
  speed={speed}
114
118
  backgroundColor={backgroundColor}
@@ -135,6 +139,7 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
135
139
  onError={onErrorHandler}
136
140
  onClick={onImageClick}
137
141
  data-test-id="image-loader-img"
142
+ className={imageClassName}
138
143
  />
139
144
  {fallBack &&
140
145
  (!fallbackSrc ? (
@@ -153,6 +158,6 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
153
158
  {!isLoading && !fallBack && children}
154
159
  </div>
155
160
  )}
156
- </>
161
+ </div>
157
162
  );
158
163
  };
@@ -5,14 +5,6 @@ import { ConfirmAction, DefaultHandler, LinkAction } from '../../models';
5
5
  export enum PageHeaderActionType {
6
6
  Active,
7
7
  Context,
8
- /**
9
- * @deprecated This value is no longer necessary for navigation type actions in the
10
- * `PageHeaderAction` component, and will be removed in the future.
11
- * To create a navigation link, use the `path` property instead of the `onClick` handler,
12
- * which will automatically generate an anchor element.
13
- * @note This deprecation only affects the `Navigation` enum value in the PageHeaderActionType
14
- */
15
- Navigation,
16
8
  }
17
9
 
18
10
  export type PageHeaderActionProps =
@@ -27,8 +19,6 @@ export interface PageHeaderJsActionProps
27
19
  /**
28
20
  * Whether the action is an 'Active' or 'Context' type.
29
21
  * Changes the background color to the corresponding action type. (default: 'Context')
30
- * Type `Navigation` is deprecated and will be removed in the future
31
- * define instead of `onClick` handler `path` property to render element with anchor tag
32
22
  */
33
23
  actionType?: PageHeaderActionType;
34
24
  }
@@ -145,7 +145,6 @@
145
145
  --actions-disabled-bg-color,
146
146
  $actions-disabled-bg-color
147
147
  );
148
- cursor: not-allowed;
149
148
 
150
149
  .pageHeaderActionsIcons {
151
150
  polygon,
@@ -25,6 +25,11 @@ const meta: Meta<typeof PageHeaderAction> = {
25
25
  },
26
26
  options: iconOptions,
27
27
  },
28
+ path: {
29
+ control: {
30
+ type: 'text',
31
+ },
32
+ },
28
33
  },
29
34
  decorators: [
30
35
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
@@ -19,8 +19,8 @@ export * from './List';
19
19
  export * from './Loaders';
20
20
  export * from './MessageBar';
21
21
  export * from './Modal';
22
- export * from './models';
23
22
  export * from './NavigationAwareStation';
24
23
  export * from './PageHeader';
25
24
  export * from './ProgressBar';
26
25
  export * from './Utils';
26
+ export * from './models';
package/src/index.ts CHANGED
@@ -4,5 +4,6 @@ export * from './helpers';
4
4
  export * from './hooks';
5
5
  export * from './initialize';
6
6
  export * from './types';
7
+ export * from './utils/ErrorMapper';
7
8
  export { ErrorTypeToStationError } from './utils/ErrorTypeToStationError';
8
9
  export * from './validators';
package/src/initialize.ts CHANGED
@@ -5,6 +5,12 @@ import {
5
5
  ShowNotification,
6
6
  } from './types/ui-config';
7
7
 
8
+ export enum IndicatorType {
9
+ Saving = 'saving',
10
+ Inactive = 'inactive',
11
+ Dirty = 'dirty',
12
+ }
13
+
8
14
  export let showNotification: ShowNotification | (() => void) =
9
15
  polyfill('showNotification');
10
16
 
@@ -15,9 +21,8 @@ export let removeIndicator: RemoveIndicator | (() => void) =
15
21
 
16
22
  export let on: CustomEventEmitter['on'] | (() => void) = polyfill('on');
17
23
 
18
- export let showSaveIndicator: () => void = polyfill('showSaveIndicator');
19
-
20
- export let hideSaveIndicator: () => void = polyfill('hideSaveIndicator');
24
+ export let setSaveIndicator: (type: IndicatorType) => void =
25
+ polyfill('showSaveIndicator');
21
26
 
22
27
  /**
23
28
  * Passes the PiralApi methods to the UI library.
@@ -25,12 +30,11 @@ export let hideSaveIndicator: () => void = polyfill('hideSaveIndicator');
25
30
  */
26
31
  export function initializeUi(app: UiConfig): void {
27
32
  ({
28
- showNotification,
29
- addIndicator,
30
- removeIndicator,
31
- on,
32
- showSaveIndicator,
33
- hideSaveIndicator,
33
+ showNotification = polyfill('showNotification'),
34
+ addIndicator = polyfill('addIndicator'),
35
+ removeIndicator = polyfill('removeIndicator'),
36
+ on = polyfill('on'),
37
+ setSaveIndicator = polyfill('setSaveIndicator'),
34
38
  } = app);
35
39
  }
36
40
 
@@ -39,15 +43,14 @@ export interface UiConfig {
39
43
  addIndicator: AddIndicator;
40
44
  removeIndicator: RemoveIndicator;
41
45
  on: CustomEventEmitter['on'];
42
- showSaveIndicator: () => void;
43
- hideSaveIndicator: () => void;
46
+ setSaveIndicator: (type: IndicatorType) => void;
44
47
  }
45
48
 
46
49
  function polyfill(methodName: string): () => void {
47
50
  return () => {
48
51
  // eslint-disable-next-line no-console
49
52
  console.warn(
50
- `Could not find ${methodName} method. Is the UI initialized in the pilet? To initialize UI library call 'initializeUi(app)' in your pilet.`,
53
+ `Could not find '${methodName}' method. Is the UI initialized in the pilet? To initialize UI library call 'initializeUi(app)' in your pilet.`,
51
54
  );
52
55
  };
53
56
  }
@@ -41,6 +41,7 @@ $accordion-item-background-color: white;
41
41
  $accordion-item-text-color: $dark-gray;
42
42
  $accordion-item-hover-color: rgba($blue, 0.15);
43
43
  $accordion-item-border: 1px solid $light-gray;
44
+ $accordion-item-arrow-color: $blue;
44
45
 
45
46
  /* Explorer vars */
46
47
  $explorer-background-color: #ffffff;
@@ -65,7 +66,7 @@ $filter-background-color: white;
65
66
  $filter-background-selected-color: rgba($blue, 0.15);
66
67
  $filter-light-font-color: $dark-gray;
67
68
  $filter-option-background-color: #d7e9f1;
68
- $filter-arrow-button-color: $blue;
69
+ $filter-context-button-color: $blue;
69
70
  $filter-title-color: $blue;
70
71
  $filter-font-size: 16px;
71
72
  $filter-width: 360px;
@@ -184,7 +185,7 @@ $tag-font-color: $dark-gray;
184
185
  $tag-background-color: $light-gray-2;
185
186
  $form-error-color: $red;
186
187
  $select-arrow-color: $blue;
187
- $select-disabled-arrow-color: $light-gray;
188
+ $select-disabled-arrow-color: $gray;
188
189
  $label-font-size: 16px;
189
190
  $file-upload-progress: $blue;
190
191
  $file-upload-progress-background: $light-gray-2;
@@ -198,6 +199,16 @@ $form-element-min-height: 50px;
198
199
  $read-only-text-background-color: $light-gray-2;
199
200
  $select-background-color: white;
200
201
  $form-indicator-color: $green;
202
+ $radio-hover-stroke-color: $blue;
203
+ $radio-checked-fill-color: $blue;
204
+
205
+ /* Date Time Picker*/
206
+ $calendar-tile-active: $blue;
207
+ $calendar-tile-active-hover: rgba($blue, 0.2);
208
+ $calendar-button-stroke-color: $blue;
209
+ $calendar-title-color: $dark-blue;
210
+ $calendar-container-border-color: $blue;
211
+ $calendar-container-bg-color: $blue;
201
212
 
202
213
  /* Dynamic Data List */
203
214
  $dynamic-list-row-bg-color: white;
@@ -271,3 +282,22 @@ $infotooltip-font-size: 16px;
271
282
  /* Video Player */
272
283
  $video-player-controls-background: $light-gray-2;
273
284
  $video-player-controls-text-color: $dark-gray;
285
+
286
+ /* Buttons */
287
+ $navigation-button-background-color: $light-blue;
288
+ $navigation-button-background-color-hover: rgba($light-blue, 0.9);
289
+ $navigation-button-stroke-color: white;
290
+ $navigation-button-background-active-color: white;
291
+ $navigation-button-stroke-active-color: $light-blue;
292
+ $navigation-button-background-disabled-color: $gray;
293
+ $active-button-background-color: $blue;
294
+ $active-button-hover-background-color: rgba($blue, 0.9);
295
+ $active-button-stroke-background-color: white;
296
+ $active-button-active-background-color: white;
297
+ $active-button-active-stroke-color: $blue;
298
+ $context-button-border-color: $blue;
299
+ $context-button-stroke-color: $blue;
300
+ $context-button-hover-border-color: $blue;
301
+ $context-button-active-color: $blue;
302
+ $icon-button-stroke-color: $blue;
303
+ $icon-button-hover-color: $blue;