@bbl-digital/snorre 4.0.7 → 4.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +105 -15
- package/esm/core/Alert/Alert.stories.js +17 -17
- package/esm/core/Alert/index.js +32 -2
- package/esm/core/AppLoader/AppLoader.stories.js +2 -3
- package/esm/core/AppLoader/index.js +9 -1
- package/esm/core/Banner/Banner.stories.js +26 -18
- package/esm/core/Banner/index.js +4 -1
- package/esm/core/Modal/Modal.stories.js +56 -39
- package/esm/core/Modal/index.js +29 -1
- package/esm/index.js +2 -1
- package/esm/shared/components/VisuallyHidden/index.js +22 -0
- package/lib/core/Alert/Alert.stories.d.ts +10 -23
- package/lib/core/Alert/Alert.stories.d.ts.map +1 -1
- package/lib/core/Alert/Alert.stories.js +17 -17
- package/lib/core/Alert/index.d.ts +2 -1
- package/lib/core/Alert/index.d.ts.map +1 -1
- package/lib/core/Alert/index.js +32 -2
- package/lib/core/AppLoader/AppLoader.stories.d.ts +6 -7
- package/lib/core/AppLoader/AppLoader.stories.d.ts.map +1 -1
- package/lib/core/AppLoader/AppLoader.stories.js +2 -3
- package/lib/core/AppLoader/index.d.ts +2 -1
- package/lib/core/AppLoader/index.d.ts.map +1 -1
- package/lib/core/AppLoader/index.js +9 -1
- package/lib/core/Autocomplete/styles.d.ts +26 -1
- package/lib/core/Autocomplete/styles.d.ts.map +1 -1
- package/lib/core/Banner/Banner.stories.d.ts +10 -23
- package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
- package/lib/core/Banner/Banner.stories.js +26 -18
- package/lib/core/Banner/index.d.ts +2 -1
- package/lib/core/Banner/index.d.ts.map +1 -1
- package/lib/core/Banner/index.js +4 -1
- package/lib/core/Box/styles.d.ts +25 -1
- package/lib/core/Box/styles.d.ts.map +1 -1
- package/lib/core/CollapseList/styles.d.ts +26 -1
- package/lib/core/CollapseList/styles.d.ts.map +1 -1
- package/lib/core/FileInput/styles.d.ts +25 -1
- package/lib/core/FileInput/styles.d.ts.map +1 -1
- package/lib/core/InfoButton/styles.d.ts +25 -1
- package/lib/core/InfoButton/styles.d.ts.map +1 -1
- package/lib/core/Modal/Modal.stories.d.ts +11 -23
- package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
- package/lib/core/Modal/Modal.stories.js +56 -39
- package/lib/core/Modal/index.d.ts +3 -2
- package/lib/core/Modal/index.d.ts.map +1 -1
- package/lib/core/Modal/index.js +29 -1
- package/lib/core/private/ButtonOrLink.d.ts +2 -1
- package/lib/core/private/ButtonOrLink.d.ts.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/layout/Footer/FooterButton/styles.d.ts +26 -1
- package/lib/layout/Footer/FooterButton/styles.d.ts.map +1 -1
- package/lib/layout/Footer/FooterLink/styles.d.ts +26 -1
- package/lib/layout/Footer/FooterLink/styles.d.ts.map +1 -1
- package/lib/layout/Menu/MenuTop/styles.d.ts +25 -1
- package/lib/layout/Menu/MenuTop/styles.d.ts.map +1 -1
- package/lib/shared/components/VisuallyHidden/index.d.ts +11 -0
- package/lib/shared/components/VisuallyHidden/index.d.ts.map +1 -0
- package/lib/shared/components/VisuallyHidden/index.js +22 -0
- package/lib/shared/types/Accessibility.d.ts +2 -2
- package/lib/shared/types/Accessibility.d.ts.map +1 -1
- package/package.json +1 -1
- package/esm/core/Autocomplete/utils/useHandleOptionsHeight.js +0 -16
- package/esm/core/CheckboxController/index.js +0 -22
- package/esm/core/Datepicker/yearMonthForm.js +0 -56
- package/esm/core/EditorOld/config.js +0 -69
- package/esm/core/EditorOld/index.js +0 -147
- package/esm/core/EditorOld/styles.js +0 -65
- package/esm/core/ImageCarousel/index.js +0 -70
- package/esm/core/ImageCarousel/styles.js +0 -58
- package/esm/enums/ModifierKey.js +0 -13
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.d.ts +0 -7
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.d.ts.map +0 -1
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.js +0 -16
- package/lib/core/CheckboxController/index.d.ts +0 -1
- package/lib/core/CheckboxController/index.d.ts.map +0 -1
- package/lib/core/CheckboxController/index.js +0 -22
- package/lib/core/Datepicker/yearMonthForm.d.ts +0 -10
- package/lib/core/Datepicker/yearMonthForm.d.ts.map +0 -1
- package/lib/core/Datepicker/yearMonthForm.js +0 -56
- package/lib/core/EditorOld/config.d.ts +0 -56
- package/lib/core/EditorOld/config.d.ts.map +0 -1
- package/lib/core/EditorOld/config.js +0 -69
- package/lib/core/EditorOld/index.d.ts +0 -39
- package/lib/core/EditorOld/index.d.ts.map +0 -1
- package/lib/core/EditorOld/index.js +0 -147
- package/lib/core/EditorOld/styles.d.ts +0 -23
- package/lib/core/EditorOld/styles.d.ts.map +0 -1
- package/lib/core/EditorOld/styles.js +0 -65
- package/lib/core/ImageCarousel/index.d.ts +0 -11
- package/lib/core/ImageCarousel/index.d.ts.map +0 -1
- package/lib/core/ImageCarousel/index.js +0 -70
- package/lib/core/ImageCarousel/styles.d.ts +0 -26
- package/lib/core/ImageCarousel/styles.d.ts.map +0 -1
- package/lib/core/ImageCarousel/styles.js +0 -58
- package/lib/enums/ModifierKey.d.ts +0 -12
- package/lib/enums/ModifierKey.d.ts.map +0 -1
- package/lib/enums/ModifierKey.js +0 -13
package/esm/core/Alert/index.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
|
-
import React from 'react';
|
2
|
+
import React, { useRef } from 'react';
|
3
3
|
import { styles } from './styles';
|
4
4
|
import Button from '../Button';
|
5
5
|
import IconClose from '../../icons/General/IconClose';
|
6
|
+
import VisuallyHidden from '../../shared/components/VisuallyHidden';
|
6
7
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
7
8
|
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
8
9
|
const Alert = ({
|
@@ -14,17 +15,46 @@ const Alert = ({
|
|
14
15
|
css,
|
15
16
|
children,
|
16
17
|
className,
|
17
|
-
onClose
|
18
|
+
onClose,
|
19
|
+
...restProps
|
18
20
|
}) => {
|
21
|
+
const ariaLivePolicy = success ? 'polite' : 'assertive';
|
22
|
+
// Random id for aria-describedby
|
23
|
+
const id = Math.random().toString(36).substring(7);
|
24
|
+
const descriptionId = useRef(`aria-describedby-${id}`);
|
25
|
+
const childTextContent = React.Children.toArray(children).filter(child => typeof child === 'string');
|
26
|
+
const getDefaultAriaLabel = () => {
|
27
|
+
if (success) {
|
28
|
+
return 'Suksess';
|
29
|
+
}
|
30
|
+
if (danger) {
|
31
|
+
return 'Fare';
|
32
|
+
}
|
33
|
+
return 'Informasjon';
|
34
|
+
};
|
35
|
+
const accessibilityProps = {
|
36
|
+
role: restProps['role'] || 'alert',
|
37
|
+
'aria-live': ariaLivePolicy,
|
38
|
+
'aria-atomic': restProps['aria-atomic'] || true,
|
39
|
+
'aria-label': restProps['aria-label'] || getDefaultAriaLabel(),
|
40
|
+
'aria-relevant': restProps['aria-relevant'] || 'all',
|
41
|
+
'aria-describedby': descriptionId.current
|
42
|
+
};
|
19
43
|
return _jsxs("div", {
|
20
44
|
css: theme => [styles.default(theme), success && styles.success(theme), info && styles.info(theme), danger && styles.danger(theme), rounded && styles.rounded, primary && styles.primary(theme), css && css],
|
21
45
|
className: className,
|
46
|
+
...restProps,
|
47
|
+
...accessibilityProps,
|
22
48
|
children: [children, onClose && _jsx(Button, {
|
23
49
|
onClick: onClose,
|
24
50
|
nostyle: true,
|
51
|
+
"aria-label": "Lukk",
|
25
52
|
children: _jsx(IconClose, {
|
26
53
|
size: 14
|
27
54
|
})
|
55
|
+
}), _jsx(VisuallyHidden, {
|
56
|
+
id: descriptionId.current,
|
57
|
+
children: childTextContent
|
28
58
|
})]
|
29
59
|
});
|
30
60
|
};
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import AppLoader from '.';
|
2
|
-
|
3
|
-
export default {
|
2
|
+
const meta = {
|
4
3
|
title: 'Core/AppLoader',
|
5
4
|
component: AppLoader
|
6
5
|
};
|
6
|
+
export default meta;
|
7
7
|
export const Default = {
|
8
|
-
render: () => /*#__PURE__*/_jsx(AppLoader, {}),
|
9
8
|
name: 'Default'
|
10
9
|
};
|
@@ -4,10 +4,18 @@ import { styles } from './styles';
|
|
4
4
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
5
5
|
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
6
6
|
const AppLoader = ({
|
7
|
-
color
|
7
|
+
color,
|
8
|
+
...restProps
|
8
9
|
}) => {
|
10
|
+
const accessibilityProps = {
|
11
|
+
role: restProps['role'] || 'status',
|
12
|
+
'aria-live': restProps['aria-live'] || 'polite',
|
13
|
+
'aria-label': restProps['aria-label'] || 'Laster innhold'
|
14
|
+
};
|
9
15
|
return _jsxs("div", {
|
10
16
|
css: theme => [styles.default(theme, color)],
|
17
|
+
...restProps,
|
18
|
+
...accessibilityProps,
|
11
19
|
children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})]
|
12
20
|
});
|
13
21
|
};
|
@@ -2,12 +2,13 @@ import Banner from '.';
|
|
2
2
|
import Header from '../Header';
|
3
3
|
import Button from '../Button';
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
|
5
|
+
const meta = {
|
6
6
|
title: 'Core/Banner',
|
7
7
|
component: Banner
|
8
8
|
};
|
9
|
+
export default meta;
|
9
10
|
export const Default = {
|
10
|
-
|
11
|
+
args: {
|
11
12
|
header: /*#__PURE__*/_jsx(Header, {
|
12
13
|
level: 4,
|
13
14
|
children: "Title"
|
@@ -16,53 +17,60 @@ export const Default = {
|
|
16
17
|
onClick: () => console.log('Hello'),
|
17
18
|
children: "Hello I am button"
|
18
19
|
}),
|
19
|
-
children: "
|
20
|
-
|
20
|
+
children: /*#__PURE__*/_jsx("p", {
|
21
|
+
children: "Eu irure eiusmod amet tempor nisi veniam cupidatat duis nulla dolor. Eiusmod amet sit nostrud adipisicing qui pariatur do et duis fugiat magna laboris elit irure. Officia fugiat incididunt ipsum commodo quis aute qui reprehenderit reprehenderit fugiat. Voluptate quis tempor ea consequat."
|
22
|
+
})
|
23
|
+
},
|
21
24
|
name: 'Default'
|
22
25
|
};
|
23
26
|
export const Success = {
|
24
|
-
|
27
|
+
args: {
|
25
28
|
success: true,
|
26
29
|
header: /*#__PURE__*/_jsx(Header, {
|
27
30
|
level: 4,
|
28
31
|
children: "Title"
|
29
32
|
}),
|
30
|
-
children: "
|
31
|
-
|
33
|
+
children: /*#__PURE__*/_jsx("p", {
|
34
|
+
children: "Eu irure eiusmod amet tempor nisi veniam cupidatat duis nulla dolor. Eiusmod amet sit nostrud adipisicing qui pariatur do et duis fugiat magna laboris elit irure. Officia fugiat incididunt ipsum commodo quis aute qui reprehenderit reprehenderit fugiat. Voluptate quis tempor ea consequat."
|
35
|
+
})
|
36
|
+
},
|
32
37
|
name: 'Success'
|
33
38
|
};
|
34
39
|
export const Info = {
|
35
|
-
|
40
|
+
args: {
|
36
41
|
info: true,
|
37
42
|
header: /*#__PURE__*/_jsx(Header, {
|
38
43
|
level: 4,
|
39
44
|
children: "Title"
|
40
45
|
}),
|
41
|
-
children: "
|
42
|
-
|
43
|
-
|
46
|
+
children: /*#__PURE__*/_jsx("p", {
|
47
|
+
children: "Eu irure eiusmod amet tempor nisi veniam cupidatat duis nulla dolor. Eiusmod amet sit nostrud adipisicing qui pariatur do et duis fugiat magna laboris elit irure. Officia fugiat incididunt ipsum commodo quis aute qui reprehenderit reprehenderit fugiat. Voluptate quis tempor ea consequat."
|
48
|
+
})
|
49
|
+
}
|
44
50
|
};
|
45
51
|
export const Danger = {
|
46
|
-
|
52
|
+
args: {
|
47
53
|
danger: true,
|
48
54
|
header: /*#__PURE__*/_jsx(Header, {
|
49
55
|
level: 4,
|
50
56
|
children: "Title"
|
51
57
|
}),
|
52
|
-
children: "
|
53
|
-
|
58
|
+
children: /*#__PURE__*/_jsx("p", {
|
59
|
+
children: "Eu irure eiusmod amet tempor nisi veniam cupidatat duis nulla dolor. Eiusmod amet sit nostrud adipisicing qui pariatur do et duis fugiat magna laboris elit irure. Officia fugiat incididunt ipsum commodo quis aute qui reprehenderit reprehenderit fugiat. Voluptate quis tempor ea consequat."
|
60
|
+
})
|
61
|
+
},
|
54
62
|
name: 'Danger'
|
55
63
|
};
|
56
64
|
export const WithoutChildren = {
|
57
|
-
|
65
|
+
args: {
|
58
66
|
header: /*#__PURE__*/_jsx(Header, {
|
59
67
|
level: 4,
|
60
|
-
children: "
|
68
|
+
children: "Title"
|
61
69
|
}),
|
62
70
|
actionButton: /*#__PURE__*/_jsx(Button, {
|
63
71
|
onClick: () => console.log('Hello'),
|
64
|
-
children: "
|
72
|
+
children: "Hello I am button"
|
65
73
|
})
|
66
|
-
}
|
74
|
+
},
|
67
75
|
name: 'Without children'
|
68
76
|
};
|
package/esm/core/Banner/index.js
CHANGED
@@ -10,15 +10,18 @@ const Banner = ({
|
|
10
10
|
info,
|
11
11
|
success,
|
12
12
|
header,
|
13
|
-
actionButton
|
13
|
+
actionButton,
|
14
|
+
...restProps
|
14
15
|
}) => {
|
15
16
|
const isDefault = !success && !danger && !info;
|
16
17
|
return _jsx(Alert, {
|
18
|
+
role: "banner",
|
17
19
|
rounded: true,
|
18
20
|
primary: isDefault,
|
19
21
|
success: success,
|
20
22
|
danger: danger,
|
21
23
|
info: info,
|
24
|
+
...restProps,
|
22
25
|
children: _jsxs(Wrapper, {
|
23
26
|
children: [_jsxs(LeftSide, {
|
24
27
|
children: [header, children && _jsx(Content, {
|
@@ -2,22 +2,16 @@ import Header from '../Header';
|
|
2
2
|
import Text from '../Text';
|
3
3
|
import Button from '../Button';
|
4
4
|
import Modal from '.';
|
5
|
+
import { Fragment } from 'react';
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
|
-
|
8
|
+
const meta = {
|
8
9
|
title: 'Core/Modal',
|
9
|
-
component: Modal
|
10
|
-
parameters: {
|
11
|
-
docs: {
|
12
|
-
story: {
|
13
|
-
inline: false,
|
14
|
-
height: '500px'
|
15
|
-
}
|
16
|
-
}
|
17
|
-
}
|
10
|
+
component: Modal
|
18
11
|
};
|
12
|
+
export default meta;
|
19
13
|
export const Default = {
|
20
|
-
|
14
|
+
args: {
|
21
15
|
open: true,
|
22
16
|
onClose: () => console.log('closed'),
|
23
17
|
header: /*#__PURE__*/_jsx(Header, {
|
@@ -36,11 +30,11 @@ export const Default = {
|
|
36
30
|
children: /*#__PURE__*/_jsx(Text, {
|
37
31
|
children: "Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."
|
38
32
|
})
|
39
|
-
}
|
33
|
+
},
|
40
34
|
name: 'Default'
|
41
35
|
};
|
42
36
|
export const Collapse = {
|
43
|
-
|
37
|
+
args: {
|
44
38
|
open: true,
|
45
39
|
onClose: () => console.log('closed'),
|
46
40
|
onCollapse: () => console.log('collapse'),
|
@@ -54,14 +48,13 @@ export const Collapse = {
|
|
54
48
|
children: /*#__PURE__*/_jsx(Text, {
|
55
49
|
children: "Hello there! I am Modal, i can be collapsed, but not in storybook though, it has to be done from parent"
|
56
50
|
})
|
57
|
-
}
|
51
|
+
},
|
58
52
|
name: 'Collapse'
|
59
53
|
};
|
60
54
|
export const Dynamic = {
|
61
|
-
|
55
|
+
args: {
|
62
56
|
open: true,
|
63
57
|
onClose: () => console.log('closed'),
|
64
|
-
width: '600px',
|
65
58
|
header: /*#__PURE__*/_jsx(Header, {
|
66
59
|
level: 3,
|
67
60
|
children: "Her kommer en header"
|
@@ -69,18 +62,17 @@ export const Dynamic = {
|
|
69
62
|
actionButton: /*#__PURE__*/_jsx(Button, {
|
70
63
|
children: "Save changes"
|
71
64
|
}),
|
65
|
+
width: '600px',
|
72
66
|
children: /*#__PURE__*/_jsx(Text, {
|
73
|
-
children: "Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff.
|
67
|
+
children: "Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."
|
74
68
|
})
|
75
|
-
}
|
69
|
+
},
|
76
70
|
name: 'Dynamic'
|
77
71
|
};
|
78
72
|
export const Scrollable = {
|
79
|
-
|
73
|
+
args: {
|
80
74
|
open: true,
|
81
75
|
onClose: () => console.log('closed'),
|
82
|
-
disableScrollableContent: false,
|
83
|
-
width: '100%',
|
84
76
|
header: /*#__PURE__*/_jsx(Header, {
|
85
77
|
level: 3,
|
86
78
|
children: "Scrollable modal"
|
@@ -88,30 +80,55 @@ export const Scrollable = {
|
|
88
80
|
actionButton: /*#__PURE__*/_jsx(Button, {
|
89
81
|
children: "Button is allways shown"
|
90
82
|
}),
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
children: [
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
83
|
+
disableScrollableContent: false,
|
84
|
+
width: '100%',
|
85
|
+
children: /*#__PURE__*/_jsxs(Fragment, {
|
86
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
87
|
+
children: ["Her kommer masse stuff. Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), "Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff.Her kommer masse stuff", /*#__PURE__*/_jsx("br", {}), ".Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her", /*#__PURE__*/_jsx("br", {}), "kommer", /*#__PURE__*/_jsx("br", {}), "masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."]
|
88
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
89
|
+
children: ["Her kommer masse stuff. Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), "Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff.Her kommer masse stuff", /*#__PURE__*/_jsx("br", {}), ".Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her", /*#__PURE__*/_jsx("br", {}), "kommer", /*#__PURE__*/_jsx("br", {}), "masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."]
|
90
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
91
|
+
children: ["Her kommer masse stuff. Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), "Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff.Her kommer masse stuff", /*#__PURE__*/_jsx("br", {}), ".Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her", /*#__PURE__*/_jsx("br", {}), "kommer", /*#__PURE__*/_jsx("br", {}), "masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."]
|
92
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
93
|
+
children: ["Her kommer masse stuff. Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), "Her kommer masse stuff.", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("br", {}), "Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff.Her kommer masse stuff", /*#__PURE__*/_jsx("br", {}), ".Her kommer masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her", /*#__PURE__*/_jsx("br", {}), "kommer", /*#__PURE__*/_jsx("br", {}), "masse", /*#__PURE__*/_jsx("br", {}), "stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff.Her kommer masse stuff. Her kommer masse stuff. Her kommer masse stuff.Her kommer masse stuff."]
|
94
|
+
})]
|
95
|
+
})
|
96
|
+
},
|
101
97
|
name: 'Scrollable'
|
102
98
|
};
|
103
|
-
export const
|
104
|
-
|
99
|
+
export const Accessible = {
|
100
|
+
args: {
|
105
101
|
open: true,
|
106
|
-
toggleFullscreen: true,
|
107
102
|
onClose: () => console.log('closed'),
|
108
103
|
header: /*#__PURE__*/_jsx(Header, {
|
109
104
|
level: 3,
|
110
|
-
children: "
|
105
|
+
children: "Accessible modal"
|
106
|
+
}),
|
107
|
+
actionButton: /*#__PURE__*/_jsx(Button, {
|
108
|
+
children: "Ok"
|
111
109
|
}),
|
112
110
|
children: /*#__PURE__*/_jsx(Text, {
|
113
|
-
children: "
|
114
|
-
})
|
115
|
-
|
116
|
-
|
111
|
+
children: "With some content"
|
112
|
+
}),
|
113
|
+
'aria-label': 'This has a custom label'
|
114
|
+
},
|
115
|
+
name: 'AccessibleModal'
|
116
|
+
};
|
117
|
+
export const Fullscreen = {
|
118
|
+
args: {
|
119
|
+
open: true,
|
120
|
+
onClose: () => console.log('closed'),
|
121
|
+
header: /*#__PURE__*/_jsx(Header, {
|
122
|
+
level: 3,
|
123
|
+
children: "Fullscreen modal"
|
124
|
+
}),
|
125
|
+
actionButton: /*#__PURE__*/_jsx(Button, {
|
126
|
+
children: "Ok"
|
127
|
+
}),
|
128
|
+
children: /*#__PURE__*/_jsx(Text, {
|
129
|
+
children: "With some content"
|
130
|
+
}),
|
131
|
+
toggleFullscreen: true
|
132
|
+
},
|
133
|
+
name: 'Fullscreen'
|
117
134
|
};
|
package/esm/core/Modal/index.js
CHANGED
@@ -28,13 +28,15 @@ function Modal({
|
|
28
28
|
defaultFullscreen,
|
29
29
|
disableFocusTrap,
|
30
30
|
onClose,
|
31
|
-
onCollapse
|
31
|
+
onCollapse,
|
32
|
+
...restProps
|
32
33
|
}) {
|
33
34
|
const modalRef = /*#__PURE__*/createRef();
|
34
35
|
const [isOpen, setOpen] = useState(open);
|
35
36
|
const [headerHeight, setHeaderHeight] = useState(0);
|
36
37
|
const [isFullscreen, setIsFullscreen] = useState(!!defaultFullscreen);
|
37
38
|
const hasCollapse = Boolean(onCollapse);
|
39
|
+
const headerText = header && header?.props?.children || '';
|
38
40
|
const setClose = () => {
|
39
41
|
enableBodyScroll(modalRef.current);
|
40
42
|
if (!disableLocalClose) setOpen(false);
|
@@ -42,11 +44,21 @@ function Modal({
|
|
42
44
|
onClose();
|
43
45
|
}
|
44
46
|
};
|
47
|
+
|
48
|
+
// Capture escape
|
49
|
+
const handleKeyDown = useCallback(event => {
|
50
|
+
if (event.key === 'Escape') {
|
51
|
+
setClose();
|
52
|
+
}
|
53
|
+
}, [setClose]);
|
45
54
|
const handleHeaderRef = useCallback(node => {
|
46
55
|
setHeaderHeight(node?.clientHeight);
|
47
56
|
}, []);
|
48
57
|
useEffect(() => {
|
49
58
|
if (!modalRef.current) return;
|
59
|
+
if (isOpen) {
|
60
|
+
modalRef.current.focus();
|
61
|
+
}
|
50
62
|
if (isOpen && disableScroll) {
|
51
63
|
disableBodyScroll(modalRef.current);
|
52
64
|
if (targetRefs && targetRefs.length > 0) {
|
@@ -63,6 +75,12 @@ function Modal({
|
|
63
75
|
clearAllBodyScrollLocks();
|
64
76
|
};
|
65
77
|
});
|
78
|
+
useEffect(() => {
|
79
|
+
document.addEventListener('keydown', handleKeyDown);
|
80
|
+
return () => {
|
81
|
+
document.removeEventListener('keydown', handleKeyDown);
|
82
|
+
};
|
83
|
+
});
|
66
84
|
const onOutsideClick = () => {
|
67
85
|
if (disableOutsideClick) return;
|
68
86
|
setClose();
|
@@ -75,20 +93,28 @@ function Modal({
|
|
75
93
|
children: _jsx(Overlay, {
|
76
94
|
onClick: onOutsideClick,
|
77
95
|
children: _jsxs(Content, {
|
96
|
+
role: "dialog",
|
97
|
+
"aria-modal": "true",
|
98
|
+
"aria-label": restProps['aria-label'] ?? header ? headerText.toString() : 'Modal',
|
78
99
|
width: width,
|
79
100
|
isFullscreen: isFullscreen,
|
80
101
|
canToggleFullscreen: !!toggleFullscreen,
|
81
102
|
onClick: e => e.stopPropagation(),
|
103
|
+
...restProps,
|
82
104
|
children: [(!hideCloseButton || hasCollapse || toggleFullscreen) && _jsxs(CloseWrapper, {
|
83
105
|
children: [hasCollapse && _jsx(Button, {
|
84
106
|
nostyle: true,
|
85
107
|
onClick: onCollapse,
|
86
108
|
focusable: true,
|
109
|
+
"aria-label": hasCollapse && 'Minimer',
|
110
|
+
title: "Minimer",
|
87
111
|
children: _jsx(IconMinus, {})
|
88
112
|
}), toggleFullscreen && _jsx(Button, {
|
89
113
|
nostyle: true,
|
90
114
|
onClick: () => setIsFullscreen(!isFullscreen),
|
91
115
|
focusable: true,
|
116
|
+
"aria-label": isFullscreen ? 'Lukk fullskjerm' : 'Fullskjerm',
|
117
|
+
title: isFullscreen ? 'Lukk fullskjerm' : 'Fullskjerm',
|
92
118
|
children: isFullscreen ? _jsx(IconFullscreenClose, {
|
93
119
|
size: "20px"
|
94
120
|
}) : _jsx(IconFullscreenOpen, {
|
@@ -98,6 +124,8 @@ function Modal({
|
|
98
124
|
nostyle: true,
|
99
125
|
onClick: setClose,
|
100
126
|
focusable: true,
|
127
|
+
"aria-label": "Lukk",
|
128
|
+
title: "Lukk",
|
101
129
|
children: _jsx(IconClose, {})
|
102
130
|
})]
|
103
131
|
}), _jsx(HeaderWrapper, {
|
package/esm/index.js
CHANGED
@@ -197,6 +197,7 @@ import IllustrationMySiteDashboard from './illustrations/MySite/IllustrationMySi
|
|
197
197
|
import IllustrationMySiteCooperative from './illustrations/MySite/IllustrationMySiteCooperative';
|
198
198
|
import IllustrationMySiteAssociation from './illustrations/MySite/IllustrationMySiteAssociation';
|
199
199
|
import IllustrationMySiteMailbox from './illustrations/MySite/IllustrationMySiteMailbox';
|
200
|
+
import VisuallyHidden from './shared/components/VisuallyHidden';
|
200
201
|
import Html from './core/Html';
|
201
202
|
import CustomText from './core/CustomText';
|
202
203
|
import Select from './core/Select';
|
@@ -313,4 +314,4 @@ export { getFormatedPhone } from './utils/phone';
|
|
313
314
|
export { getCurrentPage, getFirstButtonIndex, getHasMorePages, getHasPreviousPages, getSkippedItems } from './utils/pagination';
|
314
315
|
export { handleDateToStringConvertion, handleStringToDateConvertion, getTimeFromHours, getTimeStringFromHours } from './utils/time';
|
315
316
|
export { getFormattedPrice, getFormattedPriceWithEnding, getFormattedDate, getTitleString, getFormattedCardNumber, getFormattedTime, getFormattedOrganizationNumber, getFormattedDateTimePretty, getFormattedTimePeriod } from './utils/format';
|
316
|
-
export { Topbar, Layout, LayoutShell, AppShell, AppLoader, Alert, Button, Card, Divider, Dropdown, Header, Input, Image, Checkbox, Link, List, ListItem, Tag, Text, Footer, FooterCol, FooterGroup, FooterLabel, FooterLink, FooterButton, Radio, Skeleton, Html, CustomText, Select, SearchSelect, Option, UserMenu, UserMenuOption, Modal, MediaCarousel, NotificationsMenu, NotificationRow, Table, Cell, Row, FileInput, Datepicker, DatepickerRange, Menu, AppPicker, MainMenu, MenuItem, MenuTop, SecondaryMenu, SecondaryMenuItem, MenuSpacer, Submenu, SubmenuItem, PreemptionCard, PreemptionCardLoading, PieChart, SimpleBarChart, SimpleLineChart, BarAndLineComposedChart, BarChartWithCustomizedEvent, IconApartment, IconArchives, IconArea, IconChoice, IconReply, IconReplyAll, IconForward, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowUp, IconAttachment, IconBack, IconBath, IconBoard, IconBookmarkOutline, IconBookmarkFilled, IconBus, IconBlock, IconCar, IconCaretDown, IconCaretLeft, IconCaretUp, IconCases, IconCaretRight, IconCheck, IconCheckedOutline, IconCheckedFilled, IconChevronLeft, IconChevronRight, IconChevronDown, IconClose, IconCloseAlt, IconComment, IconCompanyBuilding, IconDelete, IconDoor, IconDotFilled, IconDotOutline, IconDownload, IconDraft, IconElevator, IconErrorOutline, IconErrorFilled, IconExternalLink, IconEye, IconEyeDeny, IconFamily, IconFerry, IconFile, IconFileEdit, IconFileAdd, IconFileExcel, IconFilePDF, IconFileWord, IconFillOut, IconFloor, IconGarage, IconGrid, IconGym, IconHearth, IconHearthOutline, IconHelp, IconHistory, IconHouse, IconHomeFilled, IconHomeOutline, IconHouseBlockFilled, IconHouseBlockOutline, IconHumans, IconImportantComment, IconInbox, IconLabel, IconJointcost, IconJointcost2, IconKey, IconKitchen, IconLeafFilled, IconLeafOutline, IconLeisureTime, IconLock, IconLockLocked, IconLockOpen, IconMap, IconMail, IconMenu, IconMinus, IconMoney, IconPinned, IconParking, IconPaymentCard, IconPlus, IconPortalUser, IconReciept, IconRedo, IconRefresh, IconRoom, IconSave, IconSearch, IconSend, IconSettings, IconShopping, IconSign, IconStarFilled, IconStarHalf, IconStarOutline, IconStore, IconSubway, IconSwitch, IconSliders, IconTrain, IconTram, IconPrint, IconTransport, IconTypeOfBuilding, IconTypeOfBuildingOutline, IconUpload, IconUser, IconUserThin, IconVote, IconWalk, IconWarning, IconWarningBell, IconZip, IconSort, IconFilterList, IconBellOutline, IconPlusAlt, IconPhone, IconHouseOutline, IconMembership, IconMembershipFilled, IconCalendar, IconInfoOutline, IconInfoFilled, IconCamera, IllustrationHouse, IllustrationHighHouseComposition, IllustrationHighHouse, IllustrationHouseComposition, IllustrationLowHouse, IllustrationLowHouseComposition, IllustrationSemiDetachedHouse, IllustrationSemiDetachedHouseComposition, IllustrationSmallHouse, IllustrationSmallHouseComposition, IllustrationTerraceBlock, IllustrationTerraceBlockComposition, IllustrationTownHouse, IllustrationTownHouseComposition, IllustrationHousesBackground, IllustrationHousesBackgroundWithComposition, IllustrationHouseMissing, IllustrationError, IllustrationErrorGeneric, IllustrationPaperCompleted, IllustrationPaperMissing, IllustrationMySiteBuilding, IllustrationMySiteCoffeeBook, IllustrationMySiteComputer, IllustrationMySiteGift, IllustrationMySitePapers, IllustrationMySitePiggyBank, IllustrationMySiteDashboard, IllustrationMySiteAssociation, IllustrationMySiteCooperative, IllustrationMySiteMailbox, IllustrationMySiteTransfer, IconCommunication, IconCommunicationFilled, IconCompanyBuildingOutline, IconCompanyBuildingFilled, IconDashboard, IconDashboardFilled, IconEconomy, IconEconomyFilled, IconWork, IconWorkFilled, IconProfile, IconProfileFilled, IconLookup, IconLookupFilled, IconDocument, IconDocumentFilled, IconEarth, IconEdit, IconMinusAlt, IconMinusAltFilled, IconUndo, IconVisa, IconMasterCard, IconBankAxept, IconAmericanExpress, IconFileCopy, IconBblFlame, IconBblWater, IconBblShield, IconFullscreenOpen, IconFullscreenClose, IconGmail, IconOffice365, IconAuditorFilled, IconAuditorOutline, IconJanitorFilled, IconJanitorOutline, useScreenOrientation, Box, Textarea, InfoButton, CommentsTimeline, CommentLine, HeaderCell, RowCell, TableHeader, TableRow, BoxedTable, DraggableRow, CollapseList, CollapseListItem, Banner, Calendar, YearWheel, DropdownMenu, DropdownMenuOption, Timeline, Timepicker, TimelineStep, HighlightText, TabBar, TabItem, Editor, TabNav, Video, TabNavItem, NoticeCard, ListPager, Spinner, Autocomplete, GoogleButton, NotificationCounter, SearchFilter, ImagePicker, Tooltip, ImageViewer };
|
317
|
+
export { Topbar, Layout, LayoutShell, AppShell, AppLoader, Alert, Button, Card, Divider, Dropdown, Header, Input, Image, Checkbox, Link, List, ListItem, Tag, Text, Footer, FooterCol, FooterGroup, FooterLabel, FooterLink, FooterButton, Radio, Skeleton, Html, CustomText, Select, SearchSelect, Option, UserMenu, UserMenuOption, Modal, MediaCarousel, NotificationsMenu, NotificationRow, Table, Cell, Row, FileInput, Datepicker, DatepickerRange, Menu, AppPicker, MainMenu, MenuItem, MenuTop, SecondaryMenu, SecondaryMenuItem, MenuSpacer, Submenu, SubmenuItem, PreemptionCard, PreemptionCardLoading, PieChart, SimpleBarChart, SimpleLineChart, BarAndLineComposedChart, BarChartWithCustomizedEvent, IconApartment, IconArchives, IconArea, IconChoice, IconReply, IconReplyAll, IconForward, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowUp, IconAttachment, IconBack, IconBath, IconBoard, IconBookmarkOutline, IconBookmarkFilled, IconBus, IconBlock, IconCar, IconCaretDown, IconCaretLeft, IconCaretUp, IconCases, IconCaretRight, IconCheck, IconCheckedOutline, IconCheckedFilled, IconChevronLeft, IconChevronRight, IconChevronDown, IconClose, IconCloseAlt, IconComment, IconCompanyBuilding, IconDelete, IconDoor, IconDotFilled, IconDotOutline, IconDownload, IconDraft, IconElevator, IconErrorOutline, IconErrorFilled, IconExternalLink, IconEye, IconEyeDeny, IconFamily, IconFerry, IconFile, IconFileEdit, IconFileAdd, IconFileExcel, IconFilePDF, IconFileWord, IconFillOut, IconFloor, IconGarage, IconGrid, IconGym, IconHearth, IconHearthOutline, IconHelp, IconHistory, IconHouse, IconHomeFilled, IconHomeOutline, IconHouseBlockFilled, IconHouseBlockOutline, IconHumans, IconImportantComment, IconInbox, IconLabel, IconJointcost, IconJointcost2, IconKey, IconKitchen, IconLeafFilled, IconLeafOutline, IconLeisureTime, IconLock, IconLockLocked, IconLockOpen, IconMap, IconMail, IconMenu, IconMinus, IconMoney, IconPinned, IconParking, IconPaymentCard, IconPlus, IconPortalUser, IconReciept, IconRedo, IconRefresh, IconRoom, IconSave, IconSearch, IconSend, IconSettings, IconShopping, IconSign, IconStarFilled, IconStarHalf, IconStarOutline, IconStore, IconSubway, IconSwitch, IconSliders, IconTrain, IconTram, IconPrint, IconTransport, IconTypeOfBuilding, IconTypeOfBuildingOutline, IconUpload, IconUser, IconUserThin, IconVote, IconWalk, IconWarning, IconWarningBell, IconZip, IconSort, IconFilterList, IconBellOutline, IconPlusAlt, IconPhone, IconHouseOutline, IconMembership, IconMembershipFilled, IconCalendar, IconInfoOutline, IconInfoFilled, IconCamera, IllustrationHouse, IllustrationHighHouseComposition, IllustrationHighHouse, IllustrationHouseComposition, IllustrationLowHouse, IllustrationLowHouseComposition, IllustrationSemiDetachedHouse, IllustrationSemiDetachedHouseComposition, IllustrationSmallHouse, IllustrationSmallHouseComposition, IllustrationTerraceBlock, IllustrationTerraceBlockComposition, IllustrationTownHouse, IllustrationTownHouseComposition, IllustrationHousesBackground, IllustrationHousesBackgroundWithComposition, IllustrationHouseMissing, IllustrationError, IllustrationErrorGeneric, IllustrationPaperCompleted, IllustrationPaperMissing, IllustrationMySiteBuilding, IllustrationMySiteCoffeeBook, IllustrationMySiteComputer, IllustrationMySiteGift, IllustrationMySitePapers, IllustrationMySitePiggyBank, IllustrationMySiteDashboard, IllustrationMySiteAssociation, IllustrationMySiteCooperative, IllustrationMySiteMailbox, IllustrationMySiteTransfer, IconCommunication, IconCommunicationFilled, IconCompanyBuildingOutline, IconCompanyBuildingFilled, IconDashboard, IconDashboardFilled, IconEconomy, IconEconomyFilled, IconWork, IconWorkFilled, IconProfile, IconProfileFilled, IconLookup, IconLookupFilled, IconDocument, IconDocumentFilled, IconEarth, IconEdit, IconMinusAlt, IconMinusAltFilled, IconUndo, IconVisa, IconMasterCard, IconBankAxept, IconAmericanExpress, IconFileCopy, IconBblFlame, IconBblWater, IconBblShield, IconFullscreenOpen, IconFullscreenClose, IconGmail, IconOffice365, IconAuditorFilled, IconAuditorOutline, IconJanitorFilled, IconJanitorOutline, VisuallyHidden, useScreenOrientation, Box, Textarea, InfoButton, CommentsTimeline, CommentLine, HeaderCell, RowCell, TableHeader, TableRow, BoxedTable, DraggableRow, CollapseList, CollapseListItem, Banner, Calendar, YearWheel, DropdownMenu, DropdownMenuOption, Timeline, Timepicker, TimelineStep, HighlightText, TabBar, TabItem, Editor, TabNav, Video, TabNavItem, NoticeCard, ListPager, Spinner, Autocomplete, GoogleButton, NotificationCounter, SearchFilter, ImagePicker, Tooltip, ImageViewer };
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
3
|
+
/**
|
4
|
+
* Used with aria-describedby to hide text visually, but not from screen readers
|
5
|
+
* @link https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
6
|
+
**/
|
7
|
+
|
8
|
+
const VisuallyHidden = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
9
|
+
target: "esqcxxz0"
|
10
|
+
} : {
|
11
|
+
target: "esqcxxz0",
|
12
|
+
label: "VisuallyHidden"
|
13
|
+
})(process.env.NODE_ENV === "production" ? {
|
14
|
+
name: "1dja9su",
|
15
|
+
styles: "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0"
|
16
|
+
} : {
|
17
|
+
name: "1dja9su",
|
18
|
+
styles: "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0",
|
19
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wYWNrYWdlcy9zaGFyZWQvY29tcG9uZW50cy9WaXN1YWxseUhpZGRlbi9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBT2lDIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy9wYWNrYWdlcy9zaGFyZWQvY29tcG9uZW50cy9WaXN1YWxseUhpZGRlbi9pbmRleC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuLyoqXG4gKiBVc2VkIHdpdGggYXJpYS1kZXNjcmliZWRieSB0byBoaWRlIHRleHQgdmlzdWFsbHksIGJ1dCBub3QgZnJvbSBzY3JlZW4gcmVhZGVyc1xuICogQGxpbmsgaHR0cHM6Ly9zbm9vay5jYS9hcmNoaXZlcy9odG1sX2FuZF9jc3MvaGlkaW5nLWNvbnRlbnQtZm9yLWFjY2Vzc2liaWxpdHlcbiAqKi9cblxuY29uc3QgVmlzdWFsbHlIaWRkZW4gPSBzdHlsZWQuZGl2YFxuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHdpZHRoOiAxcHg7XG4gIGhlaWdodDogMXB4O1xuICBwYWRkaW5nOiAwO1xuICBtYXJnaW46IC0xcHg7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIGNsaXA6IHJlY3QoMCwgMCwgMCwgMCk7XG4gIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gIGJvcmRlcjogMDtcbmBcbmV4cG9ydCBkZWZhdWx0IFZpc3VhbGx5SGlkZGVuXG4iXX0= */",
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
21
|
+
});
|
22
|
+
export default VisuallyHidden;
|
@@ -1,24 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
export
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
export declare const
|
9
|
-
|
10
|
-
|
11
|
-
};
|
12
|
-
export declare const Info: {
|
13
|
-
render: () => import("react").JSX.Element;
|
14
|
-
name: string;
|
15
|
-
};
|
16
|
-
export declare const Danger: {
|
17
|
-
render: () => import("react").JSX.Element;
|
18
|
-
name: string;
|
19
|
-
};
|
20
|
-
export declare const WithoutClose: {
|
21
|
-
render: () => import("react").JSX.Element;
|
22
|
-
name: string;
|
23
|
-
};
|
1
|
+
import Alert from '.';
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
3
|
+
declare const meta: Meta<typeof Alert>;
|
4
|
+
export default meta;
|
5
|
+
declare type Story = StoryObj<typeof Alert>;
|
6
|
+
export declare const Default: Story;
|
7
|
+
export declare const Success: Story;
|
8
|
+
export declare const Info: Story;
|
9
|
+
export declare const Danger: Story;
|
10
|
+
export declare const WithoutClose: Story;
|
24
11
|
//# sourceMappingURL=Alert.stories.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Alert.stories.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Alert/Alert.stories.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Alert.stories.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Alert/Alert.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,GAAG,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAGpB,CAAA;AAET,eAAe,IAAI,CAAA;AAEnB,aAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAA;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAOpB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAA"}
|
@@ -1,43 +1,43 @@
|
|
1
1
|
import Alert from '.';
|
2
|
-
|
3
|
-
export default {
|
2
|
+
const meta = {
|
4
3
|
title: 'Core/Alert',
|
5
4
|
component: Alert
|
6
5
|
};
|
6
|
+
export default meta;
|
7
7
|
export const Default = {
|
8
|
-
|
8
|
+
args: {
|
9
9
|
onClose: () => console.log('close'),
|
10
|
-
children:
|
11
|
-
}
|
10
|
+
children: 'Here is some general information.'
|
11
|
+
},
|
12
12
|
name: 'Default'
|
13
13
|
};
|
14
14
|
export const Success = {
|
15
|
-
|
15
|
+
args: {
|
16
16
|
success: true,
|
17
17
|
onClose: () => console.log('close'),
|
18
|
-
children:
|
19
|
-
}
|
18
|
+
children: 'Thank you for feedback!'
|
19
|
+
},
|
20
20
|
name: 'Success'
|
21
21
|
};
|
22
22
|
export const Info = {
|
23
|
-
|
23
|
+
args: {
|
24
24
|
info: true,
|
25
25
|
onClose: () => console.log('close'),
|
26
|
-
children:
|
27
|
-
}
|
26
|
+
children: 'The service is down between 23:00 - 05:00.'
|
27
|
+
},
|
28
28
|
name: 'Info'
|
29
29
|
};
|
30
30
|
export const Danger = {
|
31
|
-
|
31
|
+
args: {
|
32
32
|
danger: true,
|
33
33
|
onClose: () => console.log('close'),
|
34
|
-
children:
|
35
|
-
}
|
34
|
+
children: 'There has been a mistake. Could not reach service.'
|
35
|
+
},
|
36
36
|
name: 'Danger'
|
37
37
|
};
|
38
38
|
export const WithoutClose = {
|
39
|
-
|
40
|
-
children:
|
41
|
-
}
|
39
|
+
args: {
|
40
|
+
children: 'Here is some general information.'
|
41
|
+
},
|
42
42
|
name: 'Without close'
|
43
43
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
2
|
import React from 'react';
|
3
3
|
import type { SerializedStyles } from '@emotion/react';
|
4
|
-
|
4
|
+
import { AccessibilityProps } from '../../shared/types/Accessibility';
|
5
|
+
interface IProps extends AccessibilityProps {
|
5
6
|
/** Primary theme style */
|
6
7
|
primary?: boolean;
|
7
8
|
/** Success alert */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Alert/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Alert/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAiB,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAItD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAGrE,UAAU,MAAO,SAAQ,kBAAkB;IACzC,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wBAAwB;IACxB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,uBAAuB;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,GAAG,CAAC,EAAE,gBAAgB,CAAA;IACtB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,eAAe;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAA;CAC/C;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAiE3B,CAAA;AAED,eAAe,KAAK,CAAA"}
|