@altinn/altinn-components 0.61.3 → 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import './assets/LayoutBase.css';const n = "_base_1hj0u_1", c = {
3
+ base: n
4
+ }, i = ({ currentId: s, color: t, theme: e, bannerHeight: a, children: o }) => /* @__PURE__ */ r(
5
+ "div",
6
+ {
7
+ className: c.base,
8
+ "data-color": t,
9
+ "data-theme": e,
10
+ "data-current-id": s,
11
+ style: a ? { "--altinn-banner-height": `${a}px` } : void 0,
12
+ children: o
13
+ }
14
+ );
15
+ export {
16
+ i as L,
17
+ c as s
18
+ };
@@ -1 +1 @@
1
- ._banner_3u9bd_1{background-color:var(--ds-color-surface-tinted);color:var(--ds-color-text-default);margin-top:0;display:flex;justify-content:space-between;align-items:start;padding:.5rem;column-gap:.5rem}._banner_3u9bd_1[data-variant=strong]{background-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._sticky_3u9bd_18{position:sticky;top:0;z-index:1000}._content_3u9bd_24{padding:.5rem}._title_3u9bd_28{margin:0;font-size:1rem;font-weight:500;line-height:1.5rem}._icon_3u9bd_35{display:inline-block;width:1.5rem;height:1.5rem;margin-right:.5rem;vertical-align:bottom}._icon_3u9bd_35 svg{width:100%;height:100%}._closeIcon_3u9bd_48{min-height:1.5rem;max-height:1.5rem;min-width:1.5rem;max-width:1.5rem;color:var(--ds-color-warning-text-default);font-size:1.5rem}
1
+ ._banner_1oge9_1{background-color:var(--ds-color-surface-tinted);color:var(--ds-color-text-default);margin-top:0;display:flex;justify-content:space-between;align-items:start;padding:.5rem;column-gap:.5rem}._banner_1oge9_1[data-variant=strong]{background-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._sticky_1oge9_18{position:sticky;top:0;z-index:1000}._content_1oge9_24{padding:.5rem}._title_1oge9_28{margin:0;font-size:1rem;font-weight:500;line-height:1.5rem}._title_1oge9_28 a{color:inherit;text-decoration:underline}._icon_1oge9_40{display:inline-block;width:1.5rem;height:1.5rem;margin-right:.5rem;vertical-align:bottom}._icon_1oge9_40 svg{width:100%;height:100%}._closeIcon_1oge9_53{min-height:1.5rem;max-height:1.5rem;min-width:1.5rem;max-width:1.5rem;color:var(--ds-color-warning-text-default);font-size:1.5rem}
@@ -1 +1 @@
1
- html:has(dialog[open]){overflow:hidden;scrollbar-gutter:stable}._backdrop_1f6gf_11{display:block;z-index:1;background-color:#111d4640;position:fixed;top:4.5rem;right:0;bottom:0;left:0;width:100%;height:100%}._backdrop_1f6gf_11[aria-hidden=true]{display:none}._drawer_1f6gf_28{position:fixed;z-index:2;background-color:#fff;width:100%;max-width:100vw;height:auto;max-height:auto;box-sizing:border-box;padding:0;margin:0;border:0;top:4.5rem;bottom:0;display:flex;flex-direction:column;overflow-y:scroll}._drawer_1f6gf_28::backdrop{background-color:transparent}._drawer_1f6gf_28:not([data-open=true]){display:none}._footer_1f6gf_60{display:none}._body_1f6gf_64{padding:0 .5rem}@media(min-width:1024px){._body_1f6gf_64{padding:0 1rem}._drawer_1f6gf_28{top:4.5rem;bottom:4.5rem}._drawer_1f6gf_28[data-expanded=true]{bottom:0}._footer_1f6gf_60{position:sticky;z-index:2000;display:flex;bottom:0;left:0;right:0;justify-content:center;align-items:center;background-color:#fff}._toggleButton_1f6gf_94{margin:1rem 0}}
1
+ html:has(dialog[open]){overflow:hidden;scrollbar-gutter:stable}._backdrop_1fmb0_11{display:block;z-index:1;background-color:#111d4640;position:fixed;top:calc(4.5rem + var(--altinn-banner-height, 0px));right:0;bottom:0;left:0;width:100%;height:100%}._backdrop_1fmb0_11[aria-hidden=true]{display:none}._drawer_1fmb0_28{position:fixed;z-index:2;background-color:#fff;width:100%;max-width:100vw;height:auto;max-height:auto;box-sizing:border-box;padding:0;margin:0;border:0;top:calc(4.5rem + var(--altinn-banner-height, 0px));bottom:0;display:flex;flex-direction:column;overflow-y:scroll}._drawer_1fmb0_28::backdrop{background-color:transparent}._drawer_1fmb0_28:not([data-open=true]){display:none}._footer_1fmb0_60{display:none}._body_1fmb0_64{padding:0 .5rem}@media(min-width:1024px){._body_1fmb0_64{padding:0 1rem}._drawer_1fmb0_28{top:calc(4.5rem + var(--altinn-banner-height, 0px));bottom:4.5rem}._drawer_1fmb0_28[data-expanded=true]{bottom:0}._footer_1fmb0_60{position:sticky;z-index:2000;display:flex;bottom:0;left:0;right:0;justify-content:center;align-items:center;background-color:#fff}._toggleButton_1fmb0_94{margin:1rem 0}}
@@ -1 +1 @@
1
- ._dropdown_cdjbb_3[data-variant=drawer-dropdown] header{display:none}@media(max-width:1023px){._dropdown_cdjbb_3[data-variant=drawer-dropdown]{margin-top:4.5rem;box-shadow:none}}
1
+ ._dropdown_18s8n_3[data-variant=drawer-dropdown] header{display:none}@media(max-width:1023px){._dropdown_18s8n_3[data-variant=drawer-dropdown]{margin-top:calc(4.5rem + var(--altinn-banner-height, 0px));box-shadow:none}}
@@ -1 +1 @@
1
- ._base_k5ay7_1{position:relative;display:flex;flex-direction:column;min-height:100vh;background-color:var(--altinn-layout-background)}._base_k5ay7_1[data-theme=default]{--altinn-layout-background: var(--ds-color-background-default)}._base_k5ay7_1[data-theme=subtle]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_k5ay7_1[data-theme=neutral]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}._base_k5ay7_1[data-theme=inbox]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_k5ay7_1[data-theme=inbox][data-color=person],._base_k5ay7_1[data-theme=settings]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}
1
+ ._base_1hj0u_1{position:relative;display:flex;flex-direction:column;min-height:100vh;background-color:var(--altinn-layout-background);--altinn-banner-height: 0px}._base_1hj0u_1[data-theme=default]{--altinn-layout-background: var(--ds-color-background-default)}._base_1hj0u_1[data-theme=subtle]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_1hj0u_1[data-theme=neutral]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}._base_1hj0u_1[data-theme=inbox]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_1hj0u_1[data-theme=inbox][data-color=person],._base_1hj0u_1[data-theme=settings]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}
@@ -10,60 +10,60 @@ import "react-dom";
10
10
  import "../Snackbar/useSnackbar.js";
11
11
  import { u as m } from "../../useId-BVFxCjkq.js";
12
12
  import { S as w } from "../../Paperclip-DjN7qVfQ.js";
13
- import '../../assets/Banner.css';var _ = function(e, n) {
13
+ import '../../assets/Banner.css';var _ = function(e, o) {
14
14
  var r = {};
15
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
15
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
16
16
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
17
17
  for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
18
- n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
18
+ o.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
19
19
  return r;
20
20
  };
21
- const I = f((e, n) => {
21
+ const I = f((e, o) => {
22
22
  var { title: r, titleId: t } = e, l = _(e, ["title", "titleId"]);
23
- let o = m();
24
- return o = r ? t || "title-" + o : void 0, i.createElement(
23
+ let n = m();
24
+ return n = r ? t || "title-" + n : void 0, i.createElement(
25
25
  "svg",
26
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: n, "aria-labelledby": o }, l),
27
- r ? i.createElement("title", { id: o }, r) : null,
26
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": n }, l),
27
+ r ? i.createElement("title", { id: n }, r) : null,
28
28
  i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 2.25a.75.75 0 0 1 .656.387l9.527 17.25A.75.75 0 0 1 21.526 21H2.474a.75.75 0 0 1-.657-1.113l9.526-17.25A.75.75 0 0 1 12 2.25M12 8.75a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-1.5 0v-4a.75.75 0 0 1 .75-.75m-1 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0", clipRule: "evenodd" })
29
29
  );
30
30
  });
31
- var j = function(e, n) {
31
+ var j = function(e, o) {
32
32
  var r = {};
33
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
33
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
34
34
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
35
35
  for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
36
- n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
36
+ o.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
37
37
  return r;
38
38
  };
39
- const x = f((e, n) => {
39
+ const x = f((e, o) => {
40
40
  var { title: r, titleId: t } = e, l = j(e, ["title", "titleId"]);
41
- let o = m();
42
- return o = r ? t || "title-" + o : void 0, i.createElement(
41
+ let n = m();
42
+ return n = r ? t || "title-" + n : void 0, i.createElement(
43
43
  "svg",
44
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: n, "aria-labelledby": o }, l),
45
- r ? i.createElement("title", { id: o }, r) : null,
44
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": n }, l),
45
+ r ? i.createElement("title", { id: n }, r) : null,
46
46
  i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.25 4A.75.75 0 0 1 4 3.25h16a.75.75 0 0 1 .75.75v16a.75.75 0 0 1-.75.75H4a.75.75 0 0 1-.75-.75zM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0m-1.25 3a.75.75 0 0 1 .75-.75H12a.75.75 0 0 1 .75.75v4.75h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5h.75v-4h-.75a.75.75 0 0 1-.75-.75", clipRule: "evenodd" })
47
47
  );
48
48
  });
49
- var S = function(e, n) {
49
+ var S = function(e, o) {
50
50
  var r = {};
51
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
51
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
52
52
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
53
53
  for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
54
- n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
54
+ o.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (r[t[l]] = e[t[l]]);
55
55
  return r;
56
56
  };
57
- const P = f((e, n) => {
57
+ const P = f((e, o) => {
58
58
  var { title: r, titleId: t } = e, l = S(e, ["title", "titleId"]);
59
- let o = m();
60
- return o = r ? t || "title-" + o : void 0, i.createElement(
59
+ let n = m();
60
+ return n = r ? t || "title-" + n : void 0, i.createElement(
61
61
  "svg",
62
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: n, "aria-labelledby": o }, l),
63
- r ? i.createElement("title", { id: o }, r) : null,
62
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": n }, l),
63
+ r ? i.createElement("title", { id: n }, r) : null,
64
64
  i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94z", clipRule: "evenodd" })
65
65
  );
66
- }), k = "_banner_3u9bd_1", R = "_sticky_3u9bd_18", E = "_content_3u9bd_24", M = "_title_3u9bd_28", z = "_icon_3u9bd_35", a = {
66
+ }), k = "_banner_1oge9_1", R = "_sticky_1oge9_18", E = "_content_1oge9_24", M = "_title_1oge9_28", z = "_icon_1oge9_40", a = {
67
67
  banner: k,
68
68
  sticky: R,
69
69
  content: E,
@@ -73,37 +73,37 @@ const P = f((e, n) => {
73
73
  var H = /* @__PURE__ */ ((e) => (e.info = "info", e.success = "success", e.warning = "warning", e.danger = "danger", e))(H || {}), N = /* @__PURE__ */ ((e) => (e.default = "default", e.alert = "alert", e.error = "error", e.info = "info", e.strong = "strong", e))(N || {});
74
74
  const Q = ({
75
75
  closeTitle: e = "close",
76
- onClose: n,
76
+ onClose: o,
77
77
  icon: r,
78
78
  title: t,
79
79
  body: l,
80
- color: o,
80
+ color: n,
81
81
  variant: c,
82
- sticky: u = !0
82
+ sticky: p = !0
83
83
  }) => {
84
- const p = r || (c === "info" && x || c === "alert" && I || c === "error" && P || w);
84
+ const u = r || (c === "info" && x || c === "alert" && I || c === "error" && P || w);
85
85
  return /* @__PURE__ */ d(
86
86
  "section",
87
87
  {
88
- className: g(a.banner, { [a.sticky]: u }),
88
+ className: g(a.banner, { [a.sticky]: p }),
89
89
  role: "status",
90
90
  "aria-live": "polite",
91
91
  "data-variant": c,
92
- "data-color": o,
92
+ "data-color": n,
93
93
  children: [
94
94
  /* @__PURE__ */ d("div", { className: a.content, children: [
95
95
  /* @__PURE__ */ d(b, { size: "sm", leading: "normal", className: a.title, children: [
96
- /* @__PURE__ */ s(y, { svgElement: p, className: a.icon }),
96
+ /* @__PURE__ */ s(y, { svgElement: u, className: a.icon }),
97
97
  t
98
98
  ] }),
99
99
  l && /* @__PURE__ */ s(O, { size: "sm", className: a.body, children: l })
100
100
  ] }),
101
- !!n && /* @__PURE__ */ s(
101
+ !!o && /* @__PURE__ */ s(
102
102
  v,
103
103
  {
104
104
  size: "sm",
105
105
  variant: c === "strong" ? "solid" : "ghost",
106
- onClick: n,
106
+ onClick: o,
107
107
  className: a.dismiss,
108
108
  "aria-label": e,
109
109
  icon: !0,
@@ -1,5 +1,5 @@
1
- import { jsxs as c, Fragment as f, jsx as r } from "react/jsx-runtime";
2
- import { useRef as N, useEffect as v } from "react";
1
+ import { jsxs as c, Fragment as m, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as N, useEffect as h } from "react";
3
3
  import { Button as D } from "../Button/Button.js";
4
4
  import "../../index-p1eeF8LQ.js";
5
5
  import { u as L } from "../../ToolbarSearch-56Sm2j7P.js";
@@ -8,7 +8,7 @@ import "react-dom";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { S as z } from "../../ChevronUp-hn05LboH.js";
10
10
  import { S as j } from "../../ChevronDown-D_a7nb-G.js";
11
- import '../../assets/HeaderDrawer.css';const I = "_backdrop_1f6gf_11", M = "_drawer_1f6gf_28", R = "_footer_1f6gf_60", F = "_body_1f6gf_64", V = "_toggleButton_1f6gf_94", n = {
11
+ import '../../assets/HeaderDrawer.css';const I = "_backdrop_1fmb0_11", M = "_drawer_1fmb0_28", R = "_footer_1fmb0_60", F = "_body_1fmb0_64", V = "_toggleButton_1fmb0_94", n = {
12
12
  backdrop: I,
13
13
  drawer: M,
14
14
  footer: R,
@@ -19,14 +19,14 @@ import '../../assets/HeaderDrawer.css';const I = "_backdrop_1f6gf_11", M = "_dra
19
19
  open: i,
20
20
  onClose: a,
21
21
  closedBy: o = "any",
22
- expanded: m,
23
- onToggle: b,
22
+ expanded: f,
23
+ onToggle: v,
24
24
  children: _
25
25
  }) => {
26
26
  const { languageCode: w } = L(), u = q(w), d = N(null);
27
- v(() => {
27
+ h(() => {
28
28
  const e = d.current, s = (t) => {
29
- const { clientY: p, clientX: h, target: y } = t;
29
+ const { clientY: b, clientX: p, target: y } = t;
30
30
  if (t instanceof KeyboardEvent && t.key === "Escape") {
31
31
  if (o === "none") {
32
32
  t.preventDefault();
@@ -37,7 +37,7 @@ import '../../assets/HeaderDrawer.css';const I = "_backdrop_1f6gf_11", M = "_dra
37
37
  }
38
38
  if (!window.getSelection()?.toString() && e && y === e && o === "any") {
39
39
  const { top: E, left: S, right: x, bottom: C } = e.getBoundingClientRect();
40
- E <= p && p <= C && S <= h && h <= x || e?.close();
40
+ E <= b && b <= C && S <= p && p <= x || e?.close();
41
41
  }
42
42
  }, g = () => {
43
43
  const t = e?.querySelector("[autofocus]");
@@ -46,14 +46,14 @@ import '../../assets/HeaderDrawer.css';const I = "_backdrop_1f6gf_11", M = "_dra
46
46
  return e?.addEventListener("animationend", g), e?.addEventListener("click", s), e?.addEventListener("keydown", s), () => {
47
47
  e?.removeEventListener("animationend", g), e?.removeEventListener("click", s), e?.removeEventListener("keydown", s);
48
48
  };
49
- }, [o, a]), v(() => {
49
+ }, [o, a]), h(() => {
50
50
  const e = d.current;
51
51
  e && (i ? e.open || e.showModal() : e.open && e.close());
52
52
  }, [i]);
53
53
  const k = (e) => {
54
54
  e.preventDefault(), o === "any" && a();
55
55
  };
56
- return /* @__PURE__ */ c(f, { children: [
56
+ return /* @__PURE__ */ c(m, { children: [
57
57
  /* @__PURE__ */ r("div", { className: n.backdrop, "aria-hidden": !i }),
58
58
  /* @__PURE__ */ c(
59
59
  "dialog",
@@ -63,16 +63,16 @@ import '../../assets/HeaderDrawer.css';const I = "_backdrop_1f6gf_11", M = "_dra
63
63
  "aria-modal": "true",
64
64
  "aria-labelledby": "modal-title",
65
65
  "data-open": i,
66
- "data-expanded": m,
66
+ "data-expanded": f,
67
67
  onCancel: k,
68
68
  className: n.drawer,
69
69
  onClose: o !== "none" ? a : void 0,
70
70
  children: [
71
71
  /* @__PURE__ */ r("div", { className: n.body, children: _ }),
72
- o !== "none" && /* @__PURE__ */ r("footer", { className: n.footer, children: /* @__PURE__ */ r(D, { className: n.toggleButton, variant: "outline", onClick: b, children: m ? /* @__PURE__ */ c(f, { children: [
72
+ o !== "none" && /* @__PURE__ */ r("footer", { className: n.footer, children: /* @__PURE__ */ r(D, { className: n.toggleButton, variant: "outline", onClick: v, children: f ? /* @__PURE__ */ c(m, { children: [
73
73
  /* @__PURE__ */ r(z, { className: n.btnIcon, "aria-hidden": "true" }),
74
74
  u.minimize
75
- ] }) : /* @__PURE__ */ c(f, { children: [
75
+ ] }) : /* @__PURE__ */ c(m, { children: [
76
76
  /* @__PURE__ */ r(j, { className: n.btnIcon, "aria-hidden": "true" }),
77
77
  u.fullscreen
78
78
  ] }) }) })
@@ -5,22 +5,22 @@ import { g as m } from "../../ToolbarSearch-56Sm2j7P.js";
5
5
  import "../Typography/Link.js";
6
6
  import "../Button/Button.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import '../../assets/HeaderDropdown.css';const e = "_dropdown_cdjbb_3", i = {
9
- dropdown: e
10
- }, f = ({ id: o, open: r, onClose: d, trigger: p, children: t }) => /* @__PURE__ */ n(
8
+ import '../../assets/HeaderDropdown.css';const s = "_dropdown_18s8n_3", e = {
9
+ dropdown: s
10
+ }, g = ({ id: o, open: r, onClose: p, trigger: t, children: d }) => /* @__PURE__ */ n(
11
11
  m,
12
12
  {
13
- className: i.dropdown,
13
+ className: e.dropdown,
14
14
  id: o,
15
15
  open: r,
16
- trigger: p,
17
- onClose: d,
16
+ trigger: t,
17
+ onClose: p,
18
18
  variant: "drawer-dropdown",
19
19
  placement: "right",
20
20
  size: "md",
21
- children: t
21
+ children: d
22
22
  }
23
23
  );
24
24
  export {
25
- f as HeaderDropdown
25
+ g as HeaderDropdown
26
26
  };
@@ -1,58 +1,81 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
- import { LayoutBase as y } from "./LayoutBase.js";
4
- import { LayoutGrid as d } from "./LayoutGrid.js";
5
- import { LayoutBody as h } from "./LayoutBody.js";
6
- import { LayoutContent as L } from "./LayoutContent.js";
7
- import { LayoutSidebar as a } from "./LayoutSidebar.js";
8
- import { Breadcrumbs as s } from "../Breadcrumbs/Breadcrumbs.js";
2
+ import { jsxs as e, jsx as t, Fragment as L } from "react/jsx-runtime";
3
+ import { useRef as v, useState as B, useEffect as x } from "react";
4
+ import { L as R, s as S } from "../../LayoutBase-CAdjuw9Q.js";
5
+ import { LayoutGrid as H } from "./LayoutGrid.js";
6
+ import { LayoutBody as z } from "./LayoutBody.js";
7
+ import { LayoutContent as j } from "./LayoutContent.js";
8
+ import { LayoutSidebar as C } from "./LayoutSidebar.js";
9
+ import { Banner as F } from "../Banner/Banner.js";
10
+ import { Breadcrumbs as G } from "../Breadcrumbs/Breadcrumbs.js";
9
11
  import "../../index-p1eeF8LQ.js";
10
- import { Footer as x } from "../Footer/Footer.js";
11
- import { GlobalHeader as B } from "../GlobalHeader/GlobalHeader.js";
12
- import "react";
13
- import { u as j, M as k } from "../../ToolbarSearch-56Sm2j7P.js";
12
+ import { Footer as M } from "../Footer/Footer.js";
13
+ import { GlobalHeader as w } from "../GlobalHeader/GlobalHeader.js";
14
+ import { u as E, M as I } from "../../ToolbarSearch-56Sm2j7P.js";
14
15
  import "../Typography/Link.js";
15
16
  import "../Button/Button.js";
16
17
  import "react-dom";
17
18
  import "../Snackbar/useSnackbar.js";
18
- import { SkipLink as C } from "../SkipLink/SkipLink.js";
19
- const N = ({
20
- color: c,
21
- theme: u = "subtle",
22
- header: i,
23
- footer: n,
24
- sidebar: o,
25
- content: l = {},
26
- children: f,
27
- skipLink: p,
28
- breadcrumbs: e
19
+ import { SkipLink as N } from "../SkipLink/SkipLink.js";
20
+ const oo = ({
21
+ banner: o,
22
+ color: a,
23
+ theme: h = "subtle",
24
+ header: n,
25
+ footer: c,
26
+ sidebar: r,
27
+ content: d = {},
28
+ children: y,
29
+ skipLink: m,
30
+ breadcrumbs: l
29
31
  }) => {
30
- const { currentId: m } = j();
31
- return /* @__PURE__ */ r(y, { color: c, theme: u, currentId: m, children: [
32
- p && /* @__PURE__ */ t(C, { ...p }),
33
- i && /* @__PURE__ */ t(B, { ...i }),
34
- /* @__PURE__ */ r(d, { currentId: m, children: [
35
- e && /* @__PURE__ */ t(s, { ...e }),
36
- /* @__PURE__ */ r(h, { currentId: m, children: [
37
- o && /* @__PURE__ */ r(
38
- a,
32
+ const { currentId: i } = E(), s = v(null), [k, g] = B(0);
33
+ return x(() => {
34
+ const f = s.current;
35
+ if (!f) return;
36
+ const p = new ResizeObserver(([u]) => {
37
+ g(u.borderBoxSize[0]?.blockSize ?? u.contentRect.height);
38
+ });
39
+ return p.observe(f), () => p.disconnect();
40
+ }, []), /* @__PURE__ */ e(R, { color: a, theme: h, currentId: i, bannerHeight: o ? k : 0, children: [
41
+ m && /* @__PURE__ */ t(N, { ...m }),
42
+ o && /* @__PURE__ */ t("div", { ref: s, className: S.bannerWrapper, "data-color": "company", children: /* @__PURE__ */ t(
43
+ F,
44
+ {
45
+ title: o.link ? /* @__PURE__ */ e(L, { children: [
46
+ o.title,
47
+ " ",
48
+ /* @__PURE__ */ t("a", { href: o.link.href, target: "_blank", rel: "noreferrer", children: o.link.label })
49
+ ] }) : o.title,
50
+ color: o.color,
51
+ variant: o.variant || "strong",
52
+ icon: o.icon,
53
+ sticky: !1
54
+ }
55
+ ) }),
56
+ n && /* @__PURE__ */ t(w, { ...n }),
57
+ /* @__PURE__ */ e(H, { currentId: i, children: [
58
+ l && /* @__PURE__ */ t(G, { ...l }),
59
+ /* @__PURE__ */ e(z, { currentId: i, children: [
60
+ r && /* @__PURE__ */ e(
61
+ C,
39
62
  {
40
- sticky: o?.sticky,
41
- hidden: o?.hidden,
42
- color: o?.color,
43
- footer: o?.footer,
63
+ sticky: r?.sticky,
64
+ hidden: r?.hidden,
65
+ color: r?.color,
66
+ footer: r?.footer,
44
67
  children: [
45
- o?.menu && /* @__PURE__ */ t(k, { ...o?.menu }),
46
- o?.children
68
+ r?.menu && /* @__PURE__ */ t(I, { ...r?.menu }),
69
+ r?.children
47
70
  ]
48
71
  }
49
72
  ),
50
- /* @__PURE__ */ t(L, { color: l?.color, id: "main-content", children: f })
73
+ /* @__PURE__ */ t(j, { color: d?.color, id: "main-content", children: y })
51
74
  ] })
52
75
  ] }),
53
- n && /* @__PURE__ */ t(x, { ...n })
76
+ c && /* @__PURE__ */ t(M, { ...c })
54
77
  ] });
55
78
  };
56
79
  export {
57
- N as Layout
80
+ oo as Layout
58
81
  };
@@ -1,7 +1,5 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/LayoutBase.css';const r = "_base_k5ay7_1", c = {
3
- base: r
4
- }, n = ({ currentId: a, color: s, theme: t, children: e }) => /* @__PURE__ */ o("div", { className: c.base, "data-color": s, "data-theme": t, "data-current-id": a, children: e });
1
+ import "react/jsx-runtime";
2
+ import { L as t } from "../../LayoutBase-CAdjuw9Q.js";
5
3
  export {
6
- n as LayoutBase
4
+ t as LayoutBase
7
5
  };
@@ -1,14 +1,14 @@
1
- import { LayoutBase as t } from "./LayoutBase.js";
2
- import { LayoutGrid as a } from "./LayoutGrid.js";
3
- import { LayoutBody as f } from "./LayoutBody.js";
4
- import { LayoutContent as p } from "./LayoutContent.js";
5
- import { LayoutSidebar as x } from "./LayoutSidebar.js";
1
+ import { L as t } from "../../LayoutBase-CAdjuw9Q.js";
2
+ import { LayoutGrid as e } from "./LayoutGrid.js";
3
+ import { LayoutBody as L } from "./LayoutBody.js";
4
+ import { LayoutContent as m } from "./LayoutContent.js";
5
+ import { LayoutSidebar as u } from "./LayoutSidebar.js";
6
6
  import { Layout as d } from "./Layout.js";
7
7
  export {
8
8
  d as Layout,
9
9
  t as LayoutBase,
10
- f as LayoutBody,
11
- p as LayoutContent,
12
- a as LayoutGrid,
13
- x as LayoutSidebar
10
+ L as LayoutBody,
11
+ m as LayoutContent,
12
+ e as LayoutGrid,
13
+ u as LayoutSidebar
14
14
  };
@@ -69,7 +69,7 @@ import { ItemControls as ae } from "./Item/ItemControls.js";
69
69
  import { ItemSelect as xe } from "./Item/ItemSelect.js";
70
70
  import { ItemBase as ie } from "./Item/ItemBase.js";
71
71
  import { ItemLink as ne } from "./Item/ItemLink.js";
72
- import { LayoutBase as ce } from "./Layout/LayoutBase.js";
72
+ import { L as ce } from "../LayoutBase-CAdjuw9Q.js";
73
73
  import { LayoutGrid as de } from "./Layout/LayoutGrid.js";
74
74
  import { LayoutBody as De } from "./Layout/LayoutBody.js";
75
75
  import { LayoutContent as Be } from "./Layout/LayoutContent.js";
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ import { ItemControls as ae } from "./components/Item/ItemControls.js";
69
69
  import { ItemSelect as xe } from "./components/Item/ItemSelect.js";
70
70
  import { ItemBase as ie } from "./components/Item/ItemBase.js";
71
71
  import { ItemLink as ne } from "./components/Item/ItemLink.js";
72
- import { LayoutBase as ce } from "./components/Layout/LayoutBase.js";
72
+ import { L as ce } from "./LayoutBase-CAdjuw9Q.js";
73
73
  import { LayoutGrid as de } from "./components/Layout/LayoutGrid.js";
74
74
  import { LayoutBody as De } from "./components/Layout/LayoutBody.js";
75
75
  import { LayoutContent as Be } from "./components/Layout/LayoutContent.js";
@@ -22,3 +22,4 @@ export declare const InfoExpanded: Story;
22
22
  export declare const ErrorBanner: Story;
23
23
  export declare const ErrorExpanded: Story;
24
24
  export declare const Colors: (args: BannerProps) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const StrongCompany: (args: BannerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { LayoutColor, LayoutSidebarProps, LayoutTheme } from '.';
3
+ import { BannerColor, BannerVariant } from '../Banner';
3
4
  import { BreadcrumbsProps } from '../Breadcrumbs';
4
5
  import { FooterProps } from '../Footer';
5
6
  import { GlobalHeaderProps } from '../GlobalHeader';
7
+ import { SvgElement } from '../Icon';
6
8
  import { MenuProps } from '../Menu';
7
9
  import { SkipLinkProps } from '../SkipLink';
8
10
  interface SidebarProps extends LayoutSidebarProps {
@@ -12,7 +14,18 @@ interface SidebarProps extends LayoutSidebarProps {
12
14
  interface ContentProps {
13
15
  color?: LayoutColor;
14
16
  }
17
+ export interface LayoutBannerProps {
18
+ title: string;
19
+ link?: {
20
+ label: string;
21
+ href: string;
22
+ };
23
+ color?: BannerColor;
24
+ variant?: BannerVariant;
25
+ icon?: SvgElement;
26
+ }
15
27
  export interface LayoutProps {
28
+ banner?: LayoutBannerProps;
16
29
  color?: LayoutColor;
17
30
  theme?: LayoutTheme;
18
31
  header?: GlobalHeaderProps;
@@ -23,5 +36,5 @@ export interface LayoutProps {
23
36
  skipLink?: SkipLinkProps;
24
37
  breadcrumbs?: BreadcrumbsProps;
25
38
  }
26
- export declare const Layout: ({ color, theme, header, footer, sidebar, content, children, skipLink, breadcrumbs, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const Layout: ({ banner, color, theme, header, footer, sidebar, content, children, skipLink, breadcrumbs, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
27
40
  export {};
@@ -4,7 +4,7 @@ interface LayoutStoryArgs extends LayoutProps {
4
4
  }
5
5
  declare const meta: {
6
6
  title: string;
7
- component: ({ color, theme, header, footer, sidebar, content, children, skipLink, breadcrumbs, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
7
+ component: ({ banner, color, theme, header, footer, sidebar, content, children, skipLink, breadcrumbs, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
@@ -46,4 +46,6 @@ export declare const HiddenSidebar: (args: LayoutStoryArgs) => import("react/jsx
46
46
  export declare const Fullscreen: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
47
47
  export declare const Profile: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
48
48
  export declare const SidebarReference: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
49
+ export declare const WithBanner: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
50
+ export declare const WithCustomBanner: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
49
51
  export declare const InboxLayout: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ export interface LayoutBaseProps {
5
5
  color?: LayoutColor;
6
6
  theme?: LayoutTheme /** TODO: Should be renamed to variant */;
7
7
  currentId?: string;
8
+ bannerHeight?: number;
8
9
  children?: ReactNode;
9
10
  }
10
11
  /**
@@ -20,4 +21,4 @@ export interface LayoutBaseProps {
20
21
  * - Footer
21
22
  *
22
23
  */
23
- export declare const LayoutBase: ({ currentId, color, theme, children }: LayoutBaseProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const LayoutBase: ({ currentId, color, theme, bannerHeight, children }: LayoutBaseProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.61.3",
3
+ "version": "0.62.0",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",