@altinn/altinn-components 0.36.4 → 0.36.6
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/ListItemHeader.css +1 -1
- package/dist/assets/MetaItemIcon.css +1 -1
- package/dist/components/Dialog/DialogStatus.js +36 -15
- package/dist/components/List/ListItemHeader.js +47 -46
- package/dist/components/Metadata/MetaItemIcon.js +8 -8
- package/dist/types/lib/components/Dialog/DialogStatus.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_1v1u9_1{--dsc-item-spacing: .5em;position:relative;width:100%;min-height:var(--dsc-item-height);display:flex;align-items:center;justify-content:start;background:var(--dsc-item-background);column-gap:var(--dsc-item-spacing);padding-right:var(--dsc-item-px);padding-left:var(--dsc-item-px)}._header_1v1u9_1[data-interactive=true]{cursor:pointer}._header_1v1u9_1[data-interactive=true]:hover{background:var(--dsc-item-background--hover)}._header_1v1u9_1[data-interactive=true]:hover ._label_1v1u9_27 h2{text-decoration:underline}._header_1v1u9_1[data-has-active-child=true]{background-color:var(--ds-color-background-tinted)}._label_1v1u9_27{flex-grow:1}._link_1v1u9_39{outline:none}._badge_1v1u9_43{pointer-events:none}._linkIcon_1v1u9_47{flex-shrink:0;min-width:2em;min-height:2em;display:flex;align-items:center;justify-content:center;pointer-events:none}._linkFocus_1v1u9_57{position:absolute;top:0;left:0;right:0;bottom:0}._controls_1v1u9_65 a,._controls_1v1u9_65 button{position:relative}._link_1v1u9_39:focus-visible ._linkFocus_1v1u9_57{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._link_1v1u9_39:focus-visible ._linkFocus_1v1u9_57 *{--_ds--focus: }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._media_1pqyq_1{display:inline-flex;align-items:center;justify-content:center}._icon_1pqyq_7{font-size:1.25em}._avatarGroup_1pqyq_11{font-size:1.25rem}
|
|
@@ -1,30 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
3
|
import "../../index-L8X2o7IH.js";
|
|
3
|
-
import "react";
|
|
4
|
+
import * as a from "react";
|
|
5
|
+
import { forwardRef as p } from "react";
|
|
4
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import { MetaItem as c } from "../Metadata/MetaItem.js";
|
|
8
|
+
import { MetaProgress as d } from "../Metadata/MetaProgress.js";
|
|
5
9
|
import "../Snackbar/useSnackbar.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
if (
|
|
10
|
+
import { u as f } from "../../useId-BVFxCjkq.js";
|
|
11
|
+
var s = function(e, n) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
14
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
15
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
16
|
+
n.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (t[r[o]] = e[r[o]]);
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
const m = p((e, n) => {
|
|
20
|
+
var { title: t, titleId: r } = e, o = s(e, ["title", "titleId"]);
|
|
21
|
+
let l = f();
|
|
22
|
+
return l = t ? r || "title-" + l : void 0, a.createElement(
|
|
23
|
+
"svg",
|
|
24
|
+
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": l }, o),
|
|
25
|
+
t ? a.createElement("title", { id: l }, t) : null,
|
|
26
|
+
a.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 3.25a.75.75 0 0 0 0 1.5h.315c.109 1.966.642 3.846 1.546 5.302.502.81 1.116 1.479 1.81 1.948-.694.47-1.308 1.138-1.81 1.948-.904 1.456-1.437 3.336-1.546 5.302H6a.75.75 0 0 0 0 1.5h12a.75.75 0 0 0 0-1.5h-.298c-.109-1.966-.643-3.846-1.546-5.302-.503-.81-1.116-1.479-1.81-1.948.694-.47 1.307-1.138 1.81-1.948.904-1.456 1.437-3.336 1.546-5.302H18a.75.75 0 0 0 0-1.5zm6.008 8c.972 0 2.027-.624 2.873-1.989.738-1.189 1.211-2.785 1.318-4.511H7.818c.107 1.726.58 3.322 1.318 4.511.846 1.365 1.901 1.989 2.872 1.989m0 1.5c-.971 0-2.026.624-2.872 1.989-.738 1.189-1.211 2.784-1.318 4.511h8.381c-.107-1.727-.58-3.322-1.318-4.511-.846-1.365-1.901-1.989-2.873-1.989", clipRule: "evenodd" })
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
var u = /* @__PURE__ */ ((e) => (e["not-applicable"] = "NOT_APPLICABLE", e.draft = "DRAFT", e.awaiting = "AWAITING", e.completed = "COMPLETED", e["in-progress"] = "IN_PROGRESS", e["requires-attention"] = "REQUIRES_ATTENTION", e))(u || {});
|
|
30
|
+
const R = ({ loading: e, size: n = "xs", value: t = "not-applicable", label: r }) => {
|
|
31
|
+
if (e)
|
|
11
32
|
return null;
|
|
12
33
|
switch (t) {
|
|
13
34
|
case "draft":
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
case "awaiting":
|
|
16
|
-
return /* @__PURE__ */ n(o, { size: i, variant: "outline", children: e || t });
|
|
35
|
+
return /* @__PURE__ */ i(c, { size: n, variant: "dotted", children: r || t });
|
|
17
36
|
case "requires-attention":
|
|
18
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ i(c, { variant: "solid", children: r || t });
|
|
38
|
+
case "awaiting":
|
|
39
|
+
return /* @__PURE__ */ i(c, { size: n, variant: "outline", icon: m, children: r || t });
|
|
19
40
|
case "in-progress":
|
|
20
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ i(d, { size: n, variant: "outline", progress: 75, children: r || t });
|
|
21
42
|
case "completed":
|
|
22
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ i(d, { size: n, variant: "outline", progress: 100, children: r || t });
|
|
23
44
|
default:
|
|
24
45
|
return null;
|
|
25
46
|
}
|
|
26
47
|
};
|
|
27
48
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
R as DialogStatus,
|
|
50
|
+
u as DialogStatusEnum
|
|
30
51
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { c as B } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import { useId as E, isValidElement as w } from "react";
|
|
4
4
|
import { Icon as z } from "../Icon/Icon.js";
|
|
@@ -12,87 +12,88 @@ import { ListItemSelect as V } from "./ListItemSelect.js";
|
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
13
|
import { S as q, a as G } from "../../ChevronUp-DR4Lz2Jb.js";
|
|
14
14
|
import { S as J } from "../../ChevronRight-BbelnTke.js";
|
|
15
|
-
import '../../assets/ListItemHeader.css';const K = "
|
|
15
|
+
import '../../assets/ListItemHeader.css';const K = "_header_1v1u9_1", M = "_label_1v1u9_27", O = "_link_1v1u9_39", P = "_badge_1v1u9_43", Q = "_linkIcon_1v1u9_47", T = "_linkFocus_1v1u9_57", W = "_controls_1v1u9_65", o = {
|
|
16
16
|
header: K,
|
|
17
17
|
label: M,
|
|
18
18
|
link: O,
|
|
19
19
|
badge: P,
|
|
20
20
|
linkIcon: Q,
|
|
21
|
-
linkFocus: T
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
linkFocus: T,
|
|
22
|
+
controls: W
|
|
23
|
+
}, mo = ({
|
|
24
|
+
as: _,
|
|
25
|
+
interactive: i = !0,
|
|
26
|
+
color: u,
|
|
27
|
+
loading: s,
|
|
27
28
|
disabled: v,
|
|
28
|
-
collapsible:
|
|
29
|
-
linkIcon:
|
|
30
|
-
expanded:
|
|
31
|
-
select:
|
|
32
|
-
href:
|
|
29
|
+
collapsible: f,
|
|
30
|
+
linkIcon: h,
|
|
31
|
+
expanded: I,
|
|
32
|
+
select: l,
|
|
33
|
+
href: k,
|
|
33
34
|
onClick: b,
|
|
34
35
|
onKeyPress: L,
|
|
35
36
|
tabIndex: N,
|
|
36
37
|
size: a,
|
|
37
|
-
title:
|
|
38
|
+
title: r,
|
|
38
39
|
description: S,
|
|
39
|
-
icon:
|
|
40
|
-
active:
|
|
41
|
-
badge:
|
|
42
|
-
controls:
|
|
43
|
-
className:
|
|
44
|
-
children:
|
|
45
|
-
ariaLabel:
|
|
40
|
+
icon: C,
|
|
41
|
+
active: c,
|
|
42
|
+
badge: t,
|
|
43
|
+
controls: m,
|
|
44
|
+
className: x,
|
|
45
|
+
children: y,
|
|
46
|
+
ariaLabel: d
|
|
46
47
|
}) => {
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
const p = f ? I ? q : G : h ? J : void 0, F = () => t && !s && typeof t == "object" && "label" in t ? /* @__PURE__ */ e(A, { ...t, className: o.badge }) : w(t) ? t : null, j = d !== void 0 ? d : typeof r == "string" ? r : void 0, g = E();
|
|
49
|
+
return /* @__PURE__ */ n(
|
|
49
50
|
"div",
|
|
50
51
|
{
|
|
51
|
-
className: B(
|
|
52
|
-
"data-color":
|
|
53
|
-
"data-interactive":
|
|
52
|
+
className: B(o.header, x),
|
|
53
|
+
"data-color": u,
|
|
54
|
+
"data-interactive": i,
|
|
54
55
|
"data-size": a,
|
|
55
|
-
"data-has-active-child":
|
|
56
|
+
"data-has-active-child": c,
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ n(
|
|
58
59
|
D,
|
|
59
60
|
{
|
|
60
|
-
as:
|
|
61
|
-
href:
|
|
61
|
+
as: _,
|
|
62
|
+
href: k,
|
|
62
63
|
onClick: b,
|
|
63
64
|
onKeyPress: L,
|
|
64
65
|
tabIndex: N,
|
|
65
|
-
loading:
|
|
66
|
-
disabled: v ||
|
|
67
|
-
active:
|
|
66
|
+
loading: s,
|
|
67
|
+
disabled: v || s,
|
|
68
|
+
active: c,
|
|
68
69
|
ariaLabel: j,
|
|
69
|
-
className:
|
|
70
|
+
className: o.link,
|
|
70
71
|
children: [
|
|
71
|
-
/* @__PURE__ */ e("div", { className:
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ e(R, { loading:
|
|
72
|
+
i && /* @__PURE__ */ e("div", { className: o.linkFocus, "aria-hidden": "true" }),
|
|
73
|
+
l && /* @__PURE__ */ e(V, { ...l, className: o.select }),
|
|
74
|
+
/* @__PURE__ */ e(R, { loading: s, icon: C }),
|
|
74
75
|
/* @__PURE__ */ e(
|
|
75
76
|
H,
|
|
76
77
|
{
|
|
77
78
|
size: a,
|
|
78
|
-
loading:
|
|
79
|
-
title:
|
|
79
|
+
loading: s,
|
|
80
|
+
title: r,
|
|
80
81
|
description: S,
|
|
81
82
|
id: g,
|
|
82
|
-
className:
|
|
83
|
-
children:
|
|
83
|
+
className: o.label,
|
|
84
|
+
children: y
|
|
84
85
|
}
|
|
85
86
|
)
|
|
86
87
|
]
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
90
|
+
/* @__PURE__ */ n(U, { className: o.controls, children: [
|
|
91
|
+
m && !s && /* @__PURE__ */ e("span", { className: o.customControls, children: m }),
|
|
91
92
|
F(),
|
|
92
|
-
|
|
93
|
+
p && /* @__PURE__ */ e("span", { className: o.linkIcon, children: /* @__PURE__ */ e(
|
|
93
94
|
z,
|
|
94
95
|
{
|
|
95
|
-
svgElement:
|
|
96
|
+
svgElement: p,
|
|
96
97
|
style: {
|
|
97
98
|
fontSize: "1.5rem"
|
|
98
99
|
}
|
|
@@ -104,5 +105,5 @@ import '../../assets/ListItemHeader.css';const K = "_header_1v4fh_1", M = "_labe
|
|
|
104
105
|
);
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
mo as ListItemHeader
|
|
108
109
|
};
|
|
@@ -2,21 +2,21 @@ import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { isValidElement as p } from "react";
|
|
3
3
|
import { isIconProps as i, Icon as m } from "../Icon/Icon.js";
|
|
4
4
|
import { ProgressIcon as n } from "../Icon/ProgressIcon.js";
|
|
5
|
-
import { isAvatarProps as c, Avatar as
|
|
6
|
-
import { isAvatarGroupProps as
|
|
5
|
+
import { isAvatarProps as c, Avatar as f } from "../Avatar/Avatar.js";
|
|
6
|
+
import { isAvatarGroupProps as l, AvatarGroup as u } from "../Avatar/AvatarGroup.js";
|
|
7
7
|
import "../../index-L8X2o7IH.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import '../../assets/MetaItemIcon.css';const
|
|
11
|
-
media:
|
|
12
|
-
icon:
|
|
13
|
-
avatarGroup:
|
|
10
|
+
import '../../assets/MetaItemIcon.css';const _ = "_media_1pqyq_1", d = "_icon_1pqyq_7", y = "_avatarGroup_1pqyq_11", t = {
|
|
11
|
+
media: _,
|
|
12
|
+
icon: d,
|
|
13
|
+
avatarGroup: y
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function v(r) {
|
|
16
16
|
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || p(r);
|
|
17
17
|
}
|
|
18
18
|
const E = ({ size: r = "xs", icon: a, progress: s }) => !a && typeof s != "number" ? !1 : /* @__PURE__ */ e("span", { className: t.media, "data-size": r, children: [
|
|
19
|
-
c(a) && /* @__PURE__ */ o(
|
|
19
|
+
c(a) && /* @__PURE__ */ o(f, { ...a, className: t.avatar }) || l(a) && /* @__PURE__ */ o(u, { ...a, className: t.avatarGroup }) || i(a) && /* @__PURE__ */ o(m, { ...a, className: t.icon }) || v(a) && a || /* @__PURE__ */ o(m, { svgElement: a, className: t.icon }),
|
|
20
20
|
s && /* @__PURE__ */ o(n, { value: s, className: t.icon })
|
|
21
21
|
] });
|
|
22
22
|
export {
|