@aarhus-university/au-lib-react-components 10.5.0 → 10.6.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 (94) hide show
  1. package/.eslintrc.js +34 -33
  2. package/.storybook/main.js +7 -7
  3. package/.storybook/preview.js +10 -10
  4. package/README.md +19 -19
  5. package/__tests__/jest/AUButtonComponent.test.tsx +163 -163
  6. package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -0
  7. package/__tests__/jest/helpers.test.ts +15 -15
  8. package/__tests__/jest/setupTests.ts +2 -2
  9. package/babel.config.js +8 -8
  10. package/build/umd/all.css +2 -2
  11. package/build/umd/all.js +1 -1
  12. package/build/umd/alphabox.js +1 -1
  13. package/build/umd/databox.js +1 -1
  14. package/build/umd/databox.js.map +1 -1
  15. package/build/umd/diagramme.js +1 -1
  16. package/build/umd/flowbox.js +1 -1
  17. package/build/umd/universe.js +1 -1
  18. package/package.json +107 -107
  19. package/src/components/AUAlertComponent.tsx +70 -70
  20. package/src/components/AUAutoSuggestComponent.js +158 -158
  21. package/src/components/AUButtonComponent.tsx +77 -77
  22. package/src/components/AUCalendarComponent.tsx +493 -493
  23. package/src/components/AUContentToggleComponent.tsx +33 -33
  24. package/src/components/AUDatepickerComponent.tsx +117 -117
  25. package/src/components/AUMobilePrefixComponent.tsx +15 -15
  26. package/src/components/AUModalComponent.tsx +80 -80
  27. package/src/components/AUReceiptComponent.tsx +33 -33
  28. package/src/components/AUSpinnerComponent.tsx +33 -91
  29. package/src/components/AUSubNavComponent.tsx +48 -48
  30. package/src/components/AUSubmitButtonContainerComponent.tsx +31 -31
  31. package/src/components/AUTabbedContentComponent.tsx +145 -145
  32. package/src/components/AUTableComponent.tsx +24 -24
  33. package/src/components/AUToastComponent.tsx +103 -103
  34. package/src/components/AUToolbarComponent.tsx +45 -45
  35. package/src/components/profile/AUProfileActions.js +128 -128
  36. package/src/components/profile/AUProfileAvatarComponent.js +83 -83
  37. package/src/components/profile/AUProfileAvatarV2Component.js +91 -91
  38. package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -42
  39. package/src/components/profile/AUProfileContainerComponent.js +283 -283
  40. package/src/components/profile/AUProfileHooks.js +30 -30
  41. package/src/components/profile/AUProfileItemComponent.js +54 -54
  42. package/src/components/profile/AUProfileLanguageComponent.js +131 -131
  43. package/src/components/profile/AUProfileLoginComponent.tsx +26 -26
  44. package/src/components/profile/AUProfileMailComponent.js +307 -307
  45. package/src/components/profile/AUProfileMobileComponent.js +164 -164
  46. package/src/components/profile/AUProfileNameComponent.js +253 -253
  47. package/src/components/profile/AUProfileNextOfKinComponent.js +216 -216
  48. package/src/components/profile/AUProfileReducer.js +230 -230
  49. package/src/components/profile/AUProfileWidgetComponent.js +95 -95
  50. package/src/components/profile/AUProfileWidgetV2Component.js +116 -116
  51. package/src/components/profile/AUProfileWidgetV3Component.tsx +122 -122
  52. package/src/components/wrapping/AUEmbedComponent.js +47 -47
  53. package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
  54. package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
  55. package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
  56. package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
  57. package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
  58. package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
  59. package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
  60. package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
  61. package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
  62. package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
  63. package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
  64. package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
  65. package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
  66. package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
  67. package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
  68. package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
  69. package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
  70. package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
  71. package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
  72. package/src/layout-2016/lib/all.js +3 -3
  73. package/src/layout-2016/lib/au-alphabox.js +100 -100
  74. package/src/layout-2016/lib/au-databox.js +400 -400
  75. package/src/layout-2016/lib/au-diagramme.js +85 -85
  76. package/src/layout-2016/lib/au-flowbox.js +93 -93
  77. package/src/layout-2016/lib/universe.js +9 -9
  78. package/src/lib/helpers.ts +194 -194
  79. package/src/lib/hooks.ts +33 -33
  80. package/src/lib/i18n.ts +600 -600
  81. package/src/lib/tracking.ts +69 -69
  82. package/src/lib/wrapping.ts +21 -21
  83. package/src/styles/_settings.scss +10 -10
  84. package/src/styles/alphabox.scss +222 -222
  85. package/src/styles/app.scss +7 -7
  86. package/src/styles/autosuggest.scss +57 -57
  87. package/src/styles/databox.scss +563 -563
  88. package/src/styles/diagramme.scss +119 -119
  89. package/src/styles/flowbox.scss +72 -72
  90. package/src/styles/maps.scss +395 -395
  91. package/stories/AUButtonComponent.stories.tsx +85 -88
  92. package/stories/AUSpinnerComponent.stories.tsx +41 -0
  93. package/tsconfig.json +46 -46
  94. 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,80 @@
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, 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,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;