@entur/modal 1.7.73-beta.3 → 1.7.73-beta.4
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/dist/Drawer.d.ts +29 -0
- package/dist/Modal.d.ts +28 -0
- package/dist/ModalContent.d.ts +24 -0
- package/dist/ModalOverlay.d.ts +15 -0
- package/dist/index.d.ts +5 -189
- package/dist/index.js +8 -0
- package/dist/modal.cjs.development.js +181 -0
- package/dist/modal.cjs.development.js.map +1 -0
- package/dist/modal.cjs.production.min.js +2 -0
- package/dist/modal.cjs.production.min.js.map +1 -0
- package/dist/modal.esm.js +150 -142
- package/dist/modal.esm.js.map +1 -1
- package/dist/styles.css +146 -143
- package/package.json +19 -29
- package/dist/modal.cjs.js +0 -165
- package/dist/modal.cjs.js.map +0 -1
package/dist/modal.esm.js
CHANGED
|
@@ -1,165 +1,173 @@
|
|
|
1
|
-
import { useRandomId, warnAboutMissingStyles } from
|
|
2
|
-
import
|
|
3
|
-
import { CloseIcon } from
|
|
4
|
-
import { IconButton } from
|
|
5
|
-
import {
|
|
6
|
-
import classNames from
|
|
7
|
-
import { DialogOverlay, DialogContent } from
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { useRandomId, warnAboutMissingStyles } from '@entur/utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CloseIcon } from '@entur/icons';
|
|
4
|
+
import { IconButton } from '@entur/button';
|
|
5
|
+
import { Heading4, Heading3, Heading2 } from '@entur/typography';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { DialogOverlay, DialogContent } from '@reach/dialog';
|
|
8
|
+
import { MoveFocusInside } from 'react-focus-lock';
|
|
9
|
+
import { Contrast } from '@entur/layout';
|
|
10
|
+
|
|
11
|
+
function _extends() {
|
|
12
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
13
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
14
|
+
var t = arguments[e];
|
|
15
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}, _extends.apply(null, arguments);
|
|
19
|
+
}
|
|
20
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
21
|
+
if (null == r) return {};
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
24
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
25
|
+
t[n] = r[n];
|
|
21
26
|
}
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var _excluded$2 = ["className", "open"];
|
|
31
|
+
var ModalOverlay = function ModalOverlay(_ref) {
|
|
32
|
+
var className = _ref.className,
|
|
33
|
+
open = _ref.open,
|
|
34
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
35
|
+
return React.createElement(DialogOverlay, _extends({
|
|
36
|
+
className: classNames('eds-modal__overlay', className),
|
|
37
|
+
isOpen: open
|
|
38
|
+
}, rest));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var _excluded$1 = ["children", "className", "size", "title", "align"];
|
|
42
|
+
var headingsMap = {
|
|
24
43
|
extraSmall: Heading4,
|
|
25
44
|
small: Heading3,
|
|
26
45
|
medium: Heading2,
|
|
27
46
|
large: Heading2,
|
|
28
47
|
extraLarge: Heading2
|
|
29
48
|
};
|
|
30
|
-
|
|
31
|
-
children,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
"aria-labelledby": randomId,
|
|
50
|
-
...rest,
|
|
51
|
-
children: [
|
|
52
|
-
title && /* @__PURE__ */ jsx(Heading, { margin: "bottom", as: "h2", id: randomId, children: title }),
|
|
53
|
-
children
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
);
|
|
49
|
+
var ModalContent = function ModalContent(_ref) {
|
|
50
|
+
var children = _ref.children,
|
|
51
|
+
className = _ref.className,
|
|
52
|
+
size = _ref.size,
|
|
53
|
+
title = _ref.title,
|
|
54
|
+
_ref$align = _ref.align,
|
|
55
|
+
align = _ref$align === void 0 ? 'start' : _ref$align,
|
|
56
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
57
|
+
var Heading = headingsMap[size] || Heading2;
|
|
58
|
+
var randomId = useRandomId('eds-modal');
|
|
59
|
+
return React.createElement(DialogContent, _extends({
|
|
60
|
+
className: classNames('eds-modal__content', "eds-modal__content--size-" + size, "eds-modal__content--align-" + align, className),
|
|
61
|
+
"aria-labelledby": randomId
|
|
62
|
+
}, rest), title && React.createElement(Heading, {
|
|
63
|
+
margin: "bottom",
|
|
64
|
+
as: "h2",
|
|
65
|
+
id: randomId
|
|
66
|
+
}, title), children);
|
|
57
67
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
|
|
69
|
+
var _excluded = ["children", "closeLabel", "initialFocusRef", "open", "onDismiss", "size", "align", "title", "closeOnClickOutside"];
|
|
70
|
+
var Modal = function Modal(_ref) {
|
|
71
|
+
var children = _ref.children,
|
|
72
|
+
_ref$closeLabel = _ref.closeLabel,
|
|
73
|
+
closeLabel = _ref$closeLabel === void 0 ? 'Lukk' : _ref$closeLabel,
|
|
74
|
+
initialFocusRef = _ref.initialFocusRef,
|
|
75
|
+
open = _ref.open,
|
|
76
|
+
onDismiss = _ref.onDismiss,
|
|
77
|
+
size = _ref.size,
|
|
78
|
+
_ref$align = _ref.align,
|
|
79
|
+
align = _ref$align === void 0 ? 'start' : _ref$align,
|
|
80
|
+
title = _ref.title,
|
|
81
|
+
_ref$closeOnClickOuts = _ref.closeOnClickOutside,
|
|
82
|
+
closeOnClickOutside = _ref$closeOnClickOuts === void 0 ? true : _ref$closeOnClickOuts,
|
|
83
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
84
|
+
var randomId = useRandomId('eds-modal');
|
|
85
|
+
var Heading = headingsMap[size] || Heading2;
|
|
86
|
+
var showCloseButton = ['medium', 'large', 'extraLarge'].includes(size);
|
|
87
|
+
var handleOnDismiss;
|
|
74
88
|
if (onDismiss && closeOnClickOutside) {
|
|
75
89
|
handleOnDismiss = onDismiss;
|
|
76
90
|
}
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
title && /* @__PURE__ */ jsx(Heading, { margin: "bottom", as: "h2", id: randomId, children: title }),
|
|
95
|
-
children
|
|
96
|
-
] })
|
|
97
|
-
}
|
|
98
|
-
);
|
|
91
|
+
return React.createElement(ModalOverlay, {
|
|
92
|
+
open: open,
|
|
93
|
+
onDismiss: handleOnDismiss,
|
|
94
|
+
initialFocusRef: initialFocusRef
|
|
95
|
+
}, React.createElement(ModalContent, _extends({
|
|
96
|
+
size: size,
|
|
97
|
+
align: align
|
|
98
|
+
}, rest), showCloseButton && React.createElement(IconButton, {
|
|
99
|
+
className: "eds-modal__close",
|
|
100
|
+
"aria-label": closeLabel,
|
|
101
|
+
onClick: onDismiss,
|
|
102
|
+
type: "button"
|
|
103
|
+
}, React.createElement(CloseIcon, null)), title && React.createElement(Heading, {
|
|
104
|
+
margin: "bottom",
|
|
105
|
+
as: "h2",
|
|
106
|
+
id: randomId
|
|
107
|
+
}, title), children));
|
|
99
108
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
|
|
110
|
+
var Drawer = function Drawer(_ref) {
|
|
111
|
+
var children = _ref.children,
|
|
112
|
+
className = _ref.className,
|
|
113
|
+
_ref$closeLabel = _ref.closeLabel,
|
|
114
|
+
closeLabel = _ref$closeLabel === void 0 ? 'Lukk skuff' : _ref$closeLabel,
|
|
115
|
+
_ref$contrast = _ref.contrast,
|
|
116
|
+
contrast = _ref$contrast === void 0 ? false : _ref$contrast,
|
|
117
|
+
_ref$open = _ref.open,
|
|
118
|
+
open = _ref$open === void 0 ? true : _ref$open,
|
|
119
|
+
onDismiss = _ref.onDismiss,
|
|
120
|
+
title = _ref.title,
|
|
121
|
+
style = _ref.style,
|
|
122
|
+
_ref$overlay = _ref.overlay,
|
|
123
|
+
overlay = _ref$overlay === void 0 ? false : _ref$overlay;
|
|
124
|
+
var titleId = useRandomId('eds-drawer');
|
|
112
125
|
if (!open) {
|
|
113
126
|
return null;
|
|
114
127
|
}
|
|
115
|
-
|
|
116
|
-
if (e.key ===
|
|
128
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
129
|
+
if (e.key === 'Escape') {
|
|
117
130
|
e.stopPropagation();
|
|
118
131
|
onDismiss();
|
|
119
132
|
}
|
|
120
133
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{
|
|
131
|
-
"aria-labelledby": titleId,
|
|
132
|
-
className: classNames("eds-drawer", className),
|
|
133
|
-
onKeyDown: handleKeyDown,
|
|
134
|
-
style,
|
|
135
|
-
children: /* @__PURE__ */ jsxs(MoveFocusInside, { children: [
|
|
136
|
-
/* @__PURE__ */ jsx(
|
|
137
|
-
IconButton,
|
|
138
|
-
{
|
|
139
|
-
className: "eds-drawer__close-button",
|
|
140
|
-
onClick: onDismiss,
|
|
141
|
-
type: "button",
|
|
142
|
-
"aria-label": closeLabel,
|
|
143
|
-
children: /* @__PURE__ */ jsx(CloseIcon, { "aria-hidden": true })
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
/* @__PURE__ */ jsxs("div", { className: "eds-drawer__content", children: [
|
|
147
|
-
/* @__PURE__ */ jsx(Heading3, { as: "h2", id: titleId, children: title }),
|
|
148
|
-
children
|
|
149
|
-
] })
|
|
150
|
-
] })
|
|
151
|
-
}
|
|
152
|
-
) })
|
|
134
|
+
var Wrapper = contrast ? Contrast : React.Fragment;
|
|
135
|
+
var ContentContainer = overlay ? DialogContent : 'div';
|
|
136
|
+
return React.createElement(ConditionalWrapper, {
|
|
137
|
+
condition: overlay,
|
|
138
|
+
wrapper: function wrapper(children) {
|
|
139
|
+
return React.createElement(ModalOverlay, {
|
|
140
|
+
open: open,
|
|
141
|
+
onDismiss: onDismiss
|
|
142
|
+
}, children);
|
|
153
143
|
}
|
|
154
|
-
|
|
144
|
+
}, React.createElement(Wrapper, null, React.createElement(ContentContainer, {
|
|
145
|
+
"aria-labelledby": titleId,
|
|
146
|
+
className: classNames('eds-drawer', className),
|
|
147
|
+
onKeyDown: handleKeyDown,
|
|
148
|
+
style: style
|
|
149
|
+
}, React.createElement(MoveFocusInside, null, React.createElement(IconButton, {
|
|
150
|
+
className: "eds-drawer__close-button",
|
|
151
|
+
onClick: onDismiss,
|
|
152
|
+
type: "button",
|
|
153
|
+
"aria-label": closeLabel
|
|
154
|
+
}, React.createElement(CloseIcon, {
|
|
155
|
+
"aria-hidden": true
|
|
156
|
+
})), React.createElement("div", {
|
|
157
|
+
className: "eds-drawer__content"
|
|
158
|
+
}, React.createElement(Heading3, {
|
|
159
|
+
as: "h2",
|
|
160
|
+
id: titleId
|
|
161
|
+
}, title), children)))));
|
|
155
162
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
ModalContent,
|
|
162
|
-
ModalOverlay,
|
|
163
|
-
headingsMap
|
|
163
|
+
var ConditionalWrapper = function ConditionalWrapper(_ref2) {
|
|
164
|
+
var condition = _ref2.condition,
|
|
165
|
+
wrapper = _ref2.wrapper,
|
|
166
|
+
children = _ref2.children;
|
|
167
|
+
return condition ? wrapper(children) : children;
|
|
164
168
|
};
|
|
169
|
+
|
|
170
|
+
warnAboutMissingStyles('modal', 'icons', 'typography', 'a11y', 'button');
|
|
171
|
+
|
|
172
|
+
export { Drawer, Modal, ModalContent, ModalOverlay, headingsMap };
|
|
165
173
|
//# sourceMappingURL=modal.esm.js.map
|
package/dist/modal.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.esm.js","sources":["../src/ModalOverlay.tsx","../src/ModalContent.tsx","../src/Modal.tsx","../src/Drawer.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { DialogOverlay } from '@reach/dialog';\n\nexport type ModalOverlayProps = {\n /** Flagg som sier om modalen er åpen */\n open?: boolean;\n /** Callback som kalles når brukeren ber om å lukke modalen */\n onDismiss?: () => void;\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** En ref til elementet som skal være fokusert når modalen åpnes. Defaulter til lukkeknappen */\n initialFocusRef?: React.RefObject<HTMLElement>;\n [key: string]: any;\n};\n\nexport const ModalOverlay: React.FC<ModalOverlayProps> = ({\n className,\n open,\n ...rest\n}) => (\n <DialogOverlay\n className={classNames('eds-modal__overlay', className)}\n isOpen={open}\n {...rest}\n />\n);\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DialogContent } from '@reach/dialog';\nimport { Heading4, Heading3, Heading2 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\n\nexport type ModalContentProps = {\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelsen på modalen */\n size: 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';\n /** Tittelen som vises i modalen */\n title?: React.ReactNode;\n /** Hvordan innholdet skal plasseres i modalen\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end';\n [key: string]: any;\n};\n\nexport const headingsMap = {\n extraSmall: Heading4,\n small: Heading3,\n medium: Heading2,\n large: Heading2,\n extraLarge: Heading2,\n};\n\nexport const ModalContent: React.FC<ModalContentProps> = ({\n children,\n className,\n size,\n title,\n align = 'start',\n ...rest\n}) => {\n const Heading: React.ElementType = headingsMap[size] || Heading2;\n const randomId = useRandomId('eds-modal');\n return (\n <DialogContent\n className={classNames(\n 'eds-modal__content',\n `eds-modal__content--size-${size}`,\n `eds-modal__content--align-${align}`,\n className,\n )}\n aria-labelledby={randomId}\n {...rest}\n >\n {title && (\n <Heading margin=\"bottom\" as=\"h2\" id={randomId}>\n {title}\n </Heading>\n )}\n {children}\n </DialogContent>\n );\n};\n","import React from 'react';\n\nimport { CloseIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Heading2 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\n\nimport { ModalOverlay } from './ModalOverlay';\nimport { ModalContent, headingsMap } from './ModalContent';\n\nimport './Modal.scss';\n\nexport type ModalProps = {\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Skjermleser-label til lukk-knappen */\n closeLabel?: string;\n /** En ref til elementet som skal være fokusert når modalen åpnes. Defaulter til lukkeknappen */\n initialFocusRef?: React.RefObject<HTMLElement>;\n /** Flagg som sier om modalen er åpen */\n open?: boolean;\n /** Callback som kalles når brukeren ber om å lukke modalen */\n onDismiss?: () => void;\n /** Størrelsen på modalen */\n size: 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';\n /** Hvordan innholdet skal plasseres i modalen\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end';\n /** Tittelen som vises i modalen */\n title?: React.ReactNode;\n /** Om modalen skal lukkes når man klikker på utsiden av den\n * @default true\n */\n closeOnClickOutside?: boolean;\n [key: string]: any;\n};\n\nexport const Modal: React.FC<ModalProps> = ({\n children,\n closeLabel = 'Lukk',\n initialFocusRef,\n open,\n onDismiss,\n size,\n align = 'start',\n title,\n closeOnClickOutside = true,\n ...rest\n}) => {\n const randomId = useRandomId('eds-modal');\n const Heading: React.ElementType = headingsMap[size] || Heading2;\n const showCloseButton = ['medium', 'large', 'extraLarge'].includes(size);\n\n let handleOnDismiss;\n if (onDismiss && closeOnClickOutside) {\n handleOnDismiss = onDismiss;\n }\n return (\n <ModalOverlay\n open={open}\n onDismiss={handleOnDismiss}\n initialFocusRef={initialFocusRef}\n >\n <ModalContent size={size} align={align} {...rest}>\n {showCloseButton && (\n <IconButton\n className=\"eds-modal__close\"\n aria-label={closeLabel}\n onClick={onDismiss}\n type=\"button\"\n >\n <CloseIcon />\n </IconButton>\n )}\n {title && (\n <Heading margin=\"bottom\" as=\"h2\" id={randomId}>\n {title}\n </Heading>\n )}\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { MoveFocusInside } from 'react-focus-lock';\nimport { Contrast } from '@entur/layout';\nimport { CloseIcon } from '@entur/icons';\nimport { Heading3 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\nimport { IconButton } from '@entur/button';\n\nimport './Drawer.scss';\nimport { ModalOverlay } from './ModalOverlay';\nimport { DialogContent } from '@reach/dialog';\n\nexport type DrawerProps = {\n /** Innholdet. Typisk tekst, lenker eller knapper */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Tekst som beskriver lukkeknappen for skjermlesere\n * @default 'Lukk skuff'\n */\n closeLabel?: string;\n /** Om draweren skal vises i mørk variant\n * @default false\n */\n contrast?: boolean;\n /** Callback som kalles når brukeren ønsker å lukke draweren */\n onDismiss: () => void;\n /** Om draweren er åpen eller ikke\n * @default true\n */\n open?: boolean;\n /** Tittel på toppen av draweren */\n title: string;\n /** Styling som sendes til Drawer */\n style?: React.CSSProperties;\n /** Legger på et overlay over resten av siden */\n overlay?: boolean;\n};\n\nexport const Drawer: React.FC<DrawerProps> = ({\n children,\n className,\n closeLabel = 'Lukk skuff',\n contrast = false,\n open = true,\n onDismiss,\n title,\n style,\n overlay = false,\n}) => {\n const titleId = useRandomId('eds-drawer');\n\n if (!open) {\n return null;\n }\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n onDismiss();\n }\n };\n\n const Wrapper = contrast ? Contrast : React.Fragment;\n const ContentContainer = overlay ? DialogContent : 'div';\n return (\n <ConditionalWrapper\n condition={overlay}\n wrapper={(children: React.ReactNode) => (\n <ModalOverlay open={open} onDismiss={onDismiss}>\n {children}\n </ModalOverlay>\n )}\n >\n <Wrapper>\n <ContentContainer\n aria-labelledby={titleId}\n className={classNames('eds-drawer', className)}\n onKeyDown={handleKeyDown}\n style={style}\n >\n <MoveFocusInside>\n <IconButton\n className=\"eds-drawer__close-button\"\n onClick={onDismiss}\n type=\"button\"\n aria-label={closeLabel}\n >\n <CloseIcon aria-hidden />\n </IconButton>\n <div className=\"eds-drawer__content\">\n <Heading3 as=\"h2\" id={titleId}>\n {title}\n </Heading3>\n {children}\n </div>\n </MoveFocusInside>\n </ContentContainer>\n </Wrapper>\n </ConditionalWrapper>\n );\n};\n\nconst ConditionalWrapper: React.FC<{\n condition: boolean;\n wrapper: (child: JSX.Element) => JSX.Element;\n children: React.ReactElement;\n}> = ({ condition, wrapper, children }) =>\n condition ? wrapper(children) : children;\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('modal', 'icons', 'typography', 'a11y', 'button');\n\nexport * from './Modal';\nexport * from './ModalOverlay';\nexport * from './ModalContent';\nexport * from './Drawer';\n"],"names":["children"],"mappings":";;;;;;;;;;AAkBO,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,WAAW,sBAAsB,SAAS;AAAA,IACrD,QAAQ;AAAA,IACP,GAAG;AAAA,EAAA;AACN;ACLK,MAAM,cAAc;AAAA,EACzB,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,YAAY;AACd;AAEO,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,MAAM;AACJ,QAAM,UAA6B,YAAY,IAAI,KAAK;AACxD,QAAM,WAAW,YAAY,WAAW;AACxC,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,4BAA4B,IAAI;AAAA,QAChC,6BAA6B,KAAK;AAAA,QAClC;AAAA,MAAA;AAAA,MAEF,mBAAiB;AAAA,MAChB,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,SACC,oBAAC,WAAQ,QAAO,UAAS,IAAG,MAAK,IAAI,UAClC,UAAA,MAAA,CACH;AAAA,QAED;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;ACrBO,MAAM,QAA8B,CAAC;AAAA,EAC1C;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,sBAAsB;AAAA,EACtB,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY,WAAW;AACxC,QAAM,UAA6B,YAAY,IAAI,KAAK;AACxD,QAAM,kBAAkB,CA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,UAC7C,WAAW;AAAA,UACX;AAAA,UAEA,+BAAC,iBAAA,EACC,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,MAAK;AAAA,gBACL,cAAY;AAAA,gBAEZ,UAAA,oBAAC,WAAA,EAAU,eAAW,KAAA,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,YAEzB,qBAAC,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,cAAA,oBAAC,UAAA,EAAS,IAAG,MAAK,IAAI,SACnB,UAAA,OACH;AAAA,cACC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,qBAID,CAAC,EAAE,WAAW,SAAS,eAC1B,YAAY,QAAQ,QAAQ,IAAI;AC1GlC,uBAAuB,SAAS,SAAS,cAAc,QAAQ,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"modal.esm.js","sources":["../src/ModalOverlay.tsx","../src/ModalContent.tsx","../src/Modal.tsx","../src/Drawer.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { DialogOverlay } from '@reach/dialog';\n\nexport type ModalOverlayProps = {\n /** Flagg som sier om modalen er åpen */\n open?: boolean;\n /** Callback som kalles når brukeren ber om å lukke modalen */\n onDismiss?: () => void;\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** En ref til elementet som skal være fokusert når modalen åpnes. Defaulter til lukkeknappen */\n initialFocusRef?: React.RefObject<HTMLElement>;\n [key: string]: any;\n};\n\nexport const ModalOverlay: React.FC<ModalOverlayProps> = ({\n className,\n open,\n ...rest\n}) => (\n <DialogOverlay\n className={classNames('eds-modal__overlay', className)}\n isOpen={open}\n {...rest}\n />\n);\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DialogContent } from '@reach/dialog';\nimport { Heading4, Heading3, Heading2 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\n\nexport type ModalContentProps = {\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelsen på modalen */\n size: 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';\n /** Tittelen som vises i modalen */\n title?: React.ReactNode;\n /** Hvordan innholdet skal plasseres i modalen\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end';\n [key: string]: any;\n};\n\nexport const headingsMap = {\n extraSmall: Heading4,\n small: Heading3,\n medium: Heading2,\n large: Heading2,\n extraLarge: Heading2,\n};\n\nexport const ModalContent: React.FC<ModalContentProps> = ({\n children,\n className,\n size,\n title,\n align = 'start',\n ...rest\n}) => {\n const Heading: React.ElementType = headingsMap[size] || Heading2;\n const randomId = useRandomId('eds-modal');\n return (\n <DialogContent\n className={classNames(\n 'eds-modal__content',\n `eds-modal__content--size-${size}`,\n `eds-modal__content--align-${align}`,\n className,\n )}\n aria-labelledby={randomId}\n {...rest}\n >\n {title && (\n <Heading margin=\"bottom\" as=\"h2\" id={randomId}>\n {title}\n </Heading>\n )}\n {children}\n </DialogContent>\n );\n};\n","import React from 'react';\n\nimport { CloseIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Heading2 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\n\nimport { ModalOverlay } from './ModalOverlay';\nimport { ModalContent, headingsMap } from './ModalContent';\n\nimport './Modal.scss';\n\nexport type ModalProps = {\n /** Innholdet i modalen */\n children: React.ReactNode;\n /** Skjermleser-label til lukk-knappen */\n closeLabel?: string;\n /** En ref til elementet som skal være fokusert når modalen åpnes. Defaulter til lukkeknappen */\n initialFocusRef?: React.RefObject<HTMLElement>;\n /** Flagg som sier om modalen er åpen */\n open?: boolean;\n /** Callback som kalles når brukeren ber om å lukke modalen */\n onDismiss?: () => void;\n /** Størrelsen på modalen */\n size: 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';\n /** Hvordan innholdet skal plasseres i modalen\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end';\n /** Tittelen som vises i modalen */\n title?: React.ReactNode;\n /** Om modalen skal lukkes når man klikker på utsiden av den\n * @default true\n */\n closeOnClickOutside?: boolean;\n [key: string]: any;\n};\n\nexport const Modal: React.FC<ModalProps> = ({\n children,\n closeLabel = 'Lukk',\n initialFocusRef,\n open,\n onDismiss,\n size,\n align = 'start',\n title,\n closeOnClickOutside = true,\n ...rest\n}) => {\n const randomId = useRandomId('eds-modal');\n const Heading: React.ElementType = headingsMap[size] || Heading2;\n const showCloseButton = ['medium', 'large', 'extraLarge'].includes(size);\n\n let handleOnDismiss;\n if (onDismiss && closeOnClickOutside) {\n handleOnDismiss = onDismiss;\n }\n return (\n <ModalOverlay\n open={open}\n onDismiss={handleOnDismiss}\n initialFocusRef={initialFocusRef}\n >\n <ModalContent size={size} align={align} {...rest}>\n {showCloseButton && (\n <IconButton\n className=\"eds-modal__close\"\n aria-label={closeLabel}\n onClick={onDismiss}\n type=\"button\"\n >\n <CloseIcon />\n </IconButton>\n )}\n {title && (\n <Heading margin=\"bottom\" as=\"h2\" id={randomId}>\n {title}\n </Heading>\n )}\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { MoveFocusInside } from 'react-focus-lock';\nimport { Contrast } from '@entur/layout';\nimport { CloseIcon } from '@entur/icons';\nimport { Heading3 } from '@entur/typography';\nimport { useRandomId } from '@entur/utils';\nimport { IconButton } from '@entur/button';\n\nimport './Drawer.scss';\nimport { ModalOverlay } from './ModalOverlay';\nimport { DialogContent } from '@reach/dialog';\n\nexport type DrawerProps = {\n /** Innholdet. Typisk tekst, lenker eller knapper */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Tekst som beskriver lukkeknappen for skjermlesere\n * @default 'Lukk skuff'\n */\n closeLabel?: string;\n /** Om draweren skal vises i mørk variant\n * @default false\n */\n contrast?: boolean;\n /** Callback som kalles når brukeren ønsker å lukke draweren */\n onDismiss: () => void;\n /** Om draweren er åpen eller ikke\n * @default true\n */\n open?: boolean;\n /** Tittel på toppen av draweren */\n title: string;\n /** Styling som sendes til Drawer */\n style?: React.CSSProperties;\n /** Legger på et overlay over resten av siden */\n overlay?: boolean;\n};\n\nexport const Drawer: React.FC<DrawerProps> = ({\n children,\n className,\n closeLabel = 'Lukk skuff',\n contrast = false,\n open = true,\n onDismiss,\n title,\n style,\n overlay = false,\n}) => {\n const titleId = useRandomId('eds-drawer');\n\n if (!open) {\n return null;\n }\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n onDismiss();\n }\n };\n\n const Wrapper = contrast ? Contrast : React.Fragment;\n const ContentContainer = overlay ? DialogContent : 'div';\n return (\n <ConditionalWrapper\n condition={overlay}\n wrapper={(children: React.ReactNode) => (\n <ModalOverlay open={open} onDismiss={onDismiss}>\n {children}\n </ModalOverlay>\n )}\n >\n <Wrapper>\n <ContentContainer\n aria-labelledby={titleId}\n className={classNames('eds-drawer', className)}\n onKeyDown={handleKeyDown}\n style={style}\n >\n <MoveFocusInside>\n <IconButton\n className=\"eds-drawer__close-button\"\n onClick={onDismiss}\n type=\"button\"\n aria-label={closeLabel}\n >\n <CloseIcon aria-hidden />\n </IconButton>\n <div className=\"eds-drawer__content\">\n <Heading3 as=\"h2\" id={titleId}>\n {title}\n </Heading3>\n {children}\n </div>\n </MoveFocusInside>\n </ContentContainer>\n </Wrapper>\n </ConditionalWrapper>\n );\n};\n\nconst ConditionalWrapper: React.FC<{\n condition: boolean;\n wrapper: (child: JSX.Element) => JSX.Element;\n children: React.ReactElement;\n}> = ({ condition, wrapper, children }) =>\n condition ? wrapper(children) : children;\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('modal', 'icons', 'typography', 'a11y', 'button');\n\nexport * from './Modal';\nexport * from './ModalOverlay';\nexport * from './ModalContent';\nexport * from './Drawer';\n"],"names":["ModalOverlay","_ref","className","open","rest","_objectWithoutPropertiesLoose","_excluded","React","createElement","DialogOverlay","_extends","classNames","isOpen","headingsMap","extraSmall","Heading4","small","Heading3","medium","Heading2","large","extraLarge","ModalContent","children","size","title","_ref$align","align","Heading","randomId","useRandomId","DialogContent","margin","as","id","Modal","_ref$closeLabel","closeLabel","initialFocusRef","onDismiss","_ref$closeOnClickOuts","closeOnClickOutside","showCloseButton","includes","handleOnDismiss","IconButton","onClick","type","CloseIcon","Drawer","_ref$contrast","contrast","_ref$open","style","_ref$overlay","overlay","titleId","handleKeyDown","e","key","stopPropagation","Wrapper","Contrast","Fragment","ContentContainer","ConditionalWrapper","condition","wrapper","onKeyDown","MoveFocusInside","_ref2","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBaA,YAAY,GAAgC,SAA5CA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IACvBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,IAAI,GAAAF,IAAA,CAAJE,IAAI;AACDC,IAAAA,IAAI,GAAAC,6BAAA,CAAAJ,IAAA,EAAAK,WAAA,CAAA,CAAA;AAAA,EAAA,OAEPC,KAAA,CAAAC,aAAA,CAACC,aAAa,EAAAC,QAAA,CAAA;AACZR,IAAAA,SAAS,EAAES,UAAU,CAAC,oBAAoB,EAAET,SAAS,CAAC;AACtDU,IAAAA,MAAM,EAAET,IAAAA;GACJC,EAAAA,IAAI,CAAA,CACR,CAAA;AAAA;;;ACLG,IAAMS,WAAW,GAAG;AACzBC,EAAAA,UAAU,EAAEC,QAAQ;AACpBC,EAAAA,KAAK,EAAEC,QAAQ;AACfC,EAAAA,MAAM,EAAEC,QAAQ;AAChBC,EAAAA,KAAK,EAAED,QAAQ;AACfE,EAAAA,UAAU,EAAEF,QAAAA;EACb;IAEYG,YAAY,GAAgC,SAA5CA,YAAYA,CAAArB,IAAA,EA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AC,0BAA0B;AACpC4C,IAAAA,OAAO,EAAEP,SAAS;AAClBQ,IAAAA,IAAI,EAAC,QAAQ;kBACDV,UAAAA;AAAU,GAAA,EAEtB9B,KAAC,CAAAC,aAAA,CAAAwC,SAAS;;IAAe,CACd,EACbzC,KAAK,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAAN,IAAAA,SAAS,EAAC,qBAAA;AAAqB,GAAA,EAClCK,KAAC,CAAAC,aAAA,CAAAS,QAAQ,EAAC;AAAAgB,IAAAA,EAAE,EAAC,IAAI;AAACC,IAAAA,EAAE,EAAEsB,OAAAA;GACnB,EAAA/B,KAAK,CACG,EACVF,QAAQ,CACL,CACU,CACD,CACX,CACS,CAAA;AAEzB,EAAC;AAED,IAAM0C,kBAAkB,GAInB,SAJCA,kBAAkBA,CAAAK,KAAA,EAAA;AAAA,EAAA,IAIhBJ,SAAS,GAAAI,KAAA,CAATJ,SAAS;IAAEC,OAAO,GAAAG,KAAA,CAAPH,OAAO;IAAE5C,QAAQ,GAAA+C,KAAA,CAAR/C,QAAQ,CAAA;AAAA,EAAA,OAClC2C,SAAS,GAAGC,OAAO,CAAC5C,QAAQ,CAAC,GAAGA,QAAQ,CAAA;AAAA,CAAA;;AC1G1CgD,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC;;;;"}
|
package/dist/styles.css
CHANGED
|
@@ -1,5 +1,151 @@
|
|
|
1
1
|
/* DO NOT CHANGE!*/
|
|
2
2
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
3
|
+
:root {
|
|
4
|
+
--reach-dialog: 1;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.eds-modal__overlay {
|
|
8
|
+
background: rgba(0, 0, 0, 0.5);
|
|
9
|
+
bottom: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
left: 0;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
position: fixed;
|
|
14
|
+
right: 0;
|
|
15
|
+
top: 0;
|
|
16
|
+
z-index: 30;
|
|
17
|
+
animation: fadeInOverlay;
|
|
18
|
+
animation-duration: 0.2s;
|
|
19
|
+
animation-timing-function: ease-in-out;
|
|
20
|
+
}
|
|
21
|
+
.eds-modal__content {
|
|
22
|
+
background: var(--components-modal-modal-standard-fill);
|
|
23
|
+
border: 1px solid var(--components-modal-modal-standard-border);
|
|
24
|
+
border-radius: 0.75rem;
|
|
25
|
+
color: var(--components-modal-modal-standard-text);
|
|
26
|
+
margin: auto;
|
|
27
|
+
padding: 1.5rem;
|
|
28
|
+
position: relative;
|
|
29
|
+
width: 100%;
|
|
30
|
+
max-height: 90vh;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
z-index: 40;
|
|
33
|
+
animation: slideInContent;
|
|
34
|
+
animation-duration: 0.2s;
|
|
35
|
+
animation-timing-function: ease-in-out;
|
|
36
|
+
}
|
|
37
|
+
.eds-modal__content--align-center {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: center;
|
|
41
|
+
text-align: center;
|
|
42
|
+
}
|
|
43
|
+
.eds-modal__content--align-end {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: flex-end;
|
|
47
|
+
}
|
|
48
|
+
.eds-modal__content--size-extraSmall {
|
|
49
|
+
max-width: 21rem;
|
|
50
|
+
padding: 1.5rem;
|
|
51
|
+
}
|
|
52
|
+
.eds-modal__content--size-small {
|
|
53
|
+
max-width: 28.125rem;
|
|
54
|
+
padding: 2.5rem;
|
|
55
|
+
}
|
|
56
|
+
.eds-modal__content--size-medium {
|
|
57
|
+
max-width: 45rem;
|
|
58
|
+
padding: 3rem;
|
|
59
|
+
}
|
|
60
|
+
.eds-modal__content--size-large {
|
|
61
|
+
max-width: 56.25rem;
|
|
62
|
+
padding: 3rem;
|
|
63
|
+
}
|
|
64
|
+
.eds-modal__content--size-extraLarge {
|
|
65
|
+
max-width: 78.75rem;
|
|
66
|
+
padding: 3rem;
|
|
67
|
+
}
|
|
68
|
+
.eds-modal__content::-webkit-scrollbar {
|
|
69
|
+
width: 16px;
|
|
70
|
+
}
|
|
71
|
+
.eds-modal__content::-webkit-scrollbar-track {
|
|
72
|
+
margin-top: 0.5rem;
|
|
73
|
+
margin-bottom: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
.eds-modal__content::-webkit-scrollbar-thumb {
|
|
76
|
+
background-color: lightgrey;
|
|
77
|
+
border: 4px solid transparent;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
background-clip: padding-box;
|
|
80
|
+
}
|
|
81
|
+
.eds-modal__content::-webkit-scrollbar-thumb:hover {
|
|
82
|
+
background-color: grey;
|
|
83
|
+
}
|
|
84
|
+
.eds-modal__close {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 1rem;
|
|
87
|
+
right: 1rem;
|
|
88
|
+
color: var(--components-modal-modal-standard-icon);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes fadeInOverlay {
|
|
92
|
+
from {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
}
|
|
95
|
+
to {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
@keyframes slideInContent {
|
|
100
|
+
from {
|
|
101
|
+
top: 5rem;
|
|
102
|
+
opacity: 0;
|
|
103
|
+
}
|
|
104
|
+
to {
|
|
105
|
+
top: 0%;
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/* DO NOT CHANGE!*/
|
|
110
|
+
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
111
|
+
.eds-drawer {
|
|
112
|
+
animation: slideFromRight forwards ease-out 0.1s;
|
|
113
|
+
background-color: var(--components-modal-drawer-standard-background);
|
|
114
|
+
color: var(--components-modal-drawer-standard-text);
|
|
115
|
+
bottom: 0;
|
|
116
|
+
padding: 1.5rem;
|
|
117
|
+
position: fixed;
|
|
118
|
+
right: 0;
|
|
119
|
+
top: 0;
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
min-width: 20rem;
|
|
122
|
+
width: 25vw;
|
|
123
|
+
z-index: 40;
|
|
124
|
+
overflow-y: auto;
|
|
125
|
+
}
|
|
126
|
+
.eds-contrast .eds-drawer {
|
|
127
|
+
background-color: var(--components-modal-drawer-contrast-background);
|
|
128
|
+
color: var(--components-modal-drawer-contrast-text);
|
|
129
|
+
}
|
|
130
|
+
.eds-drawer__close-button {
|
|
131
|
+
margin: 0;
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 1.5rem;
|
|
134
|
+
right: 1.5rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes slideFromRight {
|
|
138
|
+
from {
|
|
139
|
+
box-shadow: none;
|
|
140
|
+
transform: translateX(100%);
|
|
141
|
+
}
|
|
142
|
+
to {
|
|
143
|
+
box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
|
|
144
|
+
transform: 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/* DO NOT CHANGE!*/
|
|
148
|
+
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
3
149
|
/* DO NOT CHANGE!*/
|
|
4
150
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
5
151
|
/* DO NOT CHANGE!*/
|
|
@@ -174,147 +320,4 @@
|
|
|
174
320
|
|
|
175
321
|
:root {
|
|
176
322
|
--eds-modal: 1;
|
|
177
|
-
}/* DO NOT CHANGE!*/
|
|
178
|
-
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
179
|
-
:root {
|
|
180
|
-
--reach-dialog: 1;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.eds-modal__overlay {
|
|
184
|
-
background: rgba(0, 0, 0, 0.5);
|
|
185
|
-
bottom: 0;
|
|
186
|
-
display: flex;
|
|
187
|
-
left: 0;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
position: fixed;
|
|
190
|
-
right: 0;
|
|
191
|
-
top: 0;
|
|
192
|
-
z-index: 30;
|
|
193
|
-
animation: fadeInOverlay;
|
|
194
|
-
animation-duration: 0.2s;
|
|
195
|
-
animation-timing-function: ease-in-out;
|
|
196
|
-
}
|
|
197
|
-
.eds-modal__content {
|
|
198
|
-
background: var(--components-modal-modal-standard-fill);
|
|
199
|
-
border: 1px solid var(--components-modal-modal-standard-border);
|
|
200
|
-
border-radius: 0.75rem;
|
|
201
|
-
color: var(--components-modal-modal-standard-text);
|
|
202
|
-
margin: auto;
|
|
203
|
-
padding: 1.5rem;
|
|
204
|
-
position: relative;
|
|
205
|
-
width: 100%;
|
|
206
|
-
max-height: 90vh;
|
|
207
|
-
overflow: auto;
|
|
208
|
-
z-index: 40;
|
|
209
|
-
animation: slideInContent;
|
|
210
|
-
animation-duration: 0.2s;
|
|
211
|
-
animation-timing-function: ease-in-out;
|
|
212
323
|
}
|
|
213
|
-
.eds-modal__content--align-center {
|
|
214
|
-
display: flex;
|
|
215
|
-
flex-direction: column;
|
|
216
|
-
align-items: center;
|
|
217
|
-
text-align: center;
|
|
218
|
-
}
|
|
219
|
-
.eds-modal__content--align-end {
|
|
220
|
-
display: flex;
|
|
221
|
-
flex-direction: column;
|
|
222
|
-
align-items: flex-end;
|
|
223
|
-
}
|
|
224
|
-
.eds-modal__content--size-extraSmall {
|
|
225
|
-
max-width: 21rem;
|
|
226
|
-
padding: 1.5rem;
|
|
227
|
-
}
|
|
228
|
-
.eds-modal__content--size-small {
|
|
229
|
-
max-width: 28.125rem;
|
|
230
|
-
padding: 2.5rem;
|
|
231
|
-
}
|
|
232
|
-
.eds-modal__content--size-medium {
|
|
233
|
-
max-width: 45rem;
|
|
234
|
-
padding: 3rem;
|
|
235
|
-
}
|
|
236
|
-
.eds-modal__content--size-large {
|
|
237
|
-
max-width: 56.25rem;
|
|
238
|
-
padding: 3rem;
|
|
239
|
-
}
|
|
240
|
-
.eds-modal__content--size-extraLarge {
|
|
241
|
-
max-width: 78.75rem;
|
|
242
|
-
padding: 3rem;
|
|
243
|
-
}
|
|
244
|
-
.eds-modal__content::-webkit-scrollbar {
|
|
245
|
-
width: 16px;
|
|
246
|
-
}
|
|
247
|
-
.eds-modal__content::-webkit-scrollbar-track {
|
|
248
|
-
margin-block: 0.5rem;
|
|
249
|
-
}
|
|
250
|
-
.eds-modal__content::-webkit-scrollbar-thumb {
|
|
251
|
-
background-color: lightgrey;
|
|
252
|
-
border: 4px solid transparent;
|
|
253
|
-
border-radius: 8px;
|
|
254
|
-
background-clip: padding-box;
|
|
255
|
-
}
|
|
256
|
-
.eds-modal__content::-webkit-scrollbar-thumb:hover {
|
|
257
|
-
background-color: grey;
|
|
258
|
-
}
|
|
259
|
-
.eds-modal__close {
|
|
260
|
-
position: absolute;
|
|
261
|
-
top: 1rem;
|
|
262
|
-
right: 1rem;
|
|
263
|
-
color: var(--components-modal-modal-standard-icon);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
@keyframes fadeInOverlay {
|
|
267
|
-
from {
|
|
268
|
-
opacity: 0;
|
|
269
|
-
}
|
|
270
|
-
to {
|
|
271
|
-
opacity: 1;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
@keyframes slideInContent {
|
|
275
|
-
from {
|
|
276
|
-
top: 5rem;
|
|
277
|
-
opacity: 0;
|
|
278
|
-
}
|
|
279
|
-
to {
|
|
280
|
-
top: 0%;
|
|
281
|
-
opacity: 1;
|
|
282
|
-
}
|
|
283
|
-
}/* DO NOT CHANGE!*/
|
|
284
|
-
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
285
|
-
.eds-drawer {
|
|
286
|
-
animation: slideFromRight forwards ease-out 0.1s;
|
|
287
|
-
background-color: var(--components-modal-drawer-standard-background);
|
|
288
|
-
color: var(--components-modal-drawer-standard-text);
|
|
289
|
-
bottom: 0;
|
|
290
|
-
padding: 1.5rem;
|
|
291
|
-
position: fixed;
|
|
292
|
-
right: 0;
|
|
293
|
-
top: 0;
|
|
294
|
-
max-width: 100%;
|
|
295
|
-
min-width: 20rem;
|
|
296
|
-
width: 25vw;
|
|
297
|
-
z-index: 40;
|
|
298
|
-
overflow-y: auto;
|
|
299
|
-
}
|
|
300
|
-
.eds-contrast .eds-drawer {
|
|
301
|
-
background-color: var(--components-modal-drawer-contrast-background);
|
|
302
|
-
color: var(--components-modal-drawer-contrast-text);
|
|
303
|
-
}
|
|
304
|
-
.eds-drawer__close-button {
|
|
305
|
-
margin: 0;
|
|
306
|
-
position: absolute;
|
|
307
|
-
top: 1.5rem;
|
|
308
|
-
right: 1.5rem;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
@keyframes slideFromRight {
|
|
312
|
-
from {
|
|
313
|
-
box-shadow: none;
|
|
314
|
-
transform: translateX(100%);
|
|
315
|
-
}
|
|
316
|
-
to {
|
|
317
|
-
box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
|
|
318
|
-
transform: 0;
|
|
319
|
-
}
|
|
320
|
-
}
|