@aarhus-university/au-lib-react-components 10.6.0 → 10.7.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 (97) hide show
  1. package/.eslintrc.js +34 -34
  2. package/.storybook/main.js +20 -7
  3. package/.storybook/preview.js +10 -10
  4. package/README.md +19 -19
  5. package/__tests__/jest/AUButtonComponent.test.tsx +165 -163
  6. package/__tests__/jest/AUModalComponent.test.tsx +116 -0
  7. package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -57
  8. package/__tests__/jest/AUToolbarComponent.test.tsx +46 -0
  9. package/__tests__/jest/helpers.test.ts +15 -15
  10. package/__tests__/jest/setupTests.ts +2 -2
  11. package/babel.config.js +8 -8
  12. package/build/umd/all.css +2 -2
  13. package/build/umd/all.js +1 -1
  14. package/build/umd/alphabox.js +1 -1
  15. package/build/umd/databox.js +1 -1
  16. package/build/umd/diagramme.js +1 -1
  17. package/build/umd/flowbox.js +1 -1
  18. package/build/umd/universe.js +1 -1
  19. package/package.json +107 -107
  20. package/src/components/AUAlertComponent.tsx +70 -70
  21. package/src/components/AUAutoSuggestComponent.js +158 -158
  22. package/src/components/AUButtonComponent.tsx +83 -77
  23. package/src/components/AUCalendarComponent.tsx +493 -493
  24. package/src/components/AUContentToggleComponent.tsx +33 -33
  25. package/src/components/AUDatepickerComponent.tsx +117 -117
  26. package/src/components/AUMobilePrefixComponent.tsx +15 -15
  27. package/src/components/AUModalComponent.tsx +64 -80
  28. package/src/components/AUReceiptComponent.tsx +33 -33
  29. package/src/components/AUSpinnerComponent.tsx +33 -33
  30. package/src/components/AUSubNavComponent.tsx +48 -48
  31. package/src/components/AUSubmitButtonContainerComponent.tsx +31 -31
  32. package/src/components/AUTabbedContentComponent.tsx +145 -145
  33. package/src/components/AUTableComponent.tsx +24 -24
  34. package/src/components/AUToastComponent.tsx +103 -103
  35. package/src/components/AUToolbarComponent.tsx +52 -45
  36. package/src/components/profile/AUProfileActions.js +128 -128
  37. package/src/components/profile/AUProfileAvatarComponent.js +83 -83
  38. package/src/components/profile/AUProfileAvatarV2Component.js +91 -91
  39. package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -42
  40. package/src/components/profile/AUProfileContainerComponent.js +283 -283
  41. package/src/components/profile/AUProfileHooks.js +30 -30
  42. package/src/components/profile/AUProfileItemComponent.js +54 -54
  43. package/src/components/profile/AUProfileLanguageComponent.js +131 -131
  44. package/src/components/profile/AUProfileLoginComponent.tsx +26 -26
  45. package/src/components/profile/AUProfileMailComponent.js +307 -307
  46. package/src/components/profile/AUProfileMobileComponent.js +164 -164
  47. package/src/components/profile/AUProfileNameComponent.js +253 -253
  48. package/src/components/profile/AUProfileNextOfKinComponent.js +216 -216
  49. package/src/components/profile/AUProfileReducer.js +230 -230
  50. package/src/components/profile/AUProfileWidgetComponent.js +95 -95
  51. package/src/components/profile/AUProfileWidgetV2Component.js +116 -116
  52. package/src/components/profile/AUProfileWidgetV3Component.tsx +122 -122
  53. package/src/components/wrapping/AUEmbedComponent.js +47 -47
  54. package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
  55. package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
  56. package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
  57. package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
  58. package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
  59. package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
  60. package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
  61. package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
  62. package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
  63. package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
  64. package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
  65. package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
  66. package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
  67. package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
  68. package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
  69. package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
  70. package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
  71. package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
  72. package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
  73. package/src/layout-2016/lib/all.js +3 -3
  74. package/src/layout-2016/lib/au-alphabox.js +100 -100
  75. package/src/layout-2016/lib/au-databox.js +400 -400
  76. package/src/layout-2016/lib/au-diagramme.js +85 -85
  77. package/src/layout-2016/lib/au-flowbox.js +93 -93
  78. package/src/layout-2016/lib/universe.js +9 -9
  79. package/src/lib/helpers.ts +194 -194
  80. package/src/lib/hooks.ts +37 -33
  81. package/src/lib/i18n.ts +600 -600
  82. package/src/lib/tracking.ts +69 -69
  83. package/src/lib/wrapping.ts +21 -21
  84. package/src/styles/_settings.scss +10 -10
  85. package/src/styles/alphabox.scss +222 -222
  86. package/src/styles/app.scss +7 -7
  87. package/src/styles/autosuggest.scss +57 -57
  88. package/src/styles/databox.scss +563 -563
  89. package/src/styles/diagramme.scss +119 -119
  90. package/src/styles/flowbox.scss +72 -72
  91. package/src/styles/maps.scss +395 -395
  92. package/stories/AUButtonComponent.stories.tsx +85 -85
  93. package/stories/AUModalComponent.stories.tsx +92 -0
  94. package/stories/AUSpinnerComponent.stories.tsx +41 -41
  95. package/stories/AUToolbarComponent.stories.tsx +96 -0
  96. package/tsconfig.json +46 -46
  97. package/webpack.config.js +89 -89
@@ -1,33 +1,33 @@
1
- import React, {
2
- useEffect,
3
- useRef,
4
- FC,
5
- } from 'react';
6
- import { setContentToggle } from '@aarhus-university/au-designsystem-delphinus/source/js/components/content-toggle';
7
-
8
- const AUContentToggleComponent: FC<AUContentToggleComponentProps> = ({
9
- toggled,
10
- classNames,
11
- children,
12
- }: AUContentToggleComponentProps) => {
13
- const toggleContainer = useRef<HTMLDivElement>(null);
14
- useEffect(() => {
15
- const toggle = toggleContainer?.current?.querySelector('.content-toggle__content');
16
- if (toggle) {
17
- const button = setContentToggle(toggle);
18
- button?.setAttribute('aria-expanded', toggled ? 'true' : 'false');
19
- }
20
- }, []);
21
- return (
22
- <div ref={toggleContainer} className={classNames}>
23
- {children}
24
- </div>
25
- );
26
- };
27
-
28
- AUContentToggleComponent.defaultProps = {
29
- classNames: undefined,
30
- };
31
-
32
- AUContentToggleComponent.displayName = 'AUContentToggleComponent';
33
- export default AUContentToggleComponent;
1
+ import React, {
2
+ useEffect,
3
+ useRef,
4
+ FC,
5
+ } from 'react';
6
+ import { setContentToggle } from '@aarhus-university/au-designsystem-delphinus/source/js/components/content-toggle';
7
+
8
+ const AUContentToggleComponent: FC<AUContentToggleComponentProps> = ({
9
+ toggled,
10
+ classNames,
11
+ children,
12
+ }: AUContentToggleComponentProps) => {
13
+ const toggleContainer = useRef<HTMLDivElement>(null);
14
+ useEffect(() => {
15
+ const toggle = toggleContainer?.current?.querySelector('.content-toggle__content');
16
+ if (toggle) {
17
+ const button = setContentToggle(toggle);
18
+ button?.setAttribute('aria-expanded', toggled ? 'true' : 'false');
19
+ }
20
+ }, []);
21
+ return (
22
+ <div ref={toggleContainer} className={classNames}>
23
+ {children}
24
+ </div>
25
+ );
26
+ };
27
+
28
+ AUContentToggleComponent.defaultProps = {
29
+ classNames: undefined,
30
+ };
31
+
32
+ AUContentToggleComponent.displayName = 'AUContentToggleComponent';
33
+ export default AUContentToggleComponent;
@@ -1,117 +1,117 @@
1
- /* eslint-env browser */
2
- import React, { FC, useState } from 'react';
3
- import dayjs from 'dayjs';
4
- import AUCalendarComponent from './AUCalendarComponent';
5
-
6
- const AUDatepickerComponent: FC<AUDatepickerComponentProps> = ({
7
- id,
8
- lang,
9
- date,
10
- onDateChange,
11
- onHide,
12
- format,
13
- showTime,
14
- showLabel,
15
- labelInline,
16
- labelText,
17
- fullWidth,
18
- yearSpanMinus,
19
- yearSpanPlus,
20
- limitStart,
21
- limitEnd,
22
- disabled,
23
- }: AUDatepickerComponentProps) => {
24
- const [showCalendar, setShowCalendar] = useState(false);
25
- const [sDate, setDate] = useState<Date>(date as Date);
26
- const dateFormatted = dayjs(sDate).format(format);
27
-
28
- const hideDatePicker = () => {
29
- setShowCalendar(false);
30
- onHide(sDate, dateFormatted);
31
- };
32
-
33
- let className = 'form__field';
34
- if (fullWidth) {
35
- className = `${className} form__field--full-width`;
36
- }
37
-
38
- if (labelInline) {
39
- className = `${className} form__field--inline-label`;
40
- }
41
-
42
- if (disabled) {
43
- className = `${className} visually-disabled`;
44
- }
45
-
46
- return (
47
- <div
48
- className="datepicker"
49
- aria-owns={`${id}-calendar`}
50
- aria-haspopup="true"
51
- aria-expanded={showCalendar}
52
- >
53
- <div className={className}>
54
- {showLabel && <label htmlFor={id}>{labelText}</label>}
55
- <input
56
- id={id}
57
- type="text"
58
- value={dateFormatted}
59
- title={
60
- lang === 'da'
61
- ? 'Klik for at åbne datovælger'
62
- : 'Click to open datepicker'
63
- }
64
- readOnly
65
- disabled={disabled}
66
- onClick={() => setShowCalendar(!showCalendar)}
67
- />
68
- </div>
69
- {showCalendar && (
70
- <div className="datepicker__calendar-container">
71
- <AUCalendarComponent
72
- key={`${showCalendar}`}
73
- minuteInterval={1}
74
- selected={date}
75
- day={(date as Date).getDate()}
76
- month={(date as Date).getMonth() + 1}
77
- year={(date as Date).getFullYear()}
78
- hour={(date as Date).getHours()}
79
- minute={(date as Date).getMinutes()}
80
- onSelected={(selected) => {
81
- const formatted = dayjs(selected).format(format);
82
- setDate(selected);
83
- onDateChange(selected, formatted);
84
- }}
85
- showTime={showTime}
86
- yearSpanMinus={yearSpanMinus}
87
- yearSpanPlus={yearSpanPlus}
88
- closeable
89
- onClose={hideDatePicker}
90
- controls={id}
91
- limitStart={limitStart}
92
- limitEnd={limitEnd}
93
- />
94
- </div>
95
- )}
96
- </div>
97
- );
98
- };
99
-
100
- AUDatepickerComponent.defaultProps = {
101
- date: new Date(),
102
- format: 'YYYY-MM-DD HH:mm',
103
- showTime: true,
104
- lang: 'da',
105
- showLabel: false,
106
- labelInline: false,
107
- labelText: 'Vælg dato:',
108
- fullWidth: true,
109
- yearSpanMinus: 5,
110
- yearSpanPlus: 5,
111
- limitStart: null,
112
- limitEnd: null,
113
- disabled: false,
114
- };
115
-
116
- AUDatepickerComponent.displayName = 'AUDatepickerComponent';
117
- export default AUDatepickerComponent;
1
+ /* eslint-env browser */
2
+ import React, { FC, useState } from 'react';
3
+ import dayjs from 'dayjs';
4
+ import AUCalendarComponent from './AUCalendarComponent';
5
+
6
+ const AUDatepickerComponent: FC<AUDatepickerComponentProps> = ({
7
+ id,
8
+ lang,
9
+ date,
10
+ onDateChange,
11
+ onHide,
12
+ format,
13
+ showTime,
14
+ showLabel,
15
+ labelInline,
16
+ labelText,
17
+ fullWidth,
18
+ yearSpanMinus,
19
+ yearSpanPlus,
20
+ limitStart,
21
+ limitEnd,
22
+ disabled,
23
+ }: AUDatepickerComponentProps) => {
24
+ const [showCalendar, setShowCalendar] = useState(false);
25
+ const [sDate, setDate] = useState<Date>(date as Date);
26
+ const dateFormatted = dayjs(sDate).format(format);
27
+
28
+ const hideDatePicker = () => {
29
+ setShowCalendar(false);
30
+ onHide(sDate, dateFormatted);
31
+ };
32
+
33
+ let className = 'form__field';
34
+ if (fullWidth) {
35
+ className = `${className} form__field--full-width`;
36
+ }
37
+
38
+ if (labelInline) {
39
+ className = `${className} form__field--inline-label`;
40
+ }
41
+
42
+ if (disabled) {
43
+ className = `${className} visually-disabled`;
44
+ }
45
+
46
+ return (
47
+ <div
48
+ className="datepicker"
49
+ aria-owns={`${id}-calendar`}
50
+ aria-haspopup="true"
51
+ aria-expanded={showCalendar}
52
+ >
53
+ <div className={className}>
54
+ {showLabel && <label htmlFor={id}>{labelText}</label>}
55
+ <input
56
+ id={id}
57
+ type="text"
58
+ value={dateFormatted}
59
+ title={
60
+ lang === 'da'
61
+ ? 'Klik for at åbne datovælger'
62
+ : 'Click to open datepicker'
63
+ }
64
+ readOnly
65
+ disabled={disabled}
66
+ onClick={() => setShowCalendar(!showCalendar)}
67
+ />
68
+ </div>
69
+ {showCalendar && (
70
+ <div className="datepicker__calendar-container">
71
+ <AUCalendarComponent
72
+ key={`${showCalendar}`}
73
+ minuteInterval={1}
74
+ selected={date}
75
+ day={(date as Date).getDate()}
76
+ month={(date as Date).getMonth() + 1}
77
+ year={(date as Date).getFullYear()}
78
+ hour={(date as Date).getHours()}
79
+ minute={(date as Date).getMinutes()}
80
+ onSelected={(selected) => {
81
+ const formatted = dayjs(selected).format(format);
82
+ setDate(selected);
83
+ onDateChange(selected, formatted);
84
+ }}
85
+ showTime={showTime}
86
+ yearSpanMinus={yearSpanMinus}
87
+ yearSpanPlus={yearSpanPlus}
88
+ closeable
89
+ onClose={hideDatePicker}
90
+ controls={id}
91
+ limitStart={limitStart}
92
+ limitEnd={limitEnd}
93
+ />
94
+ </div>
95
+ )}
96
+ </div>
97
+ );
98
+ };
99
+
100
+ AUDatepickerComponent.defaultProps = {
101
+ date: new Date(),
102
+ format: 'YYYY-MM-DD HH:mm',
103
+ showTime: true,
104
+ lang: 'da',
105
+ showLabel: false,
106
+ labelInline: false,
107
+ labelText: 'Vælg dato:',
108
+ fullWidth: true,
109
+ yearSpanMinus: 5,
110
+ yearSpanPlus: 5,
111
+ limitStart: null,
112
+ limitEnd: null,
113
+ disabled: false,
114
+ };
115
+
116
+ AUDatepickerComponent.displayName = 'AUDatepickerComponent';
117
+ export default AUDatepickerComponent;
@@ -1,15 +1,15 @@
1
- import React, { FC } from 'react';
2
-
3
- const AUMobilePrefixComponent: FC<AUMobilePrefixComponentProps> = ({
4
- countryCodes,
5
- important,
6
- }: AUMobilePrefixComponentProps) => {
7
- const renderCountryCodes = (codes:AU.ICountryCode[]) => codes.map(c => <option key={c.da} value={`+${c.code}`}>{`${c.da} (+${c.code})`}</option>);
8
- if (important) {
9
- return <>{renderCountryCodes(countryCodes.filter(c => c.important))}</>;
10
- }
11
- return <>{renderCountryCodes(countryCodes)}</>;
12
- };
13
-
14
- AUMobilePrefixComponent.displayName = 'AUMobilePrefixComponent';
15
- export default AUMobilePrefixComponent;
1
+ import React, { FC } from 'react';
2
+
3
+ const AUMobilePrefixComponent: FC<AUMobilePrefixComponentProps> = ({
4
+ countryCodes,
5
+ important,
6
+ }: AUMobilePrefixComponentProps) => {
7
+ const renderCountryCodes = (codes:AU.ICountryCode[]) => codes.map(c => <option key={c.da} value={`+${c.code}`}>{`${c.da} (+${c.code})`}</option>);
8
+ if (important) {
9
+ return <>{renderCountryCodes(countryCodes.filter(c => c.important))}</>;
10
+ }
11
+ return <>{renderCountryCodes(countryCodes)}</>;
12
+ };
13
+
14
+ AUMobilePrefixComponent.displayName = 'AUMobilePrefixComponent';
15
+ export default AUMobilePrefixComponent;
@@ -1,80 +1,64 @@
1
- /* eslint-env browser */
2
- /* eslint jsx-a11y/click-events-have-key-events: 0 */
3
- /* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
4
- /* eslint jsx-a11y/no-static-element-interactions: 0 */
5
- import React, { FC, useLayoutEffect } from 'react';
6
- import ReactDOM from 'react-dom';
7
- import { hideModal } from '@aarhus-university/au-designsystem-delphinus/source/js/components/modal-view';
8
-
9
- export {
10
- hideModal,
11
- };
12
-
13
- const AUModalComponent: FC<AUModalComponentProps> = ({
14
- domId,
15
- children,
16
- onClose,
17
- closeButton,
18
- closeButtonDisabled,
19
- lang,
20
- sender,
21
- className,
22
- }: AUModalComponentProps) => {
23
- useLayoutEffect(() => {
24
- const modalView = document.getElementById(domId);
25
- if (modalView) {
26
- const header = modalView.querySelector('.modal-view__header');
27
- if (header && !header.getAttribute('id')) {
28
- header.setAttribute('id', `${domId}-header`);
29
- modalView.setAttribute('aria-labelledby', `${domId}-header`);
30
- }
31
- }
32
- });
33
-
34
- return (
35
- ReactDOM.createPortal(
36
- <div
37
- key={0}
38
- id={domId}
39
- className={className}
40
- >
41
- <div className="modal-view__wrapper theme--normal">
42
- {
43
- closeButton && (
44
- <button
45
- type="button"
46
- disabled={closeButtonDisabled}
47
- className="modal-view__close button button--icon button--icon--hide-label"
48
- data-icon=""
49
- data-gtm="au-btn-modal-close"
50
- title={lang === 'da' ? 'Luk' : 'Close'}
51
- onClick={() => {
52
- if (typeof onClose === 'function') {
53
- onClose();
54
- }
55
- if (sender) {
56
- hideModal(domId, sender);
57
- }
58
- }}
59
- >
60
- {lang === 'da' ? 'Luk' : 'Close'}
61
- </button>
62
- )
63
- }
64
- {children}
65
- </div>
66
- </div>,
67
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
68
- document.querySelector('body')!,
69
- )
70
- );
71
- };
72
-
73
- AUModalComponent.defaultProps = {
74
- closeButton: true,
75
- lang: 'da',
76
- className: 'modal-view',
77
- };
78
-
79
- AUModalComponent.displayName = 'AUModalComponent';
80
- export default AUModalComponent;
1
+ /* eslint-env browser */
2
+ /* eslint jsx-a11y/click-events-have-key-events: 0 */
3
+ /* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
4
+ /* eslint jsx-a11y/no-static-element-interactions: 0 */
5
+ import React, { FC } from 'react';
6
+ import ReactDOM from 'react-dom';
7
+ import AUButtonComponent from './AUButtonComponent';
8
+ import { useModal } from '../lib/hooks';
9
+
10
+ const AUModalComponent: FC<AUModalComponentProps> = ({
11
+ lang,
12
+ domId,
13
+ className,
14
+ children,
15
+ closeButton,
16
+ closeButtonDisabled,
17
+ sender,
18
+ show,
19
+ onClose,
20
+ }: AUModalComponentProps) => {
21
+ useModal(domId, sender, show, !closeButtonDisabled, onClose);
22
+
23
+ return (
24
+ ReactDOM.createPortal(
25
+ <div
26
+ id={domId}
27
+ className={className}
28
+ >
29
+ <div className="modal-view__wrapper theme--normal">
30
+ {
31
+ closeButton && (
32
+ <AUButtonComponent
33
+ label={lang === 'da' ? 'Luk' : 'Close'}
34
+ disabled={closeButtonDisabled}
35
+ icon=""
36
+ hideLabel
37
+ classNames={['modal-view__close']}
38
+ dataGtm="au-btn-modal-close"
39
+ onClick={() => {
40
+ if (typeof onClose === 'function') {
41
+ onClose();
42
+ }
43
+ }}
44
+ />
45
+ )
46
+ }
47
+ {children}
48
+ </div>
49
+ </div>,
50
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
51
+ document.querySelector('body')!,
52
+ )
53
+ );
54
+ };
55
+
56
+ AUModalComponent.defaultProps = {
57
+ domId: 'modal-view1',
58
+ closeButton: true,
59
+ lang: 'da',
60
+ className: 'modal-view',
61
+ };
62
+
63
+ AUModalComponent.displayName = 'AUModalComponent';
64
+ export default AUModalComponent;
@@ -1,33 +1,33 @@
1
- import React, { FC } from 'react';
2
-
3
- const AUReceiptComponent: FC<AUReceiptComponentProps> = ({
4
- receiptText,
5
- helpText,
6
- showGoTo,
7
- buttons,
8
- }: AUReceiptComponentProps) => {
9
- const renderButtons = buttons.map((btn) => <a key={btn.gotoLink} href={btn.gotoLink} className="button">{btn.gotoText}</a>);
10
- return (
11
- <div className="receipt">
12
- <div className="receipt__icon" data-icon="" />
13
- <h1 className="receipt__header" dangerouslySetInnerHTML={{ __html: receiptText }} />
14
- {helpText}
15
- {
16
- showGoTo && (
17
- <div className="receipt__post-action">
18
- {renderButtons}
19
- </div>
20
- )
21
- }
22
- </div>
23
- );
24
- };
25
-
26
- AUReceiptComponent.defaultProps = {
27
- showGoTo: true,
28
- helpText: null,
29
- buttons: [],
30
- };
31
-
32
- AUReceiptComponent.displayName = 'AUReceiptComponent';
33
- export default AUReceiptComponent;
1
+ import React, { FC } from 'react';
2
+
3
+ const AUReceiptComponent: FC<AUReceiptComponentProps> = ({
4
+ receiptText,
5
+ helpText,
6
+ showGoTo,
7
+ buttons,
8
+ }: AUReceiptComponentProps) => {
9
+ const renderButtons = buttons.map((btn) => <a key={btn.gotoLink} href={btn.gotoLink} className="button">{btn.gotoText}</a>);
10
+ return (
11
+ <div className="receipt">
12
+ <div className="receipt__icon" data-icon="" />
13
+ <h1 className="receipt__header" dangerouslySetInnerHTML={{ __html: receiptText }} />
14
+ {helpText}
15
+ {
16
+ showGoTo && (
17
+ <div className="receipt__post-action">
18
+ {renderButtons}
19
+ </div>
20
+ )
21
+ }
22
+ </div>
23
+ );
24
+ };
25
+
26
+ AUReceiptComponent.defaultProps = {
27
+ showGoTo: true,
28
+ helpText: null,
29
+ buttons: [],
30
+ };
31
+
32
+ AUReceiptComponent.displayName = 'AUReceiptComponent';
33
+ export default AUReceiptComponent;
@@ -1,33 +1,33 @@
1
- /* eslint-disable react/static-property-placement */
2
- /* eslint-env browser */
3
- import React, { FC } from 'react';
4
-
5
- const AUSpinnerComponent: FC<AUSpinnerComponentProps> = ({
6
- loaded,
7
- init,
8
- height,
9
- className,
10
- children,
11
- }: AUSpinnerComponentProps) => {
12
- if (!loaded) {
13
- if (init === 'table' || init === 'box') {
14
- return (
15
- <div
16
- className={`processing-state processing-state--init-${init} ${className}`}
17
- style={{ minHeight: height }}
18
- />
19
- );
20
- }
21
- return (
22
- <div
23
- className={`processing-state ${className}`}
24
- style={{ minHeight: height }}
25
- />
26
- );
27
- }
28
-
29
- return children;
30
- };
31
-
32
- AUSpinnerComponent.displayName = 'AUSpinnerComponent';
33
- export default AUSpinnerComponent;
1
+ /* eslint-disable react/static-property-placement */
2
+ /* eslint-env browser */
3
+ import React, { FC } from 'react';
4
+
5
+ const AUSpinnerComponent: FC<AUSpinnerComponentProps> = ({
6
+ loaded,
7
+ init,
8
+ height,
9
+ className,
10
+ children,
11
+ }: AUSpinnerComponentProps) => {
12
+ if (!loaded) {
13
+ if (init === 'table' || init === 'box') {
14
+ return (
15
+ <div
16
+ className={`processing-state processing-state--init-${init} ${className}`}
17
+ style={{ minHeight: height }}
18
+ />
19
+ );
20
+ }
21
+ return (
22
+ <div
23
+ className={`processing-state ${className}`}
24
+ style={{ minHeight: height }}
25
+ />
26
+ );
27
+ }
28
+
29
+ return children;
30
+ };
31
+
32
+ AUSpinnerComponent.displayName = 'AUSpinnerComponent';
33
+ export default AUSpinnerComponent;