@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.
- package/dist/LayoutBase-CAdjuw9Q.js +18 -0
- package/dist/assets/Banner.css +1 -1
- package/dist/assets/HeaderDrawer.css +1 -1
- package/dist/assets/HeaderDropdown.css +1 -1
- package/dist/assets/LayoutBase.css +1 -1
- package/dist/components/Banner/Banner.js +34 -34
- package/dist/components/GlobalHeader/HeaderDrawer.js +13 -13
- package/dist/components/GlobalHeader/HeaderDropdown.js +8 -8
- package/dist/components/Layout/Layout.js +63 -40
- package/dist/components/Layout/LayoutBase.js +3 -5
- package/dist/components/Layout/index.js +9 -9
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/lib/components/Banner/Banner.stories.d.ts +1 -0
- package/dist/types/lib/components/Layout/Layout.d.ts +14 -1
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +3 -1
- package/dist/types/lib/components/Layout/LayoutBase.d.ts +2 -1
- package/package.json +1 -1
|
@@ -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
|
+
};
|
package/dist/assets/Banner.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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}.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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,
|
|
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) &&
|
|
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
|
-
|
|
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,
|
|
21
|
+
const I = f((e, o) => {
|
|
22
22
|
var { title: r, titleId: t } = e, l = _(e, ["title", "titleId"]);
|
|
23
|
-
let
|
|
24
|
-
return
|
|
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:
|
|
27
|
-
r ? i.createElement("title", { id:
|
|
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,
|
|
31
|
+
var j = function(e, o) {
|
|
32
32
|
var r = {};
|
|
33
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(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
|
-
|
|
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,
|
|
39
|
+
const x = f((e, o) => {
|
|
40
40
|
var { title: r, titleId: t } = e, l = j(e, ["title", "titleId"]);
|
|
41
|
-
let
|
|
42
|
-
return
|
|
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:
|
|
45
|
-
r ? i.createElement("title", { id:
|
|
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,
|
|
49
|
+
var S = function(e, o) {
|
|
50
50
|
var r = {};
|
|
51
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(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
|
-
|
|
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,
|
|
57
|
+
const P = f((e, o) => {
|
|
58
58
|
var { title: r, titleId: t } = e, l = S(e, ["title", "titleId"]);
|
|
59
|
-
let
|
|
60
|
-
return
|
|
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:
|
|
63
|
-
r ? i.createElement("title", { id:
|
|
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 = "
|
|
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:
|
|
76
|
+
onClose: o,
|
|
77
77
|
icon: r,
|
|
78
78
|
title: t,
|
|
79
79
|
body: l,
|
|
80
|
-
color:
|
|
80
|
+
color: n,
|
|
81
81
|
variant: c,
|
|
82
|
-
sticky:
|
|
82
|
+
sticky: p = !0
|
|
83
83
|
}) => {
|
|
84
|
-
const
|
|
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]:
|
|
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":
|
|
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:
|
|
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
|
-
!!
|
|
101
|
+
!!o && /* @__PURE__ */ s(
|
|
102
102
|
v,
|
|
103
103
|
{
|
|
104
104
|
size: "sm",
|
|
105
105
|
variant: c === "strong" ? "solid" : "ghost",
|
|
106
|
-
onClick:
|
|
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
|
|
2
|
-
import { useRef as N, useEffect as
|
|
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 = "
|
|
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:
|
|
23
|
-
onToggle:
|
|
22
|
+
expanded: f,
|
|
23
|
+
onToggle: v,
|
|
24
24
|
children: _
|
|
25
25
|
}) => {
|
|
26
26
|
const { languageCode: w } = L(), u = q(w), d = N(null);
|
|
27
|
-
|
|
27
|
+
h(() => {
|
|
28
28
|
const e = d.current, s = (t) => {
|
|
29
|
-
const { clientY:
|
|
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 <=
|
|
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]),
|
|
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(
|
|
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":
|
|
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:
|
|
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(
|
|
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
|
|
9
|
-
dropdown:
|
|
10
|
-
},
|
|
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:
|
|
13
|
+
className: e.dropdown,
|
|
14
14
|
id: o,
|
|
15
15
|
open: r,
|
|
16
|
-
trigger:
|
|
17
|
-
onClose:
|
|
16
|
+
trigger: t,
|
|
17
|
+
onClose: p,
|
|
18
18
|
variant: "drawer-dropdown",
|
|
19
19
|
placement: "right",
|
|
20
20
|
size: "md",
|
|
21
|
-
children:
|
|
21
|
+
children: d
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
g as HeaderDropdown
|
|
26
26
|
};
|
|
@@ -1,58 +1,81 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
11
|
-
import { GlobalHeader as
|
|
12
|
-
import "
|
|
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
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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:
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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:
|
|
41
|
-
hidden:
|
|
42
|
-
color:
|
|
43
|
-
footer:
|
|
63
|
+
sticky: r?.sticky,
|
|
64
|
+
hidden: r?.hidden,
|
|
65
|
+
color: r?.color,
|
|
66
|
+
footer: r?.footer,
|
|
44
67
|
children: [
|
|
45
|
-
|
|
46
|
-
|
|
68
|
+
r?.menu && /* @__PURE__ */ t(I, { ...r?.menu }),
|
|
69
|
+
r?.children
|
|
47
70
|
]
|
|
48
71
|
}
|
|
49
72
|
),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t(j, { color: d?.color, id: "main-content", children: y })
|
|
51
74
|
] })
|
|
52
75
|
] }),
|
|
53
|
-
|
|
76
|
+
c && /* @__PURE__ */ t(M, { ...c })
|
|
54
77
|
] });
|
|
55
78
|
};
|
|
56
79
|
export {
|
|
57
|
-
|
|
80
|
+
oo as Layout
|
|
58
81
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
4
|
+
t as LayoutBase
|
|
7
5
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LayoutGrid as
|
|
3
|
-
import { LayoutBody as
|
|
4
|
-
import { LayoutContent as
|
|
5
|
-
import { LayoutSidebar as
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
L as LayoutBody,
|
|
11
|
+
m as LayoutContent,
|
|
12
|
+
e as LayoutGrid,
|
|
13
|
+
u as LayoutSidebar
|
|
14
14
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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;
|