@altinn/altinn-components 0.29.5 → 0.30.1
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/assets/Banner.css +1 -0
- package/dist/components/Banner/Banner.js +64 -0
- package/dist/components/Banner/index.js +5 -0
- package/dist/components/Bookmarks/EditableBookmark.js +4 -4
- package/dist/components/index.js +407 -404
- package/dist/index.js +413 -410
- package/dist/types/lib/components/Banner/Banner.d.ts +16 -0
- package/dist/types/lib/components/Banner/Banner.stories.d.ts +18 -0
- package/dist/types/lib/components/Banner/index.d.ts +1 -0
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +1 -0
- package/dist/types/lib/components/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._banner_1of7r_1{background-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default);margin-top:0;padding:.5rem;display:flex;justify-content:space-between;align-items:center;column-gap:.5rem}._sticky_1of7r_12{position:sticky;top:0;z-index:1000}._title_1of7r_18{margin:0;padding:1rem;font-size:1rem;font-weight:500;line-height:1.5rem}._infoIcon_1of7r_25{min-height:1.5rem;max-height:1.5rem;min-width:1.5rem;max-width:1.5rem;margin-right:.5rem;vertical-align:bottom}._closeIcon_1of7r_34{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}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { c as f } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import * as c from "react";
|
|
5
|
+
import { forwardRef as d } from "react";
|
|
6
|
+
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
8
|
+
import "../Snackbar/useSnackbar.js";
|
|
9
|
+
import { IconButton as m } from "../Button/IconButton.js";
|
|
10
|
+
import { u as p } from "../../useId-BVFxCjkq.js";
|
|
11
|
+
import { S as u } from "../../XMark-DIqxCTTQ.js";
|
|
12
|
+
import '../../assets/Banner.css';var v = function(e, o) {
|
|
13
|
+
var n = {};
|
|
14
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (n[t] = e[t]);
|
|
15
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
+
for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
|
|
17
|
+
o.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
|
|
18
|
+
return n;
|
|
19
|
+
};
|
|
20
|
+
const h = d((e, o) => {
|
|
21
|
+
var { title: n, titleId: t } = e, r = v(e, ["title", "titleId"]);
|
|
22
|
+
let a = p();
|
|
23
|
+
return a = n ? t || "title-" + a : void 0, c.createElement(
|
|
24
|
+
"svg",
|
|
25
|
+
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": a }, r),
|
|
26
|
+
n ? c.createElement("title", { id: a }, n) : null,
|
|
27
|
+
c.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M4 3.25a.75.75 0 0 0-.75.75v16c0 .414.336.75.75.75h16a.75.75 0 0 0 .75-.75V4a.75.75 0 0 0-.75-.75zm.75 16V4.75h14.5v14.5zM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0M10.5 10a.75.75 0 0 0 0 1.5h.75v4h-.75a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-.75v-4.75A.75.75 0 0 0 12 10z", clipRule: "evenodd" })
|
|
28
|
+
);
|
|
29
|
+
}), _ = "_banner_1of7r_1", b = "_sticky_1of7r_12", g = "_title_1of7r_18", y = "_infoIcon_1of7r_25", i = {
|
|
30
|
+
banner: _,
|
|
31
|
+
sticky: b,
|
|
32
|
+
title: g,
|
|
33
|
+
infoIcon: y
|
|
34
|
+
};
|
|
35
|
+
var w = /* @__PURE__ */ ((e) => (e.accent = "accent", e.success = "success", e.warning = "warning", e.danger = "danger", e.info = "info", e))(w || {});
|
|
36
|
+
const z = ({ closeTitle: e = "close", onClose: o, text: n, color: t, sticky: r = !0 }) => /* @__PURE__ */ s(
|
|
37
|
+
"section",
|
|
38
|
+
{
|
|
39
|
+
className: f(i.banner, { [i.sticky]: r }),
|
|
40
|
+
role: "status",
|
|
41
|
+
"aria-live": "polite",
|
|
42
|
+
"data-color": t,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ s("div", { className: i.title, children: [
|
|
45
|
+
/* @__PURE__ */ l(h, { className: i.infoIcon, "aria-hidden": !0 }),
|
|
46
|
+
/* @__PURE__ */ l("span", { children: n })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ l(
|
|
49
|
+
m,
|
|
50
|
+
{
|
|
51
|
+
icon: u,
|
|
52
|
+
variant: "solid",
|
|
53
|
+
onClick: o,
|
|
54
|
+
className: i.dismiss,
|
|
55
|
+
iconAltText: e
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
export {
|
|
62
|
+
z as Banner,
|
|
63
|
+
w as BannerColorEnum
|
|
64
|
+
};
|
|
@@ -3,9 +3,9 @@ import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { forwardRef as h, useState as O } from "react";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
|
-
import { BookmarksListItem as x } from "./BookmarksListItem.js";
|
|
7
6
|
import { Button as g } from "../Button/Button.js";
|
|
8
|
-
import { IconButton as
|
|
7
|
+
import { IconButton as x } from "../Button/IconButton.js";
|
|
8
|
+
import { BookmarksListItem as I } from "./BookmarksListItem.js";
|
|
9
9
|
import "../RootProvider/RootProvider.js";
|
|
10
10
|
import "../Searchbar/AutocompleteBase.js";
|
|
11
11
|
import { QueryLabel as j } from "../Searchbar/QueryLabel.js";
|
|
@@ -49,7 +49,7 @@ const R = h((t, i) => {
|
|
|
49
49
|
}) => {
|
|
50
50
|
const [v, w] = O("");
|
|
51
51
|
return /* @__PURE__ */ n(
|
|
52
|
-
|
|
52
|
+
I,
|
|
53
53
|
{
|
|
54
54
|
...y,
|
|
55
55
|
expanded: r,
|
|
@@ -58,7 +58,7 @@ const R = h((t, i) => {
|
|
|
58
58
|
ariaLabel: i || o,
|
|
59
59
|
params: e,
|
|
60
60
|
controls: /* @__PURE__ */ n(
|
|
61
|
-
|
|
61
|
+
x,
|
|
62
62
|
{
|
|
63
63
|
variant: "outline",
|
|
64
64
|
size: "xs",
|