@entur/alert 0.17.13-beta.8 → 0.17.13

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.
@@ -0,0 +1,372 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const utils = require("@entur/utils");
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const React = require("react");
6
+ const classNames = require("classnames");
7
+ const icons = require("@entur/icons");
8
+ const button = require("@entur/button");
9
+ const tooltip = require("@entur/tooltip");
10
+ const copy = require("copy-text-to-clipboard");
11
+ const typography = require("@entur/typography");
12
+ const expand = require("@entur/expand");
13
+ const iconsMap = {
14
+ success: {
15
+ icon: icons.ValidationSuccessIcon,
16
+ description: "Suksessmelding"
17
+ },
18
+ information: { icon: icons.ValidationInfoIcon, description: "Infomelding" },
19
+ warning: {
20
+ icon: icons.ValidationExclamationIcon,
21
+ description: "Varselmelding"
22
+ },
23
+ negative: { icon: icons.ValidationErrorIcon, description: "Feilmelding" },
24
+ //deprecated
25
+ info: { icon: icons.ValidationInfoIcon, description: "Infomelding" },
26
+ error: { icon: icons.ValidationErrorIcon, description: "Feilmelding" }
27
+ };
28
+ const BaseAlertBox = ({
29
+ children,
30
+ className,
31
+ closable = false,
32
+ closeButtonLabel = "Lukk",
33
+ variant,
34
+ onClose = () => ({}),
35
+ size,
36
+ title,
37
+ toastIsBeingRemoved,
38
+ ...rest
39
+ }) => {
40
+ const [isClosed, setClosed] = React.useState(false);
41
+ if (isClosed) {
42
+ return null;
43
+ }
44
+ const handleClose = () => {
45
+ setClosed(true);
46
+ onClose();
47
+ };
48
+ const Icon = iconsMap[variant].icon;
49
+ return /* @__PURE__ */ jsxRuntime.jsxs(
50
+ "div",
51
+ {
52
+ className: classNames(
53
+ "eds-alert-box",
54
+ `eds-alert-box--${size}`,
55
+ `eds-alert-box--${variant}`,
56
+ {
57
+ "eds-alert-box--toast--exit-animation": toastIsBeingRemoved,
58
+ "eds-alert-box--no-title": !title
59
+ },
60
+ className
61
+ ),
62
+ ...rest,
63
+ children: [
64
+ /* @__PURE__ */ jsxRuntime.jsx(
65
+ Icon,
66
+ {
67
+ role: "img",
68
+ className: "eds-alert-box__icon",
69
+ "aria-label": iconsMap[variant].description
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsxRuntime.jsxs(
73
+ "div",
74
+ {
75
+ className: classNames("eds-alert-box__content", {
76
+ "eds-alert-box__content--no-children": !children
77
+ }),
78
+ children: [
79
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "eds-alert-box__title", children: title }),
80
+ children && children
81
+ ]
82
+ }
83
+ ),
84
+ closable && /* @__PURE__ */ jsxRuntime.jsx(
85
+ tooltip.Tooltip,
86
+ {
87
+ className: "eds-alert-box__tooltip",
88
+ "aria-hidden": true,
89
+ placement: "bottom",
90
+ content: "Lukk",
91
+ children: /* @__PURE__ */ jsxRuntime.jsx(
92
+ button.IconButton,
93
+ {
94
+ className: "eds-alert-box__close-button",
95
+ "aria-label": closeButtonLabel,
96
+ onClick: handleClose,
97
+ type: "button",
98
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {})
99
+ }
100
+ )
101
+ }
102
+ )
103
+ ]
104
+ }
105
+ );
106
+ };
107
+ const BannerAlertBox = (props) => /* @__PURE__ */ jsxRuntime.jsx(BaseAlertBox, { ...props, size: "banner" });
108
+ const ToastAlertBox = (props) => /* @__PURE__ */ jsxRuntime.jsx(BaseAlertBox, { ...props, size: "toast", role: "status" });
109
+ const SmallAlertBox = ({
110
+ className,
111
+ width,
112
+ onClose,
113
+ closable = false,
114
+ closeButtonLabel,
115
+ ...rest
116
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
117
+ BaseAlertBox,
118
+ {
119
+ className: classNames(className, {
120
+ "eds-alert-box--fit-content": width === "fit-content"
121
+ }),
122
+ ...rest,
123
+ onClose,
124
+ closable,
125
+ closeButtonLabel,
126
+ size: "small"
127
+ }
128
+ );
129
+ const EXIT_ANIMATION_TIME = 400;
130
+ const ToastContext = React.createContext(null);
131
+ const toastReducer = (prevToasts, action) => {
132
+ switch (action.type) {
133
+ case "ADD_TOAST":
134
+ return [action.payload, ...prevToasts];
135
+ case "PLAY_EXIT_ANIMATION":
136
+ return prevToasts.map((toast) => {
137
+ if (toast.id === action.payload)
138
+ return { ...toast, isBeingRemoved: true };
139
+ return toast;
140
+ });
141
+ case "REMOVE_TOAST":
142
+ return prevToasts.filter((toast) => toast.id !== action.payload);
143
+ }
144
+ };
145
+ const createUniqueId = () => Math.random().toString().substring(2);
146
+ const createToast = (toast, id) => {
147
+ if (typeof toast === "string") {
148
+ return { id, content: toast, variant: "success", isBeingRemoved: false };
149
+ } else {
150
+ return { id, variant: "success", isBeingRemoved: false, ...toast };
151
+ }
152
+ };
153
+ const ToastProvider = ({
154
+ delay = 6e3,
155
+ children,
156
+ position = "bottom-right",
157
+ className,
158
+ style
159
+ }) => {
160
+ const [toasts, dispatch] = React.useReducer(toastReducer, []);
161
+ const [hoveringId, setHovering] = React.useState();
162
+ const timeoutIdRefs = React.useRef({});
163
+ const removeToast = React.useCallback((id) => {
164
+ window.clearTimeout(timeoutIdRefs.current[id]);
165
+ dispatch({ type: "REMOVE_TOAST", payload: id });
166
+ delete timeoutIdRefs.current[id];
167
+ }, []);
168
+ const playExitAnimation = React.useCallback((id) => {
169
+ window.clearTimeout(timeoutIdRefs.current[id + "animation"]);
170
+ dispatch({ type: "PLAY_EXIT_ANIMATION", payload: id });
171
+ delete timeoutIdRefs.current[id + "animation"];
172
+ }, []);
173
+ const removeToastWithAnimationAfterDelay = React.useCallback(
174
+ (id, delay2) => {
175
+ timeoutIdRefs.current[id + "animation"] = window.setTimeout(
176
+ () => playExitAnimation(id),
177
+ delay2 - EXIT_ANIMATION_TIME
178
+ );
179
+ timeoutIdRefs.current[id] = window.setTimeout(
180
+ () => removeToast(id),
181
+ delay2
182
+ );
183
+ },
184
+ [timeoutIdRefs, playExitAnimation, removeToast]
185
+ );
186
+ const addToast = React.useCallback(
187
+ (toast) => {
188
+ const id = createUniqueId();
189
+ const payload = createToast(toast, id);
190
+ dispatch({ type: "ADD_TOAST", payload });
191
+ removeToastWithAnimationAfterDelay(id, delay);
192
+ },
193
+ [delay, removeToastWithAnimationAfterDelay]
194
+ );
195
+ const handleMouseEnter = (toast) => () => {
196
+ if (toast.isBeingRemoved) return;
197
+ setHovering(toast.id);
198
+ Object.values(timeoutIdRefs.current).forEach((timeoutId) => {
199
+ window.clearTimeout(timeoutId);
200
+ });
201
+ timeoutIdRefs.current = {};
202
+ };
203
+ const handleMouseLeave = () => {
204
+ setHovering(void 0);
205
+ toasts.forEach((toast) => {
206
+ removeToastWithAnimationAfterDelay(toast.id, delay);
207
+ });
208
+ };
209
+ const handleClose = (toastId) => () => {
210
+ removeToast(toastId);
211
+ handleMouseLeave();
212
+ };
213
+ const contextValue = React.useMemo(
214
+ () => ({ toasts, addToast, removeToast }),
215
+ [addToast, removeToast, toasts]
216
+ );
217
+ return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: contextValue, children: [
218
+ toasts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
219
+ "div",
220
+ {
221
+ className: classNames(
222
+ "eds-toast-container",
223
+ `eds-toast-container--${position}`,
224
+ className
225
+ ),
226
+ style,
227
+ children: toasts.slice(0, 3).map((toastToShow) => /* @__PURE__ */ jsxRuntime.jsx(
228
+ ToastAlertBox,
229
+ {
230
+ variant: toastToShow.variant,
231
+ title: toastToShow.title,
232
+ onClose: handleClose(toastToShow.id),
233
+ onMouseEnter: handleMouseEnter(toastToShow),
234
+ onMouseLeave: handleMouseLeave,
235
+ closable: hoveringId === toastToShow.id,
236
+ toastIsBeingRemoved: toastToShow.isBeingRemoved,
237
+ children: toastToShow.content
238
+ },
239
+ toastToShow.id
240
+ ))
241
+ }
242
+ ),
243
+ children
244
+ ] });
245
+ };
246
+ const useToast = () => {
247
+ const context = React.useContext(ToastContext);
248
+ if (!context) {
249
+ throw new Error(
250
+ "You need to wrap your component in a ToastProvider component in order to use the useToast hook"
251
+ );
252
+ }
253
+ const { addToast } = context;
254
+ return {
255
+ addToast
256
+ };
257
+ };
258
+ const CopyableText = ({
259
+ children,
260
+ successHeading = "Kopiert!",
261
+ successMessage,
262
+ textToCopy,
263
+ className,
264
+ "aria-label": ariaLabel = `Kopier ${textToCopy ?? children} til utklippstavlen`,
265
+ ...rest
266
+ }) => {
267
+ const { addToast } = useToast();
268
+ const buttonRef = React.useRef(null);
269
+ const _textToCopy = textToCopy ?? children;
270
+ const _successMessage = successMessage ?? `${_textToCopy} ble kopiert til utklippstavlen.`;
271
+ const handleClick = () => {
272
+ buttonRef.current && copy(_textToCopy, {
273
+ target: buttonRef.current
274
+ }) && addToast({ title: successHeading, content: _successMessage });
275
+ };
276
+ return /* @__PURE__ */ jsxRuntime.jsx(
277
+ "div",
278
+ {
279
+ className: "eds-copyable-text " + className,
280
+ style: { ...rest.style },
281
+ type: "button",
282
+ onClick: handleClick,
283
+ tabIndex: -1,
284
+ "aria-label": "",
285
+ ...rest,
286
+ children: /* @__PURE__ */ jsxRuntime.jsxs(typography.PreformattedText, { className: "eds-copyable-text__preformatted-text", children: [
287
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "eds-copyable-text__displayed-text", children }),
288
+ /* @__PURE__ */ jsxRuntime.jsx(
289
+ button.IconButton,
290
+ {
291
+ className: "eds-copyable-text__button",
292
+ "aria-label": ariaLabel,
293
+ type: "button",
294
+ ref: buttonRef,
295
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyIcon, { className: "eds-copyable-text__button__icon" })
296
+ }
297
+ )
298
+ ] })
299
+ }
300
+ );
301
+ };
302
+ const SmallExpandableAlertBox = (props) => {
303
+ return /* @__PURE__ */ jsxRuntime.jsx(ExpandableAlertBox, { size: "small", ...props });
304
+ };
305
+ const BannerExpandableAlertBox = (props) => {
306
+ return /* @__PURE__ */ jsxRuntime.jsx(ExpandableAlertBox, { size: "banner", ...props });
307
+ };
308
+ const ExpandableAlertBox = ({
309
+ variant,
310
+ title,
311
+ children,
312
+ size,
313
+ className,
314
+ openLabel,
315
+ closeLabel,
316
+ ...rest
317
+ }) => {
318
+ const [open, setopen] = React.useState(false);
319
+ return /* @__PURE__ */ jsxRuntime.jsx(
320
+ BaseAlertBox,
321
+ {
322
+ size,
323
+ variant,
324
+ className: classNames("eds-expandable-alert-box", className),
325
+ title: /* @__PURE__ */ jsxRuntime.jsx(
326
+ ExpandableAlertBoxTitle,
327
+ {
328
+ open,
329
+ title,
330
+ onClick: () => setopen(!open),
331
+ openLabel,
332
+ closeLabel
333
+ }
334
+ ),
335
+ ...rest,
336
+ children: /* @__PURE__ */ jsxRuntime.jsx(expand.BaseExpand, { open, children })
337
+ }
338
+ );
339
+ };
340
+ const ExpandableAlertBoxTitle = ({
341
+ title,
342
+ open,
343
+ openLabel = "Les mer",
344
+ closeLabel = "Lukk",
345
+ onClick
346
+ }) => {
347
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "eds-expandable-alert-box__title", children: [
348
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: title }),
349
+ /* @__PURE__ */ jsxRuntime.jsxs(
350
+ "button",
351
+ {
352
+ className: "eds-expandable-alert-box__button",
353
+ onClick,
354
+ type: "button",
355
+ children: [
356
+ open ? closeLabel : openLabel,
357
+ /* @__PURE__ */ jsxRuntime.jsx(expand.ExpandArrow, { open, inline: true })
358
+ ]
359
+ }
360
+ )
361
+ ] });
362
+ };
363
+ utils.warnAboutMissingStyles("alert", "icons");
364
+ exports.BannerAlertBox = BannerAlertBox;
365
+ exports.BannerExpandableAlertBox = BannerExpandableAlertBox;
366
+ exports.CopyableText = CopyableText;
367
+ exports.SmallAlertBox = SmallAlertBox;
368
+ exports.SmallExpandableAlertBox = SmallExpandableAlertBox;
369
+ exports.ToastAlertBox = ToastAlertBox;
370
+ exports.ToastProvider = ToastProvider;
371
+ exports.useToast = useToast;
372
+ //# sourceMappingURL=alert.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.cjs.js","sources":["../src/BaseAlertBox.tsx","../src/BannerAlertBox.tsx","../src/ToastAlertBox.tsx","../src/SmallAlertBox.tsx","../src/ToastProvider.tsx","../src/CopyableText.tsx","../src/ExpandableAlertBox.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseIcon,\n ValidationSuccessIcon,\n ValidationExclamationIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n} from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Tooltip } from '@entur/tooltip';\nimport { VariantType } from '@entur/utils';\n\nimport './BaseAlertBox.scss';\n\nconst iconsMap = {\n success: {\n icon: ValidationSuccessIcon,\n description: 'Suksessmelding',\n },\n information: { icon: ValidationInfoIcon, description: 'Infomelding' },\n warning: {\n icon: ValidationExclamationIcon,\n description: 'Varselmelding',\n },\n negative: { icon: ValidationErrorIcon, description: 'Feilmelding' },\n //deprecated\n info: { icon: ValidationInfoIcon, description: 'Infomelding' },\n error: { icon: ValidationErrorIcon, description: 'Feilmelding' },\n};\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\ntype BaseAlertBoxProps = {\n /** Innholdet i alert-boksen */\n children?: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Skjermleser-label for lukkeknappen, om den vises\n * @default \"Lukk\"\n */\n closeButtonLabel?: string;\n /** Callback som kalles når man lukker boksen\n * @default () => {}\n */\n onClose?: () => void;\n /** Om denne er true, vil boksen få en lukkeknapp i høyre hjørne\n * @default false\n */\n closable?: boolean;\n /** Tittel på boksen - oppsummer virkning */\n title?: React.ReactNode;\n /** Farge og uttrykk på alert-boksen */\n variant: VariantType | typeof info | typeof error;\n /** Typen boks (internt bruk) */\n size: 'banner' | 'toast' | 'small';\n [key: string]: any;\n};\n\nexport const BaseAlertBox: React.FC<BaseAlertBoxProps> = ({\n children,\n className,\n closable = false,\n closeButtonLabel = 'Lukk',\n variant,\n onClose = () => ({}),\n size,\n title,\n toastIsBeingRemoved,\n ...rest\n}) => {\n const [isClosed, setClosed] = React.useState(false);\n if (isClosed) {\n return null;\n }\n const handleClose = () => {\n setClosed(true);\n onClose();\n };\n const Icon = iconsMap[variant].icon;\n return (\n <div\n className={classNames(\n 'eds-alert-box',\n `eds-alert-box--${size}`,\n `eds-alert-box--${variant}`,\n {\n 'eds-alert-box--toast--exit-animation': toastIsBeingRemoved,\n 'eds-alert-box--no-title': !title,\n },\n className,\n )}\n {...rest}\n >\n <Icon\n role=\"img\"\n className=\"eds-alert-box__icon\"\n aria-label={iconsMap[variant].description}\n />\n <div\n className={classNames('eds-alert-box__content', {\n 'eds-alert-box__content--no-children': !children,\n })}\n >\n {title && <div className=\"eds-alert-box__title\">{title}</div>}\n {children && children}\n </div>\n {closable && (\n <Tooltip\n className=\"eds-alert-box__tooltip\"\n aria-hidden\n placement=\"bottom\"\n content=\"Lukk\"\n >\n <IconButton\n className=\"eds-alert-box__close-button\"\n aria-label={closeButtonLabel}\n onClick={handleClose}\n type=\"button\"\n >\n <CloseIcon />\n </IconButton>\n </Tooltip>\n )}\n </div>\n );\n};\n","import React from 'react';\nimport { BaseAlertBox } from './BaseAlertBox';\n\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type BannerAlertBoxProps = {\n /** Innholdet i alert-boksen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Skjermleser-label for lukkeknappen, om den vises */\n closeButtonLabel?: string;\n /** Callback som kalles når man lukker boksen */\n onClose?: () => void;\n /** Om denne er true, vil boksen få en lukkeknapp i høyre hjørne\n * @default false\n */\n closable?: boolean;\n /** Tittel på boksen - oppsummer virkning */\n title?: string;\n /** Farge og uttrykk på alert-boksen */\n variant: VariantType | typeof info | typeof error;\n [key: string]: any;\n};\n\nexport const BannerAlertBox: React.FC<BannerAlertBoxProps> = props => (\n <BaseAlertBox {...props} size=\"banner\" />\n);\n","import React from 'react';\nimport { BaseAlertBox } from './BaseAlertBox';\nimport './ToastAlertBox.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n\nexport type ToastAlertBoxProps = {\n /** Innholdet i toasten */\n children?: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Skjermleser-label for lukkeknappen, om den vises */\n closeButtonLabel?: string;\n /** Callback som kalles når man lukker boksen */\n onClose?: () => void;\n /** Om denne er true, vil boksen få en lukkeknapp i høyre hjørne */\n closable?: boolean;\n /** Tittel på boksen - oppsummer virkning */\n title?: string;\n /** Farge og uttrykk på toasten */\n variant: 'success' | 'information' | typeof info;\n [key: string]: any;\n};\n\nexport const ToastAlertBox: React.FC<ToastAlertBoxProps> = props => (\n <BaseAlertBox {...props} size=\"toast\" role=\"status\" />\n);\n","import React from 'react';\nimport classNames from 'classnames';\nimport { BaseAlertBox } from './BaseAlertBox';\n\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type SmallAlertBoxProps = {\n /** Innholdet i alert-boksen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Skjermleser-label for lukkeknappen, om den vises */\n closeButtonLabel?: string;\n /** Om denne er true, vil boksen få en lukkeknapp i høyre hjørne\n * @default false\n */\n closable?: boolean;\n /** Callback som kalles når man lukker boksen */\n onClose?: () => void;\n /** Tittel på boksen - oppsummer virkning */\n title?: string;\n /** Bredden på boksen - fullbredde eller tilpasset innholdet */\n width?: 'fluid' | 'fit-content';\n /** Farge og uttrykk på alert-boksen*/\n variant: VariantType | typeof info | typeof error;\n [key: string]: any;\n};\n\nexport const SmallAlertBox: React.FC<SmallAlertBoxProps> = ({\n className,\n width,\n onClose,\n closable = false,\n closeButtonLabel,\n ...rest\n}) => (\n <BaseAlertBox\n className={classNames(className, {\n 'eds-alert-box--fit-content': width === 'fit-content',\n })}\n {...rest}\n onClose={onClose}\n closable={closable}\n closeButtonLabel={closeButtonLabel}\n size=\"small\"\n />\n);\n","import React from 'react';\nimport { ToastAlertBox } from './ToastAlertBox';\nimport classNames from 'classnames';\n\ntype ToastId = string;\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n\nexport type ToastVariants = 'success' | 'information' | typeof info;\n\ntype ToastType = {\n title?: string;\n content: React.ReactNode;\n id: ToastId;\n variant: ToastVariants;\n isBeingRemoved: boolean;\n};\n\ntype ToastContextType = {\n addToast: (payload: AddToastPayload | string) => void;\n removeToast: (id: ToastId) => void;\n toasts: ToastType[];\n};\n\nexport type AddToastPayload = {\n title?: string;\n content: React.ReactNode;\n variant?: ToastVariants;\n};\n\ntype ToastAction =\n | { type: 'ADD_TOAST'; payload: ToastType }\n | { type: 'REMOVE_TOAST'; payload: ToastId }\n | { type: 'PLAY_EXIT_ANIMATION'; payload: ToastId };\n\nconst EXIT_ANIMATION_TIME = 400;\n\nconst ToastContext = React.createContext<ToastContextType | null>(null);\n\nconst toastReducer = (\n prevToasts: ToastType[],\n action: ToastAction,\n): ToastType[] => {\n switch (action.type) {\n case 'ADD_TOAST':\n return [action.payload, ...prevToasts];\n case 'PLAY_EXIT_ANIMATION':\n return prevToasts.map(toast => {\n if (toast.id === action.payload)\n return { ...toast, isBeingRemoved: true };\n return toast;\n });\n case 'REMOVE_TOAST':\n return prevToasts.filter(toast => toast.id !== action.payload);\n }\n};\n\nconst createUniqueId = () => Math.random().toString().substring(2);\n\nconst createToast = (\n toast: AddToastPayload | string,\n id: ToastId,\n): ToastType => {\n if (typeof toast === 'string') {\n return { id, content: toast, variant: 'success', isBeingRemoved: false };\n } else {\n return { id, variant: 'success', isBeingRemoved: false, ...toast };\n }\n};\n\nexport type ToastProviderProps = {\n /** Antall millisekunder før toasts forsvinner av seg selv\n * @default 6000\n */\n delay?: number;\n /** Plasseringen av toasts\n * @default \"bottom-right\"\n */\n position?: 'bottom-right' | 'top-right';\n /** Ekstra klassenavn til ToastProvider-wrapperen */\n className?: string;\n /** Ekstra styling som sendes til ToastProvider-wrapperen */\n style?: React.CSSProperties;\n /** Innholdet */\n children: React.ReactNode;\n};\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n delay = 6000,\n children,\n position = 'bottom-right',\n className,\n style,\n}) => {\n const [toasts, dispatch] = React.useReducer(toastReducer, []);\n const [hoveringId, setHovering] = React.useState<string>();\n const timeoutIdRefs = React.useRef<{ [key: string]: number }>({});\n\n const removeToast = React.useCallback((id: ToastId) => {\n window.clearTimeout(timeoutIdRefs.current[id]);\n dispatch({ type: 'REMOVE_TOAST', payload: id });\n delete timeoutIdRefs.current[id];\n }, []);\n\n const playExitAnimation = React.useCallback((id: ToastId) => {\n window.clearTimeout(timeoutIdRefs.current[id + 'animation']);\n dispatch({ type: 'PLAY_EXIT_ANIMATION', payload: id });\n delete timeoutIdRefs.current[id + 'animation'];\n }, []);\n\n const removeToastWithAnimationAfterDelay = React.useCallback(\n (id: ToastId, delay: number) => {\n timeoutIdRefs.current[id + 'animation'] = window.setTimeout(\n () => playExitAnimation(id),\n delay - EXIT_ANIMATION_TIME,\n );\n timeoutIdRefs.current[id] = window.setTimeout(\n () => removeToast(id),\n delay,\n );\n },\n [timeoutIdRefs, playExitAnimation, removeToast],\n );\n\n const addToast = React.useCallback(\n (toast: AddToastPayload | string) => {\n const id = createUniqueId();\n const payload = createToast(toast, id);\n dispatch({ type: 'ADD_TOAST', payload });\n removeToastWithAnimationAfterDelay(id, delay);\n },\n [delay, removeToastWithAnimationAfterDelay],\n );\n\n const handleMouseEnter = (toast: ToastType) => () => {\n if (toast.isBeingRemoved) return;\n setHovering(toast.id);\n Object.values(timeoutIdRefs.current).forEach(timeoutId => {\n window.clearTimeout(timeoutId);\n });\n timeoutIdRefs.current = {};\n };\n\n const handleMouseLeave = () => {\n setHovering(undefined);\n toasts.forEach(toast => {\n removeToastWithAnimationAfterDelay(toast.id, delay);\n });\n };\n\n const handleClose = (toastId: ToastId) => () => {\n removeToast(toastId);\n handleMouseLeave();\n };\n\n const contextValue = React.useMemo(\n () => ({ toasts, addToast, removeToast }),\n [addToast, removeToast, toasts],\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {toasts.length > 0 && (\n <div\n className={classNames(\n 'eds-toast-container',\n `eds-toast-container--${position}`,\n className,\n )}\n style={style}\n >\n {toasts.slice(0, 3).map(toastToShow => (\n <ToastAlertBox\n variant={toastToShow.variant}\n title={toastToShow.title}\n onClose={handleClose(toastToShow.id)}\n onMouseEnter={handleMouseEnter(toastToShow)}\n onMouseLeave={handleMouseLeave}\n closable={hoveringId === toastToShow.id}\n toastIsBeingRemoved={toastToShow.isBeingRemoved}\n key={toastToShow.id}\n >\n {toastToShow.content}\n </ToastAlertBox>\n ))}\n </div>\n )}\n {children}\n </ToastContext.Provider>\n );\n};\n\nexport const useToast: () => {\n addToast: (payload: AddToastPayload | string) => void;\n} = () => {\n const context = React.useContext(ToastContext);\n if (!context) {\n throw new Error(\n 'You need to wrap your component in a ToastProvider component in ' +\n 'order to use the useToast hook',\n );\n }\n const { addToast } = context;\n return {\n addToast,\n };\n};\n","import React from 'react';\nimport copy from 'copy-text-to-clipboard';\n\nimport { IconButton } from '@entur/button';\nimport { CopyIcon } from '@entur/icons';\nimport { PreformattedText } from '@entur/typography';\n\nimport { useToast } from './ToastProvider';\n\nimport './CopyableText.scss';\n\nexport type CopyableTextProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Tekstinnhold som vises og kopieres */\n children: string;\n /** Hvis du ønsker å kopiere noe annet enn\n * innholdet i children kan du legge det inn her */\n textToCopy?: string;\n /** Overskrift i toast-varselet\n * @default 'Kopiert!'\n */\n successHeading?: string;\n /** Bekreftelsesmelding i toast-varselet\n * @default `${textToCopy} ble kopiert til utklippstavlen.`\n */\n successMessage?: string;\n} & Omit<React.ButtonHTMLAttributes<HTMLDivElement>, 'children'>;\n\nexport const CopyableText = ({\n children,\n successHeading = 'Kopiert!',\n successMessage,\n textToCopy,\n className,\n 'aria-label': ariaLabel = `Kopier ${\n textToCopy ?? children\n } til utklippstavlen`,\n ...rest\n}: CopyableTextProps): JSX.Element => {\n const { addToast } = useToast();\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const _textToCopy = textToCopy ?? children;\n const _successMessage =\n successMessage ?? `${_textToCopy} ble kopiert til utklippstavlen.`;\n const handleClick = () => {\n buttonRef.current &&\n copy(_textToCopy, {\n target: buttonRef.current,\n }) &&\n addToast({ title: successHeading, content: _successMessage });\n };\n return (\n <div\n className={'eds-copyable-text ' + className}\n style={{ ...rest.style }}\n type=\"button\"\n onClick={handleClick}\n tabIndex={-1}\n aria-label=\"\"\n {...rest}\n >\n <PreformattedText className=\"eds-copyable-text__preformatted-text\">\n <span className=\"eds-copyable-text__displayed-text\">{children}</span>\n <IconButton\n className=\"eds-copyable-text__button\"\n aria-label={ariaLabel}\n type=\"button\"\n ref={buttonRef}\n >\n <CopyIcon className={'eds-copyable-text__button__icon'} />\n </IconButton>\n </PreformattedText>\n </div>\n );\n};\n","import { BaseExpand, ExpandArrow } from '@entur/expand';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { BannerAlertBoxProps } from './BannerAlertBox';\nimport { BaseAlertBox } from './BaseAlertBox';\nimport './ExpandableAlertBox.scss';\nimport { SmallAlertBoxProps } from './SmallAlertBox';\n\nexport type SmallExpandableAlertBoxProps = ExpandableAlertBoxProps &\n SmallAlertBoxProps;\n\nexport const SmallExpandableAlertBox: React.FC<\n SmallExpandableAlertBoxProps\n> = props => {\n return <ExpandableAlertBox size=\"small\" {...props} />;\n};\n\nexport type BannerExpandableAlertBoxProps = ExpandableAlertBoxProps &\n BannerAlertBoxProps;\n\nexport const BannerExpandableAlertBox: React.FC<\n BannerExpandableAlertBoxProps\n> = props => {\n return <ExpandableAlertBox size=\"banner\" {...props} />;\n};\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\ntype ExpandableAlertBoxProps = {\n /**Farge og uttrykk på alert-boksen*/\n variant: VariantType | typeof info | typeof error;\n /** Tittelen til ExpandableAlertBox */\n title: React.ReactNode;\n /**Innhold som vises ved ekspandering */\n children: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Tekst som vises på ekspanderingsknappen før åpning\n * @default \"Les mer\"\n */\n openLabel?: string;\n /** Tekst som vises på ekspanderingsknappen når den er åpnet\n * @default \"Lukk\"\n */\n closeLabel?: string;\n [key: string]: any;\n};\n\nconst ExpandableAlertBox: React.FC<ExpandableAlertBoxProps> = ({\n variant,\n title,\n children,\n size,\n className,\n openLabel,\n closeLabel,\n ...rest\n}) => {\n const [open, setopen] = React.useState(false);\n return (\n <BaseAlertBox\n size={size}\n variant={variant}\n className={classNames('eds-expandable-alert-box', className)}\n title={\n <ExpandableAlertBoxTitle\n open={open}\n title={title}\n onClick={() => setopen(!open)}\n openLabel={openLabel}\n closeLabel={closeLabel}\n />\n }\n {...rest}\n >\n <BaseExpand open={open}>{children}</BaseExpand>\n </BaseAlertBox>\n );\n};\n\ntype ExpandableAlertBoxTitleProps = {\n title: React.ReactNode;\n open: boolean;\n openLabel?: string;\n closeLabel?: string;\n onClick: (e: React.MouseEvent) => void;\n};\n\nconst ExpandableAlertBoxTitle: React.FC<ExpandableAlertBoxTitleProps> = ({\n title,\n open,\n openLabel = 'Les mer',\n closeLabel = 'Lukk',\n onClick,\n}) => {\n return (\n <div className=\"eds-expandable-alert-box__title\">\n <div>{title}</div>\n <button\n className=\"eds-expandable-alert-box__button\"\n onClick={onClick}\n type=\"button\"\n >\n {open ? closeLabel : openLabel}\n <ExpandArrow open={open} inline />\n </button>\n </div>\n );\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('alert', 'icons');\n\nexport { BannerAlertBox } from './BannerAlertBox';\nexport { ToastAlertBox } from './ToastAlertBox';\nexport { SmallAlertBox } from './SmallAlertBox';\nexport { ToastProvider, useToast } from './ToastProvider';\nexport { CopyableText } from './CopyableText';\nexport * from './ExpandableAlertBox';\n"],"names":["ValidationSuccessIcon","ValidationInfoIcon","ValidationExclamationIcon","ValidationErrorIcon","jsxs","jsx","Tooltip","IconButton","CloseIcon","delay","PreformattedText","CopyIcon","BaseExpand","ExpandArrow","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;AAeA,MAAM,WAAW;AAAA,EACf,SAAS;AAAA,IACP,MAAMA,MAAAA;AAAAA,IACN,aAAa;AAAA,EAAA;AAAA,EAEf,aAAa,EAAE,MAAMC,0BAAoB,aAAa,cAAA;AAAA,EACtD,SAAS;AAAA,IACP,MAAMC,MAAAA;AAAAA,IACN,aAAa;AAAA,EAAA;AAAA,EAEf,UAAU,EAAE,MAAMC,2BAAqB,aAAa,cAAA;AAAA;AAAA,EAEpD,MAAM,EAAE,MAAMF,0BAAoB,aAAa,cAAA;AAAA,EAC/C,OAAO,EAAE,MAAME,MAAAA,qBAAqB,aAAa,cAAA;AACnD;AAiCO,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB;AAAA,EACA,UAAU,OAAO,CAAA;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,UAAU,SAAS,IAAI,MAAM,SAAS,KAAK;AAClD,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,QAAM,cAAc,MAAM;AACxB,cAAU,IAAI;AACd,YAAA;AAAA,EACF;AACA,QAAM,OAAO,SAAS,OAAO,EAAE;AAC/B,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,kBAAkB,IAAI;AAAA,QACtB,kBAA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