@aarhus-university/au-lib-react-components 11.5.1 → 11.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.
- package/.eslintrc.js +34 -34
- package/.storybook/main.js +20 -20
- package/.storybook/preview.js +17 -17
- package/README.md +19 -19
- package/__tests__/jest/AUButtonComponent.test.tsx +165 -165
- package/__tests__/jest/AUErrorComponent.test.tsx +142 -142
- package/__tests__/jest/AUModalComponent.test.tsx +186 -186
- package/__tests__/jest/AUNotificationComponent.test.tsx +115 -115
- package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -57
- package/__tests__/jest/AUToolbarComponent.test.tsx +46 -46
- package/__tests__/jest/context.test.ts +25 -25
- package/__tests__/jest/helpers.test.ts +15 -15
- package/__tests__/jest/setupTests.ts +2 -2
- package/babel.config.js +8 -8
- package/build/umd/all.css +2 -2
- package/build/umd/all.js +1 -1
- package/build/umd/alphabox.js +1 -1
- package/build/umd/databox.js +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/universe.js +1 -1
- package/build-storybook.log +367 -367
- package/package.json +114 -114
- package/src/components/AUAlertComponent.tsx +113 -113
- package/src/components/AUAutoSuggestComponent.js +158 -158
- package/src/components/AUButtonComponent.tsx +87 -87
- package/src/components/AUCalendarComponent.tsx +493 -493
- package/src/components/AUContentToggleComponent.tsx +47 -47
- package/src/components/AUDatepickerComponent.tsx +121 -121
- package/src/components/AUEditFilterComponent.tsx +24 -67
- package/src/components/AUErrorComponent.tsx +78 -78
- package/src/components/AUMobilePrefixComponent.tsx +15 -15
- package/src/components/AUModalComponent.tsx +68 -68
- package/src/components/AUNotificationComponent.tsx +43 -43
- package/src/components/AUReceiptComponent.tsx +33 -33
- package/src/components/AUSpinnerComponent.tsx +36 -36
- package/src/components/AUStepComponent.tsx +47 -47
- package/src/components/AUSubNavComponent.tsx +48 -48
- package/src/components/AUSubmitButtonContainerComponent.tsx +29 -29
- package/src/components/AUTabbedContentComponent.tsx +145 -145
- package/src/components/AUTableComponent.tsx +24 -24
- package/src/components/AUToastComponent.tsx +104 -104
- package/src/components/AUToolbarComponent.tsx +101 -106
- package/src/components/AUTruncatorComponent.tsx +124 -124
- package/src/components/wrapping/AUEmbedComponent.js +47 -47
- package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
- package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
- package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
- package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
- package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
- package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
- package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
- package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
- package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
- package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
- package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
- package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
- package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
- package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
- package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
- package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
- package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
- package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
- package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
- package/src/layout-2016/lib/all.js +3 -3
- package/src/layout-2016/lib/au-alphabox.js +100 -100
- package/src/layout-2016/lib/au-databox.js +400 -400
- package/src/layout-2016/lib/au-diagramme.js +85 -85
- package/src/layout-2016/lib/au-flowbox.js +93 -93
- package/src/layout-2016/lib/universe.js +9 -9
- package/src/lib/context.tsx +51 -51
- package/src/lib/dates.ts +50 -50
- package/src/lib/helpers.ts +208 -208
- package/src/lib/hooks.ts +75 -75
- package/src/lib/i18n.ts +600 -600
- package/src/lib/portals.tsx +145 -119
- package/src/lib/tracking.ts +69 -69
- package/src/lib/wrapping.ts +21 -21
- package/src/styles/_settings.scss +10 -10
- package/src/styles/alphabox.scss +222 -222
- package/src/styles/app.scss +7 -7
- package/src/styles/autosuggest.scss +57 -57
- package/src/styles/databox.scss +563 -563
- package/src/styles/diagramme.scss +119 -119
- package/src/styles/flowbox.scss +72 -72
- package/src/styles/maps.scss +395 -395
- package/stories/AUAlertComponent.stories.tsx +120 -120
- package/stories/AUButtonComponent.stories.tsx +127 -127
- package/stories/AUContentToggleComponent.stories.tsx +63 -63
- package/stories/AUEditFilterComponent.stories.tsx +29 -29
- package/stories/AUErrorComponent.stories.tsx +98 -98
- package/stories/AUModalComponent.stories.tsx +84 -84
- package/stories/AUNotificationComponent.stories.tsx +116 -116
- package/stories/AUSpinnerComponent.stories.tsx +41 -41
- package/stories/AUStepComponent.stories.tsx +40 -40
- package/stories/AUToolbarComponent.stories.tsx +326 -327
- package/stories/AUTruncatorComponent.stories.tsx +101 -101
- package/stories/lib/helpers.tsx +128 -128
- package/tsconfig.json +46 -46
- package/webpack.config.js +89 -89
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import AUEditFilterComponent from '../src/components/AUEditFilterComponent';
|
|
4
|
-
import { ThemeWrapper } from './lib/helpers';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Delphinus/Filters',
|
|
8
|
-
component: AUEditFilterComponent,
|
|
9
|
-
argTypes: {
|
|
10
|
-
},
|
|
11
|
-
decorators: [
|
|
12
|
-
(Story, context) => (
|
|
13
|
-
<ThemeWrapper theme={context.globals.theme}>
|
|
14
|
-
{Story()}
|
|
15
|
-
</ThemeWrapper>
|
|
16
|
-
)
|
|
17
|
-
],
|
|
18
|
-
} as ComponentMeta<typeof AUEditFilterComponent>;
|
|
19
|
-
|
|
20
|
-
const Template: ComponentStory<typeof AUEditFilterComponent> = (args) => (
|
|
21
|
-
<>
|
|
22
|
-
<AUEditFilterComponent {...args} />
|
|
23
|
-
</>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export const Edit = Template.bind({});
|
|
27
|
-
Edit.args = {
|
|
28
|
-
};
|
|
29
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import AUEditFilterComponent from '../src/components/AUEditFilterComponent';
|
|
4
|
+
import { ThemeWrapper } from './lib/helpers';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Delphinus/Filters',
|
|
8
|
+
component: AUEditFilterComponent,
|
|
9
|
+
argTypes: {
|
|
10
|
+
},
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story, context) => (
|
|
13
|
+
<ThemeWrapper theme={context.globals.theme}>
|
|
14
|
+
{Story()}
|
|
15
|
+
</ThemeWrapper>
|
|
16
|
+
)
|
|
17
|
+
],
|
|
18
|
+
} as ComponentMeta<typeof AUEditFilterComponent>;
|
|
19
|
+
|
|
20
|
+
const Template: ComponentStory<typeof AUEditFilterComponent> = (args) => (
|
|
21
|
+
<>
|
|
22
|
+
<AUEditFilterComponent {...args} />
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const Edit = Template.bind({});
|
|
27
|
+
Edit.args = {
|
|
28
|
+
};
|
|
29
|
+
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import AUErrorComponent from '../src/components/AUErrorComponent';
|
|
4
|
-
import { ThemeWrapper } from './lib/helpers';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Delphinus/Error',
|
|
8
|
-
component: AUErrorComponent,
|
|
9
|
-
decorators: [
|
|
10
|
-
(Story, context) => (
|
|
11
|
-
<ThemeWrapper theme={context.globals.theme}>
|
|
12
|
-
{Story()}
|
|
13
|
-
</ThemeWrapper>
|
|
14
|
-
)
|
|
15
|
-
],
|
|
16
|
-
} as ComponentMeta<typeof AUErrorComponent>;
|
|
17
|
-
|
|
18
|
-
const Template: ComponentStory<typeof AUErrorComponent> = (args) => <AUErrorComponent {...args} />;
|
|
19
|
-
|
|
20
|
-
export const AU_Error = Template.bind({});
|
|
21
|
-
AU_Error.args = {
|
|
22
|
-
error: {
|
|
23
|
-
header: 'Our own custom error',
|
|
24
|
-
message: 'With a nice header and descriptive error message, maybe a hint of some <a href="mailto:#">contact support info</a>',
|
|
25
|
-
status: 500,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const AU_Error_With_Status = Template.bind({});
|
|
30
|
-
AU_Error_With_Status.args = {
|
|
31
|
-
error: {
|
|
32
|
-
header: 'Our own custom error',
|
|
33
|
-
message: 'With a nice header and descriptive error message',
|
|
34
|
-
status: 500,
|
|
35
|
-
},
|
|
36
|
-
withStatus: true,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Fetch_Error = Template.bind({});
|
|
40
|
-
Fetch_Error.args = {
|
|
41
|
-
fetchError: {
|
|
42
|
-
error: 'Something horrible has happened on the server...',
|
|
43
|
-
status: 'FETCH_ERROR',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Fetch_Error_With_Status = Template.bind({});
|
|
48
|
-
Fetch_Error_With_Status.args = {
|
|
49
|
-
fetchError: {
|
|
50
|
-
error: 'Something horrible has happened on the server...',
|
|
51
|
-
status: 'FETCH_ERROR',
|
|
52
|
-
},
|
|
53
|
-
withStatus: true,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Fetch_Error_With_Data = Template.bind({});
|
|
57
|
-
Fetch_Error_With_Data.args = {
|
|
58
|
-
fetchError: {
|
|
59
|
-
data: {
|
|
60
|
-
status: 'Error',
|
|
61
|
-
message: 'This could be anything...',
|
|
62
|
-
somethingElse: 'Even this...',
|
|
63
|
-
},
|
|
64
|
-
status: 500,
|
|
65
|
-
},
|
|
66
|
-
withStatus: false,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Fetch_Error_With_Data_And_Status = Template.bind({});
|
|
70
|
-
Fetch_Error_With_Data_And_Status.args = {
|
|
71
|
-
fetchError: {
|
|
72
|
-
data: {
|
|
73
|
-
status: 'Error',
|
|
74
|
-
message: 'This could be anything...',
|
|
75
|
-
somethingElse: 'Even this...',
|
|
76
|
-
},
|
|
77
|
-
status: 500,
|
|
78
|
-
},
|
|
79
|
-
withStatus: true,
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const Serialized_Error = Template.bind({});
|
|
83
|
-
Serialized_Error.args = {
|
|
84
|
-
serializedError: {
|
|
85
|
-
message: 'Something funky has happened in the code...',
|
|
86
|
-
code: '500',
|
|
87
|
-
},
|
|
88
|
-
withStatus: false,
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const Serialized_Error_With_Code = Template.bind({});
|
|
92
|
-
Serialized_Error_With_Code.args = {
|
|
93
|
-
serializedError: {
|
|
94
|
-
message: 'Something funky has happened in the code...',
|
|
95
|
-
code: '500',
|
|
96
|
-
},
|
|
97
|
-
withStatus: true,
|
|
98
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import AUErrorComponent from '../src/components/AUErrorComponent';
|
|
4
|
+
import { ThemeWrapper } from './lib/helpers';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Delphinus/Error',
|
|
8
|
+
component: AUErrorComponent,
|
|
9
|
+
decorators: [
|
|
10
|
+
(Story, context) => (
|
|
11
|
+
<ThemeWrapper theme={context.globals.theme}>
|
|
12
|
+
{Story()}
|
|
13
|
+
</ThemeWrapper>
|
|
14
|
+
)
|
|
15
|
+
],
|
|
16
|
+
} as ComponentMeta<typeof AUErrorComponent>;
|
|
17
|
+
|
|
18
|
+
const Template: ComponentStory<typeof AUErrorComponent> = (args) => <AUErrorComponent {...args} />;
|
|
19
|
+
|
|
20
|
+
export const AU_Error = Template.bind({});
|
|
21
|
+
AU_Error.args = {
|
|
22
|
+
error: {
|
|
23
|
+
header: 'Our own custom error',
|
|
24
|
+
message: 'With a nice header and descriptive error message, maybe a hint of some <a href="mailto:#">contact support info</a>',
|
|
25
|
+
status: 500,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const AU_Error_With_Status = Template.bind({});
|
|
30
|
+
AU_Error_With_Status.args = {
|
|
31
|
+
error: {
|
|
32
|
+
header: 'Our own custom error',
|
|
33
|
+
message: 'With a nice header and descriptive error message',
|
|
34
|
+
status: 500,
|
|
35
|
+
},
|
|
36
|
+
withStatus: true,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Fetch_Error = Template.bind({});
|
|
40
|
+
Fetch_Error.args = {
|
|
41
|
+
fetchError: {
|
|
42
|
+
error: 'Something horrible has happened on the server...',
|
|
43
|
+
status: 'FETCH_ERROR',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const Fetch_Error_With_Status = Template.bind({});
|
|
48
|
+
Fetch_Error_With_Status.args = {
|
|
49
|
+
fetchError: {
|
|
50
|
+
error: 'Something horrible has happened on the server...',
|
|
51
|
+
status: 'FETCH_ERROR',
|
|
52
|
+
},
|
|
53
|
+
withStatus: true,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Fetch_Error_With_Data = Template.bind({});
|
|
57
|
+
Fetch_Error_With_Data.args = {
|
|
58
|
+
fetchError: {
|
|
59
|
+
data: {
|
|
60
|
+
status: 'Error',
|
|
61
|
+
message: 'This could be anything...',
|
|
62
|
+
somethingElse: 'Even this...',
|
|
63
|
+
},
|
|
64
|
+
status: 500,
|
|
65
|
+
},
|
|
66
|
+
withStatus: false,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Fetch_Error_With_Data_And_Status = Template.bind({});
|
|
70
|
+
Fetch_Error_With_Data_And_Status.args = {
|
|
71
|
+
fetchError: {
|
|
72
|
+
data: {
|
|
73
|
+
status: 'Error',
|
|
74
|
+
message: 'This could be anything...',
|
|
75
|
+
somethingElse: 'Even this...',
|
|
76
|
+
},
|
|
77
|
+
status: 500,
|
|
78
|
+
},
|
|
79
|
+
withStatus: true,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Serialized_Error = Template.bind({});
|
|
83
|
+
Serialized_Error.args = {
|
|
84
|
+
serializedError: {
|
|
85
|
+
message: 'Something funky has happened in the code...',
|
|
86
|
+
code: '500',
|
|
87
|
+
},
|
|
88
|
+
withStatus: false,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const Serialized_Error_With_Code = Template.bind({});
|
|
92
|
+
Serialized_Error_With_Code.args = {
|
|
93
|
+
serializedError: {
|
|
94
|
+
message: 'Something funky has happened in the code...',
|
|
95
|
+
code: '500',
|
|
96
|
+
},
|
|
97
|
+
withStatus: true,
|
|
98
|
+
};
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { useArgs } from '@storybook/client-api';
|
|
4
|
-
import AUModalComponent from '../src/components/AUModalComponent';
|
|
5
|
-
import AUButtonComponent from '../src/components/AUButtonComponent';
|
|
6
|
-
import { ThemeWrapper } from './lib/helpers';
|
|
7
|
-
|
|
8
|
-
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Delphinus/Modal',
|
|
11
|
-
component: AUModalComponent,
|
|
12
|
-
argTypes: {
|
|
13
|
-
sender: {
|
|
14
|
-
table: {
|
|
15
|
-
disable: true,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
decorators: [
|
|
20
|
-
(Story, context) => (
|
|
21
|
-
<ThemeWrapper theme={context.globals.theme}>
|
|
22
|
-
{Story()}
|
|
23
|
-
</ThemeWrapper>
|
|
24
|
-
)
|
|
25
|
-
],
|
|
26
|
-
} as ComponentMeta<typeof AUModalComponent>;
|
|
27
|
-
|
|
28
|
-
const fakeBtn = document.createElement('button');
|
|
29
|
-
|
|
30
|
-
const Template: ComponentStory<typeof AUModalComponent> = (args) => {
|
|
31
|
-
const [_, updateArgs] = useArgs();
|
|
32
|
-
return (
|
|
33
|
-
<div className="page__content__block">
|
|
34
|
-
<AUButtonComponent
|
|
35
|
-
label="Open modal"
|
|
36
|
-
ariaHasPopup
|
|
37
|
-
onClick={() => updateArgs({ ...args, show: true })}
|
|
38
|
-
/>
|
|
39
|
-
<AUModalComponent {...args} onClose={() => updateArgs({ ...args, show: false })}>
|
|
40
|
-
<>
|
|
41
|
-
<h2 className="modal-view__header">
|
|
42
|
-
The quick brown fox jumps over the lazy dog
|
|
43
|
-
</h2>
|
|
44
|
-
<div className="modal-view__content">
|
|
45
|
-
<p>"The quick brown fox jumps over the lazy dog" is an English-language pangram—a sentence that contains all of the letters of the alphabet. It is commonly used for touch-typing practice, testing typewriters and computer keyboards, displaying examples of fonts, and other applications involving text where the use of all letters in the alphabet is desired. Owing to its brevity and coherence, it has become widely known.</p><h3>History</h3><p>The earliest known appearance of the phrase is from The Boston Journal. In an article titled "Current Notes" in the February 10, 1885, morning edition, the phrase is mentioned as a good practice sentence for writing students: "A favorite copy set by writing teachers for their pupils is the following, because it contains every letter of the alphabet: 'A quick brown fox jumps over the lazy dog.'"[1] Dozens of other newspapers published the phrase over the next few months, all using the version of the sentence starting with "A" rather than "The".[2] The earliest known use of the phrase in its modern form (starting with "The") is from the 1888 book Illustrative Shorthand by Linda Bronson.[3] The modern form (starting with "The") became more common despite the fact that it is slightly longer than the original (starting with "A").</p>
|
|
46
|
-
</div>
|
|
47
|
-
</>
|
|
48
|
-
</AUModalComponent>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Default = Template.bind({});
|
|
54
|
-
Default.args = {
|
|
55
|
-
show: true,
|
|
56
|
-
sender: fakeBtn,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const Hidden = Template.bind({});
|
|
60
|
-
Hidden.args = {
|
|
61
|
-
show: false,
|
|
62
|
-
sender: fakeBtn,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const Wide = Template.bind({});
|
|
66
|
-
Wide.args = {
|
|
67
|
-
className: 'modal-view modal-view--wide',
|
|
68
|
-
show: true,
|
|
69
|
-
sender: fakeBtn,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const High = Template.bind({});
|
|
73
|
-
High.args = {
|
|
74
|
-
className: 'modal-view modal-view--high',
|
|
75
|
-
show: true,
|
|
76
|
-
sender: fakeBtn,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const Non_Closable = Template.bind({});
|
|
80
|
-
Non_Closable.args = {
|
|
81
|
-
show: true,
|
|
82
|
-
sender: fakeBtn,
|
|
83
|
-
closeButtonDisabled: true,
|
|
84
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { useArgs } from '@storybook/client-api';
|
|
4
|
+
import AUModalComponent from '../src/components/AUModalComponent';
|
|
5
|
+
import AUButtonComponent from '../src/components/AUButtonComponent';
|
|
6
|
+
import { ThemeWrapper } from './lib/helpers';
|
|
7
|
+
|
|
8
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Delphinus/Modal',
|
|
11
|
+
component: AUModalComponent,
|
|
12
|
+
argTypes: {
|
|
13
|
+
sender: {
|
|
14
|
+
table: {
|
|
15
|
+
disable: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
decorators: [
|
|
20
|
+
(Story, context) => (
|
|
21
|
+
<ThemeWrapper theme={context.globals.theme}>
|
|
22
|
+
{Story()}
|
|
23
|
+
</ThemeWrapper>
|
|
24
|
+
)
|
|
25
|
+
],
|
|
26
|
+
} as ComponentMeta<typeof AUModalComponent>;
|
|
27
|
+
|
|
28
|
+
const fakeBtn = document.createElement('button');
|
|
29
|
+
|
|
30
|
+
const Template: ComponentStory<typeof AUModalComponent> = (args) => {
|
|
31
|
+
const [_, updateArgs] = useArgs();
|
|
32
|
+
return (
|
|
33
|
+
<div className="page__content__block">
|
|
34
|
+
<AUButtonComponent
|
|
35
|
+
label="Open modal"
|
|
36
|
+
ariaHasPopup
|
|
37
|
+
onClick={() => updateArgs({ ...args, show: true })}
|
|
38
|
+
/>
|
|
39
|
+
<AUModalComponent {...args} onClose={() => updateArgs({ ...args, show: false })}>
|
|
40
|
+
<>
|
|
41
|
+
<h2 className="modal-view__header">
|
|
42
|
+
The quick brown fox jumps over the lazy dog
|
|
43
|
+
</h2>
|
|
44
|
+
<div className="modal-view__content">
|
|
45
|
+
<p>"The quick brown fox jumps over the lazy dog" is an English-language pangram—a sentence that contains all of the letters of the alphabet. It is commonly used for touch-typing practice, testing typewriters and computer keyboards, displaying examples of fonts, and other applications involving text where the use of all letters in the alphabet is desired. Owing to its brevity and coherence, it has become widely known.</p><h3>History</h3><p>The earliest known appearance of the phrase is from The Boston Journal. In an article titled "Current Notes" in the February 10, 1885, morning edition, the phrase is mentioned as a good practice sentence for writing students: "A favorite copy set by writing teachers for their pupils is the following, because it contains every letter of the alphabet: 'A quick brown fox jumps over the lazy dog.'"[1] Dozens of other newspapers published the phrase over the next few months, all using the version of the sentence starting with "A" rather than "The".[2] The earliest known use of the phrase in its modern form (starting with "The") is from the 1888 book Illustrative Shorthand by Linda Bronson.[3] The modern form (starting with "The") became more common despite the fact that it is slightly longer than the original (starting with "A").</p>
|
|
46
|
+
</div>
|
|
47
|
+
</>
|
|
48
|
+
</AUModalComponent>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Default = Template.bind({});
|
|
54
|
+
Default.args = {
|
|
55
|
+
show: true,
|
|
56
|
+
sender: fakeBtn,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Hidden = Template.bind({});
|
|
60
|
+
Hidden.args = {
|
|
61
|
+
show: false,
|
|
62
|
+
sender: fakeBtn,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Wide = Template.bind({});
|
|
66
|
+
Wide.args = {
|
|
67
|
+
className: 'modal-view modal-view--wide',
|
|
68
|
+
show: true,
|
|
69
|
+
sender: fakeBtn,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const High = Template.bind({});
|
|
73
|
+
High.args = {
|
|
74
|
+
className: 'modal-view modal-view--high',
|
|
75
|
+
show: true,
|
|
76
|
+
sender: fakeBtn,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Non_Closable = Template.bind({});
|
|
80
|
+
Non_Closable.args = {
|
|
81
|
+
show: true,
|
|
82
|
+
sender: fakeBtn,
|
|
83
|
+
closeButtonDisabled: true,
|
|
84
|
+
};
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import AUNotificationComponent from '../src/components/AUNotificationComponent';
|
|
4
|
-
import AUButtonComponent from '../src/components/AUButtonComponent';
|
|
5
|
-
import { ThemeWrapper } from './lib/helpers';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Delphinus/Notification',
|
|
9
|
-
component: AUNotificationComponent,
|
|
10
|
-
argTypes: {
|
|
11
|
-
type: {
|
|
12
|
-
control: {
|
|
13
|
-
type: 'radio',
|
|
14
|
-
},
|
|
15
|
-
options: [
|
|
16
|
-
'default',
|
|
17
|
-
'warning',
|
|
18
|
-
'attention',
|
|
19
|
-
'confirm',
|
|
20
|
-
],
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
decorators: [
|
|
24
|
-
(Story, context) => (
|
|
25
|
-
<ThemeWrapper theme={context.globals.theme}>
|
|
26
|
-
{Story()}
|
|
27
|
-
</ThemeWrapper>
|
|
28
|
-
)
|
|
29
|
-
],
|
|
30
|
-
} as ComponentMeta<typeof AUNotificationComponent>;
|
|
31
|
-
|
|
32
|
-
const Template: ComponentStory<typeof AUNotificationComponent> = (args) => <AUNotificationComponent {...args} />;
|
|
33
|
-
|
|
34
|
-
export const Default = Template.bind({});
|
|
35
|
-
Default.args = {
|
|
36
|
-
header: 'This is a notification',
|
|
37
|
-
content: [
|
|
38
|
-
<p>This might be of importance...</p>
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Warning = Template.bind({});
|
|
43
|
-
Warning.args = {
|
|
44
|
-
header: 'Oops! An error has occurred',
|
|
45
|
-
type: 'warning',
|
|
46
|
-
content: [
|
|
47
|
-
<p>Shit's fucked, yo!</p>
|
|
48
|
-
],
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Attention = Template.bind({});
|
|
52
|
-
Attention.args = {
|
|
53
|
-
header: 'Please read this',
|
|
54
|
-
type: 'attention',
|
|
55
|
-
content: [
|
|
56
|
-
<p>We really want you to read this.</p>
|
|
57
|
-
],
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const Confirm = Template.bind({});
|
|
61
|
-
Confirm.args = {
|
|
62
|
-
header: 'Great success',
|
|
63
|
-
type: 'confirm',
|
|
64
|
-
content: [
|
|
65
|
-
<p>You the man now, dawg!</p>
|
|
66
|
-
],
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Single_Action = Template.bind({});
|
|
70
|
-
Single_Action.args = {
|
|
71
|
-
header: 'Do you want to do this?',
|
|
72
|
-
type: 'attention',
|
|
73
|
-
content: [
|
|
74
|
-
<p>Please confirm.</p>
|
|
75
|
-
],
|
|
76
|
-
actions: [
|
|
77
|
-
<AUButtonComponent
|
|
78
|
-
label="Ok"
|
|
79
|
-
/>
|
|
80
|
-
],
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const Multiple_Actions = Template.bind({});
|
|
84
|
-
Multiple_Actions.args = {
|
|
85
|
-
header: 'Do you want to do this?',
|
|
86
|
-
type: 'attention',
|
|
87
|
-
content: [
|
|
88
|
-
<p>Please confirm.</p>
|
|
89
|
-
],
|
|
90
|
-
actions: [
|
|
91
|
-
<div className="button-container">
|
|
92
|
-
<AUButtonComponent
|
|
93
|
-
label="Ok"
|
|
94
|
-
/>
|
|
95
|
-
<AUButtonComponent
|
|
96
|
-
label="Cancel"
|
|
97
|
-
type="text"
|
|
98
|
-
/>
|
|
99
|
-
</div>,
|
|
100
|
-
],
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const No_Header = Template.bind({});
|
|
104
|
-
No_Header.args = {
|
|
105
|
-
content: [
|
|
106
|
-
<p>This might be of importance...</p>
|
|
107
|
-
],
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export const Constrained_Width = Template.bind({});
|
|
111
|
-
Constrained_Width.args = {
|
|
112
|
-
content: [
|
|
113
|
-
<p>This might be of importance...</p>
|
|
114
|
-
],
|
|
115
|
-
classNames: ['notification--constrain-width'],
|
|
116
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import AUNotificationComponent from '../src/components/AUNotificationComponent';
|
|
4
|
+
import AUButtonComponent from '../src/components/AUButtonComponent';
|
|
5
|
+
import { ThemeWrapper } from './lib/helpers';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Delphinus/Notification',
|
|
9
|
+
component: AUNotificationComponent,
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
control: {
|
|
13
|
+
type: 'radio',
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
'default',
|
|
17
|
+
'warning',
|
|
18
|
+
'attention',
|
|
19
|
+
'confirm',
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
decorators: [
|
|
24
|
+
(Story, context) => (
|
|
25
|
+
<ThemeWrapper theme={context.globals.theme}>
|
|
26
|
+
{Story()}
|
|
27
|
+
</ThemeWrapper>
|
|
28
|
+
)
|
|
29
|
+
],
|
|
30
|
+
} as ComponentMeta<typeof AUNotificationComponent>;
|
|
31
|
+
|
|
32
|
+
const Template: ComponentStory<typeof AUNotificationComponent> = (args) => <AUNotificationComponent {...args} />;
|
|
33
|
+
|
|
34
|
+
export const Default = Template.bind({});
|
|
35
|
+
Default.args = {
|
|
36
|
+
header: 'This is a notification',
|
|
37
|
+
content: [
|
|
38
|
+
<p>This might be of importance...</p>
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Warning = Template.bind({});
|
|
43
|
+
Warning.args = {
|
|
44
|
+
header: 'Oops! An error has occurred',
|
|
45
|
+
type: 'warning',
|
|
46
|
+
content: [
|
|
47
|
+
<p>Shit's fucked, yo!</p>
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Attention = Template.bind({});
|
|
52
|
+
Attention.args = {
|
|
53
|
+
header: 'Please read this',
|
|
54
|
+
type: 'attention',
|
|
55
|
+
content: [
|
|
56
|
+
<p>We really want you to read this.</p>
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Confirm = Template.bind({});
|
|
61
|
+
Confirm.args = {
|
|
62
|
+
header: 'Great success',
|
|
63
|
+
type: 'confirm',
|
|
64
|
+
content: [
|
|
65
|
+
<p>You the man now, dawg!</p>
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Single_Action = Template.bind({});
|
|
70
|
+
Single_Action.args = {
|
|
71
|
+
header: 'Do you want to do this?',
|
|
72
|
+
type: 'attention',
|
|
73
|
+
content: [
|
|
74
|
+
<p>Please confirm.</p>
|
|
75
|
+
],
|
|
76
|
+
actions: [
|
|
77
|
+
<AUButtonComponent
|
|
78
|
+
label="Ok"
|
|
79
|
+
/>
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Multiple_Actions = Template.bind({});
|
|
84
|
+
Multiple_Actions.args = {
|
|
85
|
+
header: 'Do you want to do this?',
|
|
86
|
+
type: 'attention',
|
|
87
|
+
content: [
|
|
88
|
+
<p>Please confirm.</p>
|
|
89
|
+
],
|
|
90
|
+
actions: [
|
|
91
|
+
<div className="button-container">
|
|
92
|
+
<AUButtonComponent
|
|
93
|
+
label="Ok"
|
|
94
|
+
/>
|
|
95
|
+
<AUButtonComponent
|
|
96
|
+
label="Cancel"
|
|
97
|
+
type="text"
|
|
98
|
+
/>
|
|
99
|
+
</div>,
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const No_Header = Template.bind({});
|
|
104
|
+
No_Header.args = {
|
|
105
|
+
content: [
|
|
106
|
+
<p>This might be of importance...</p>
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const Constrained_Width = Template.bind({});
|
|
111
|
+
Constrained_Width.args = {
|
|
112
|
+
content: [
|
|
113
|
+
<p>This might be of importance...</p>
|
|
114
|
+
],
|
|
115
|
+
classNames: ['notification--constrain-width'],
|
|
116
|
+
};
|