@altinn/altinn-components 0.35.0 → 0.35.2
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/TimelineHeader.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +32 -32
- package/dist/components/Timeline/TimelineHeader.js +6 -6
- package/dist/components/Timeline/TimelineIcon.js +18 -11
- package/dist/types/lib/components/Dialog/DialogBody.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_ffjwj_1{width:100%;display:flex;align-items:center;column-gap:.5rem;min-height:1.5rem}._sidebar_ffjwj_9{flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:.375rem}._content_ffjwj_18{flex-grow:1;display:flex;flex-direction:column}
|
|
@@ -2,68 +2,68 @@
|
|
|
2
2
|
import { jsxs as v, jsx as s } from "react/jsx-runtime";
|
|
3
3
|
import { c as O } from "../../index-L8X2o7IH.js";
|
|
4
4
|
import * as a from "react";
|
|
5
|
-
import { forwardRef as b, useRef as h
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { useClickOutside as
|
|
8
|
-
import { DropdownBase as
|
|
9
|
-
import { MenuItems as
|
|
10
|
-
import { useRootContext as
|
|
5
|
+
import { forwardRef as b, useRef as h } from "react";
|
|
6
|
+
import { IconButton as w } from "../Button/IconButton.js";
|
|
7
|
+
import { useClickOutside as y } from "../../hooks/useClickOutside.js";
|
|
8
|
+
import { DropdownBase as I } from "../Dropdown/DropdownBase.js";
|
|
9
|
+
import { MenuItems as j } from "../Menu/MenuItems.js";
|
|
10
|
+
import { useRootContext as C } from "../RootProvider/RootProvider.js";
|
|
11
11
|
import "../Searchbar/AutocompleteBase.js";
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import '../../assets/ContextMenu.css';var
|
|
13
|
+
import { u as _ } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
import '../../assets/ContextMenu.css';var R = function(e, n) {
|
|
15
15
|
var r = {};
|
|
16
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) &&
|
|
16
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
|
|
17
17
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
18
|
for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
19
|
-
|
|
19
|
+
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
|
-
const
|
|
23
|
-
var { title: r, titleId: t } = e, o =
|
|
24
|
-
let
|
|
25
|
-
return
|
|
22
|
+
const E = b((e, n) => {
|
|
23
|
+
var { title: r, titleId: t } = e, o = R(e, ["title", "titleId"]);
|
|
24
|
+
let l = _();
|
|
25
|
+
return l = r ? t || "title-" + l : void 0, a.createElement(
|
|
26
26
|
"svg",
|
|
27
|
-
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:
|
|
28
|
-
r ? a.createElement("title", { id:
|
|
27
|
+
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),
|
|
28
|
+
r ? a.createElement("title", { id: l }, r) : null,
|
|
29
29
|
a.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m4.5 1.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m6 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0", clipRule: "evenodd" })
|
|
30
30
|
);
|
|
31
|
-
}), k = "_toggle_nol5i_1",
|
|
31
|
+
}), k = "_toggle_nol5i_1", M = {
|
|
32
32
|
toggle: k
|
|
33
|
-
},
|
|
33
|
+
}, q = ({
|
|
34
34
|
id: e = "context-menu",
|
|
35
|
-
ariaLabel:
|
|
35
|
+
ariaLabel: n,
|
|
36
36
|
placement: r = "right",
|
|
37
37
|
groups: t = {},
|
|
38
38
|
className: o,
|
|
39
|
-
items:
|
|
39
|
+
items: l
|
|
40
40
|
}) => {
|
|
41
|
-
const { currentId:
|
|
42
|
-
|
|
41
|
+
const { currentId: p, toggleId: m, closeAll: d } = C(), f = h(null), g = () => m(e), c = p === e;
|
|
42
|
+
y(f, () => {
|
|
43
43
|
c && m(e);
|
|
44
44
|
});
|
|
45
|
-
const x =
|
|
45
|
+
const x = l.map((i) => ({
|
|
46
46
|
...i,
|
|
47
47
|
onClick: () => {
|
|
48
|
-
var
|
|
49
|
-
(
|
|
48
|
+
var u;
|
|
49
|
+
(u = i.onClick) == null || u.call(i), d();
|
|
50
50
|
}
|
|
51
|
-
}))
|
|
52
|
-
return /* @__PURE__ */ v("div", { className: O(
|
|
51
|
+
}));
|
|
52
|
+
return /* @__PURE__ */ v("div", { className: O(M.toggle, o), "data-color": "neutral", ref: f, children: [
|
|
53
53
|
/* @__PURE__ */ s(
|
|
54
|
-
|
|
54
|
+
w,
|
|
55
55
|
{
|
|
56
56
|
size: "xs",
|
|
57
57
|
rounded: !0,
|
|
58
|
-
icon:
|
|
58
|
+
icon: E,
|
|
59
59
|
variant: "text",
|
|
60
60
|
onClick: g,
|
|
61
|
-
iconAltText:
|
|
61
|
+
iconAltText: n || `Open ${e}`
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
c && /* @__PURE__ */ s(
|
|
64
|
+
c && /* @__PURE__ */ s(I, { placement: r, open: c, children: /* @__PURE__ */ s(j, { groups: t, items: x }) })
|
|
65
65
|
] });
|
|
66
66
|
};
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
q as ContextMenu
|
|
69
69
|
};
|
|
@@ -8,14 +8,14 @@ import { TimelineIcon as l } from "./TimelineIcon.js";
|
|
|
8
8
|
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
10
|
import { Flex as d } from "../Page/Flex.js";
|
|
11
|
-
import '../../assets/TimelineHeader.css';const
|
|
12
|
-
header:
|
|
13
|
-
sidebar:
|
|
14
|
-
content:
|
|
15
|
-
},
|
|
11
|
+
import '../../assets/TimelineHeader.css';const f = "_header_ffjwj_1", p = "_sidebar_ffjwj_9", h = "_content_ffjwj_18", r = {
|
|
12
|
+
header: f,
|
|
13
|
+
sidebar: p,
|
|
14
|
+
content: h
|
|
15
|
+
}, g = ({ as: t = "li", loading: i, color: o, icon: s, children: n }) => /* @__PURE__ */ m(d, { as: t, className: r.header, color: o, children: [
|
|
16
16
|
/* @__PURE__ */ e("aside", { className: r.sidebar, children: /* @__PURE__ */ e(c, { variant: "circle", loading: i, children: /* @__PURE__ */ e(l, { icon: s, theme: "base", size: "lg" }) }) }),
|
|
17
17
|
/* @__PURE__ */ e("div", { className: r.content, children: /* @__PURE__ */ e(a, { loading: i, size: "lg", children: n }) })
|
|
18
18
|
] });
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
g as TimelineHeader
|
|
21
21
|
};
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isValidElement as
|
|
3
|
-
import { Icon as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as n } from "react";
|
|
3
|
+
import { Icon as e, isIconProps as p } from "../Icon/Icon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { isAvatarProps as l, Avatar as f } from "../Avatar/Avatar.js";
|
|
6
|
-
import { isAvatarGroupProps as
|
|
6
|
+
import { isAvatarGroupProps as g, AvatarGroup as u } from "../Avatar/AvatarGroup.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import '../../assets/TimelineIcon.css';const
|
|
12
|
-
icon:
|
|
10
|
+
import { S as c } from "../../XMark-DIqxCTTQ.js";
|
|
11
|
+
import '../../assets/TimelineIcon.css';const d = "_icon_13w5g_1", a = {
|
|
12
|
+
icon: d
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
return typeof
|
|
14
|
+
function h(t) {
|
|
15
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null || n(t);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const _ = ({ loading: t, size: m, color: s, theme: i, icon: r }) => r ? t ? /* @__PURE__ */ o(e, { className: a.icon, svgElement: c, loading: !0 }) : /* @__PURE__ */ o("div", { className: a.icon, "data-color": s, "data-size": m, children: l(r) && /* @__PURE__ */ o(
|
|
18
|
+
f,
|
|
19
|
+
{
|
|
20
|
+
...r,
|
|
21
|
+
innerContainerStyle: { width: "unset", height: "1em" },
|
|
22
|
+
avatarImageStyle: { height: "1.75rem", width: "auto", marginTop: "0.25rem" }
|
|
23
|
+
}
|
|
24
|
+
) || g(r) && /* @__PURE__ */ o(u, { ...r, className: a.avatarGroup }) || p(r) && /* @__PURE__ */ o(e, { ...r, theme: i }) || h(r) && r || /* @__PURE__ */ o(e, { theme: i, svgElement: r }) }) : null;
|
|
18
25
|
export {
|
|
19
|
-
|
|
26
|
+
_ as TimelineIcon
|
|
20
27
|
};
|