@altinn/altinn-components 0.45.3 → 0.45.4
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/Typography.css +1 -1
- package/dist/components/Account/AccountMenu.js +23 -23
- package/dist/components/Article/ArticleHeader.js +5 -5
- package/dist/components/Typography/Typography.js +6 -6
- package/dist/types/lib/components/Typography/Typography.stories.d.ts +2 -0
- package/dist/types/lib/stories/Portal.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._typography_1h9tz_1{width:100%;line-height:1.5}p._typography_1h9tz_1{margin:0}._typography_1h9tz_1[data-theme=default]{background-color:transparent;color:var(--ds-color-text-default)}._typography_1h9tz_1[data-theme=subtle]{background-color:transparent;color:var(--ds-color-text-subtle)}._typography_1h9tz_1[data-size=xs]{font-size:.875rem}._typography_1h9tz_1[data-size=sm]{font-size:1rem}._typography_1h9tz_1[data-size=md]{font-size:1.125rem}._typography_1h9tz_1[data-size=lg]{font-size:1.25rem}._typography_1h9tz_1[data-size=xl]{font-size:1.5rem}._typography_1h9tz_1>*:first-child{margin-top:0}._typography_1h9tz_1>*:last-child{margin-bottom:0}._typography_1h9tz_1 strong{font-weight:500}._typography_1h9tz_1 a{color:var(--ds-color-base-default)}._typography_1h9tz_1 a:hover{color:var(--ds-color-base-hover)}._typography_1h9tz_1 p{font-size:1em;margin:1em 0}._typography_1h9tz_1 hr{--dsc-divider-border-width: var(--ds-border-width-default);--dsc-divider-border-style: solid;--dsc-divider-border-color: var(--ds-color-border-subtle);border-width:0;border-top-width:var(--dsc-divider-border-width);border-top-style:var(--dsc-divider-border-style);border-color:var(--dsc-divider-border-color);box-sizing:border-box;margin-block:.5em;width:100%}._typography_1h9tz_1 h1{font-size:1.5rem;line-height:1.25;font-weight:500;margin-top:1.5em;margin-bottom:0}._typography_1h9tz_1 h2{font-size:1.25rem;font-weight:600;margin-top:1.5em;margin-bottom:0}._typography_1h9tz_1 h3{font-size:1em;font-weight:600;margin:1em 0}._typography_1h9tz_1 h4{font-size:1em;font-weight:600;margin:1em 0 0}._typography_1h9tz_1 h5,._typography_1h9tz_1 h6{font-size:.875rem;margin:1em 0 0}._typography_1h9tz_1 h6{font-weight:500;color:var(--ds-color-text-subtle)}._typography_1h9tz_1 h6{font-weight:400;color:var(--ds-color-text-subtle)}._typography_1h9tz_1 h5+*,._typography_1h9tz_1 h6+*{margin-top:0}._typography_1h9tz_1 section{margin:1em 0}._typography_1h9tz_1 img{display:block;max-width:100%;width:auto;height:auto}._typography_1h9tz_1 ul:not([class]),._typography_1h9tz_1 ol:not([class]){list-style-position:outside;padding-left:1.5em;margin:1.5em 0}._typography_1h9tz_1 ul:not([class]) li,._typography_1h9tz_1 ol:not([class]) li{padding-left:.5em;margin:.5em 0}._typography_1h9tz_1 table{width:100%;font-size:.875em;font-variant-numeric:tabular-nums;border-collapse:collapse;border:1px solid;margin:1.5em 0}._typography_1h9tz_1 th,._typography_1h9tz_1 td{text-align:left;padding:.25em .5em;vertical-align:top}._typography_1h9tz_1 thead+tbody{border-top:1px solid;border-color:var(--ds-color-border-default)}._typography_1h9tz_1 tr+tr{border-top:1px solid;border-color:var(--ds-color-border-subtle)}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { useState as x, useEffect as R } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { Menu as
|
|
6
|
+
import { Menu as S } from "../Menu/Menu.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
8
|
+
const j = (d) => `${d} hits`, B = ({
|
|
9
9
|
items: d = [],
|
|
10
10
|
groups: v = {},
|
|
11
|
-
search:
|
|
11
|
+
search: t,
|
|
12
12
|
filterAccount: C,
|
|
13
13
|
onSelectAccount: u,
|
|
14
14
|
currentAccount: e,
|
|
15
15
|
isVirtualized: L,
|
|
16
16
|
keyboardEvents: w
|
|
17
17
|
}) => {
|
|
18
|
-
var
|
|
18
|
+
var r;
|
|
19
19
|
const p = d.map((o) => ({
|
|
20
20
|
...o,
|
|
21
21
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
@@ -24,36 +24,36 @@ const k = (d) => `${d} hits`, D = ({
|
|
|
24
24
|
onClick: () => {
|
|
25
25
|
!o.disabled && (u == null || u(o.id));
|
|
26
26
|
}
|
|
27
|
-
})), [
|
|
28
|
-
|
|
29
|
-
(
|
|
30
|
-
}, [
|
|
31
|
-
const F = C || ((o,
|
|
32
|
-
var g,
|
|
33
|
-
return ((g = o == null ? void 0 : o.name) == null ? void 0 : g.toLowerCase().includes(
|
|
34
|
-
}), n =
|
|
27
|
+
})), [l, i] = x("");
|
|
28
|
+
R(() => {
|
|
29
|
+
(t == null ? void 0 : t.value) !== void 0 && i(t.value);
|
|
30
|
+
}, [t == null ? void 0 : t.value]);
|
|
31
|
+
const F = C || ((o, a) => {
|
|
32
|
+
var g, f, s;
|
|
33
|
+
return ((g = o == null ? void 0 : o.name) == null ? void 0 : g.toLowerCase().includes(a.toLowerCase())) || ((s = (f = o == null ? void 0 : o.description) == null ? void 0 : f.toString()) == null ? void 0 : s.toLowerCase().includes(a.toLowerCase()));
|
|
34
|
+
}), n = l ? p.filter((o) => F(o, l)).map((o) => ({
|
|
35
35
|
...o,
|
|
36
36
|
groupId: "search",
|
|
37
37
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
38
|
-
highlightWords: [
|
|
39
|
-
})) : p, b =
|
|
38
|
+
highlightWords: [l]
|
|
39
|
+
})) : p, b = l ? {
|
|
40
40
|
search: {
|
|
41
|
-
title: ((
|
|
41
|
+
title: ((r = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : r.call(t, n.length)) ?? j(n.length)
|
|
42
42
|
}
|
|
43
43
|
} : v, I = {
|
|
44
44
|
name: "account-search",
|
|
45
|
-
value:
|
|
46
|
-
placeholder: (
|
|
45
|
+
value: l,
|
|
46
|
+
placeholder: (t == null ? void 0 : t.placeholder) ?? "Find account",
|
|
47
47
|
onChange: (o) => i(o.target.value),
|
|
48
48
|
onClear: () => i("")
|
|
49
49
|
}, M = [
|
|
50
50
|
...n.length > 0 ? n : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
51
51
|
];
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
52
|
+
return /* @__PURE__ */ c(
|
|
53
|
+
S,
|
|
54
54
|
{
|
|
55
55
|
variant: "default",
|
|
56
|
-
search:
|
|
56
|
+
search: t && !t.hidden ? I : void 0,
|
|
57
57
|
groups: b,
|
|
58
58
|
items: M,
|
|
59
59
|
isVirtualized: L,
|
|
@@ -62,5 +62,5 @@ const k = (d) => `${d} hits`, D = ({
|
|
|
62
62
|
);
|
|
63
63
|
};
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
B as AccountMenu
|
|
66
66
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Heading as
|
|
4
|
+
import { Heading as m } from "../Typography/Heading.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { Section as
|
|
8
|
-
const
|
|
9
|
-
/* @__PURE__ */ e(
|
|
7
|
+
import { Section as t } from "../Page/Section.js";
|
|
8
|
+
const f = ({ title: r, children: i }) => /* @__PURE__ */ o(t, { as: "header", spacing: 2, children: [
|
|
9
|
+
r && /* @__PURE__ */ e(m, { size: "xl", children: r }),
|
|
10
10
|
i
|
|
11
11
|
] });
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
f as ArticleHeader
|
|
14
14
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { c as g } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import { Skeleton as
|
|
3
|
+
import { Skeleton as l } from "../Skeleton/Skeleton.js";
|
|
4
4
|
import { useHighlightedText as x } from "./useHighlightedText.js";
|
|
5
|
-
import '../../assets/Typography.css';const f = "
|
|
5
|
+
import '../../assets/Typography.css';const f = "_typography_1h9tz_1", T = {
|
|
6
6
|
typography: f
|
|
7
|
-
},
|
|
7
|
+
}, k = ({
|
|
8
8
|
loading: o,
|
|
9
9
|
loadingText: _ = "Loading ...",
|
|
10
10
|
highlightWords: r,
|
|
@@ -18,7 +18,7 @@ import '../../assets/Typography.css';const f = "_typography_xs81l_1", T = {
|
|
|
18
18
|
children: y,
|
|
19
19
|
...m
|
|
20
20
|
}) => {
|
|
21
|
-
const d = a,
|
|
21
|
+
const d = a, h = x(y, r || []);
|
|
22
22
|
return /* @__PURE__ */ t(
|
|
23
23
|
d,
|
|
24
24
|
{
|
|
@@ -31,10 +31,10 @@ import '../../assets/Typography.css';const f = "_typography_xs81l_1", T = {
|
|
|
31
31
|
"data-color": n,
|
|
32
32
|
"data-variant": p,
|
|
33
33
|
...m,
|
|
34
|
-
children: /* @__PURE__ */ t(
|
|
34
|
+
children: /* @__PURE__ */ t(l, { loading: o, children: h })
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
k as Typography
|
|
40
40
|
};
|
|
@@ -12,4 +12,6 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
export declare const Default: Story;
|
|
14
14
|
export declare const HighlightWords: Story;
|
|
15
|
+
export declare const Article: Story;
|
|
16
|
+
export declare const Article2: Story;
|
|
15
17
|
export declare const Tables: Story;
|
|
@@ -12,3 +12,4 @@ export declare const Search: () => import("react/jsx-runtime").JSX.Element;
|
|
|
12
12
|
export declare const Category: () => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const Topic: () => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const Service: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const ArticlePage: () => import("react/jsx-runtime").JSX.Element;
|