@rikstv/shared-components 3.0.10 → 3.0.11
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.
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
import { j as s } from "../accordion/Accordion-5e72e67b.mjs";
|
|
2
2
|
import { forwardRef as S, useState as o } from "react";
|
|
3
|
-
import { H as
|
|
3
|
+
import { H as k } from "../typography/Typography-9bd16944.mjs";
|
|
4
4
|
import "../icons/HeartToggle-a5a93ca7.mjs";
|
|
5
|
-
import { S as
|
|
6
|
-
const
|
|
7
|
-
rdsAlertIcon:
|
|
8
|
-
rdsAlertContentTitle:
|
|
9
|
-
rdsAlertContent:
|
|
5
|
+
import { S as w, a as T, b as a, c as b } from "../icons/Icons-7851b1ff.mjs";
|
|
6
|
+
const R = "_rds-alert--icon_1ysvv_66", B = "_rds-alert--content-title_1ysvv_73", E = "_rds-alert--content_1ysvv_73", H = "_rds-alert--dismiss_1ysvv_94", O = "_dismissed_1ysvv_123", D = "_fade-out_1ysvv_1", t = {
|
|
7
|
+
rdsAlertIcon: R,
|
|
8
|
+
rdsAlertContentTitle: B,
|
|
9
|
+
rdsAlertContent: E,
|
|
10
10
|
rdsAlertDismiss: H,
|
|
11
|
-
dismissed:
|
|
12
|
-
fadeOut:
|
|
13
|
-
},
|
|
14
|
-
warning: { title: "Advarsel", Icon:
|
|
11
|
+
dismissed: O,
|
|
12
|
+
fadeOut: D
|
|
13
|
+
}, F = {
|
|
14
|
+
warning: { title: "Advarsel", Icon: T },
|
|
15
15
|
error: { title: "Feil", Icon: a },
|
|
16
16
|
info: { title: "Informasjon", Icon: a },
|
|
17
|
-
success: { title: "Vellykket", Icon:
|
|
18
|
-
},
|
|
17
|
+
success: { title: "Vellykket", Icon: b }
|
|
18
|
+
}, M = S(
|
|
19
19
|
({
|
|
20
20
|
className: d,
|
|
21
21
|
intent: r = "warning",
|
|
22
|
-
variant:
|
|
22
|
+
variant: l = "filled",
|
|
23
23
|
testId: c = "rds-alert",
|
|
24
24
|
heading: m,
|
|
25
25
|
children: v,
|
|
26
26
|
dismissible: f = !0,
|
|
27
27
|
lightBackground: A,
|
|
28
|
-
|
|
28
|
+
onDismissed: e,
|
|
29
29
|
LinkToDetails: _,
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
const [
|
|
33
|
-
if (
|
|
30
|
+
...u
|
|
31
|
+
}, j) => {
|
|
32
|
+
const [p, n] = o(!1), [x, i] = o(!1), C = ["rds-alert", A ? "rds-light" : "", p ? t.dismissed : "", d].filter(Boolean).join(" ");
|
|
33
|
+
if (x)
|
|
34
34
|
return null;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
}, { title: y, Icon: g } =
|
|
38
|
-
|
|
39
|
-
}, N = f &&
|
|
35
|
+
const I = () => {
|
|
36
|
+
n(!1), i(!1);
|
|
37
|
+
}, { title: y, Icon: g } = F[r], h = () => {
|
|
38
|
+
i(!0), e == null || e(I);
|
|
39
|
+
}, N = f && l !== "inline";
|
|
40
40
|
return /* @__PURE__ */ s.jsxs(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
role: "alert",
|
|
44
44
|
"aria-live": "polite",
|
|
45
|
-
ref:
|
|
46
|
-
className:
|
|
45
|
+
ref: j,
|
|
46
|
+
className: C,
|
|
47
47
|
"data-testid": c,
|
|
48
48
|
"data-intent": r,
|
|
49
|
-
"data-variant":
|
|
49
|
+
"data-variant": l,
|
|
50
50
|
onAnimationEnd: h,
|
|
51
|
-
...
|
|
51
|
+
...u,
|
|
52
52
|
children: [
|
|
53
53
|
/* @__PURE__ */ s.jsx(g, { className: t.rdsAlertIcon }),
|
|
54
54
|
/* @__PURE__ */ s.jsxs("div", { className: t.rdsAlertContent, children: [
|
|
55
|
-
/* @__PURE__ */ s.jsx(
|
|
55
|
+
/* @__PURE__ */ s.jsx(k, { className: t.rdsAlertContentTitle, as: "span", children: m || y }),
|
|
56
56
|
/* @__PURE__ */ s.jsx("div", { children: v }),
|
|
57
57
|
_
|
|
58
58
|
] }),
|
|
59
|
-
N && /* @__PURE__ */ s.jsx("div", { className: t.rdsAlertDismiss, children: /* @__PURE__ */ s.jsx("button", { "aria-label": "Avvis varsel", onClick: () =>
|
|
59
|
+
N && /* @__PURE__ */ s.jsx("div", { className: t.rdsAlertDismiss, children: /* @__PURE__ */ s.jsx("button", { "aria-label": "Avvis varsel", onClick: () => n(!0), children: /* @__PURE__ */ s.jsx(w, {}) }) })
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
|
|
65
|
+
M.displayName = "Alert";
|
|
66
66
|
export {
|
|
67
|
-
|
|
67
|
+
M as A
|
|
68
68
|
};
|
|
@@ -38,7 +38,7 @@ export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
|
38
38
|
/**
|
|
39
39
|
* Callback for when fadeOut animation ends, passed a reset function to reset dismissed state
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
onDismissed?: (reset: () => void) => void;
|
|
42
42
|
/**
|
|
43
43
|
* Link to more information about the alert
|
|
44
44
|
*/
|
|
@@ -6,7 +6,7 @@ import { G as Z } from "./components/spacing/GutterPadding-bd018bd6.mjs";
|
|
|
6
6
|
import { N as re } from "./components/notificationDot/NotificationDot-bec7aa7b.mjs";
|
|
7
7
|
import { A as ne } from "./components/accordion/Accordion-5e72e67b.mjs";
|
|
8
8
|
import { P as se } from "./components/panel/Panel-88490c74.mjs";
|
|
9
|
-
import { A as ae } from "./components/alert/Alert-
|
|
9
|
+
import { A as ae } from "./components/alert/Alert-47ce69b5.mjs";
|
|
10
10
|
import { B as ue, a as me } from "./components/breadcrumb/Breadcrumb-4c6af82f.mjs";
|
|
11
11
|
import { P as fe } from "./components/progress/Progress-068e34f7.mjs";
|
|
12
12
|
import { L as xe } from "./components/loader/Loader-55215a54.mjs";
|