@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.
@@ -1 +1 @@
1
- ._header_177gq_1{width:100%;display:flex;align-items:center;column-gap:.5rem;min-height:1.5rem}._sidebar_177gq_9{flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:.375rem;width:2.25rem}._content_177gq_19{flex-grow:1;display:flex;flex-direction:column}
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, useMemo as w } from "react";
6
- import { IconButton as y } from "../Button/IconButton.js";
7
- import { useClickOutside as I } from "../../hooks/useClickOutside.js";
8
- import { DropdownBase as j } from "../Dropdown/DropdownBase.js";
9
- import { MenuItems as C } from "../Menu/MenuItems.js";
10
- import { useRootContext as _ } from "../RootProvider/RootProvider.js";
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 R } from "../../useId-BVFxCjkq.js";
14
- import '../../assets/ContextMenu.css';var E = function(e, l) {
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) && l.indexOf(t) < 0 && (r[t] = 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
- l.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
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 M = b((e, l) => {
23
- var { title: r, titleId: t } = e, o = E(e, ["title", "titleId"]);
24
- let n = R();
25
- return n = r ? t || "title-" + n : void 0, a.createElement(
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: l, "aria-labelledby": n }, o),
28
- r ? a.createElement("title", { id: n }, r) : null,
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", B = {
31
+ }), k = "_toggle_nol5i_1", M = {
32
32
  toggle: k
33
- }, F = ({
33
+ }, q = ({
34
34
  id: e = "context-menu",
35
- ariaLabel: l,
35
+ ariaLabel: n,
36
36
  placement: r = "right",
37
37
  groups: t = {},
38
38
  className: o,
39
- items: n
39
+ items: l
40
40
  }) => {
41
- const { currentId: d, toggleId: m, closeAll: u } = _(), f = h(null), g = () => m(e), c = d === e;
42
- I(f, () => {
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 = w(() => n.map((i) => ({
45
+ const x = l.map((i) => ({
46
46
  ...i,
47
47
  onClick: () => {
48
- var p;
49
- (p = i.onClick) == null || p.call(i), u();
48
+ var u;
49
+ (u = i.onClick) == null || u.call(i), d();
50
50
  }
51
- })), [n, u]);
52
- return /* @__PURE__ */ v("div", { className: O(B.toggle, o), "data-color": "neutral", ref: f, children: [
51
+ }));
52
+ return /* @__PURE__ */ v("div", { className: O(M.toggle, o), "data-color": "neutral", ref: f, children: [
53
53
  /* @__PURE__ */ s(
54
- y,
54
+ w,
55
55
  {
56
56
  size: "xs",
57
57
  rounded: !0,
58
- icon: M,
58
+ icon: E,
59
59
  variant: "text",
60
60
  onClick: g,
61
- iconAltText: l || `Open ${e}`
61
+ iconAltText: n || `Open ${e}`
62
62
  }
63
63
  ),
64
- c && /* @__PURE__ */ s(j, { placement: r, open: c, children: /* @__PURE__ */ s(C, { groups: t, items: x }) })
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
- F as ContextMenu
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 p = "_header_177gq_1", h = "_sidebar_177gq_9", _ = "_content_177gq_19", r = {
12
- header: p,
13
- sidebar: h,
14
- content: _
15
- }, T = ({ as: t = "li", loading: i, color: o, icon: s, children: n }) => /* @__PURE__ */ m(d, { as: t, className: r.header, color: o, children: [
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
- T as TimelineHeader
20
+ g as TimelineHeader
21
21
  };
@@ -1,20 +1,27 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { isValidElement as p } from "react";
3
- import { Icon as s, isIconProps as n } from "../Icon/Icon.js";
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 c, AvatarGroup as u } from "../Avatar/AvatarGroup.js";
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 d } from "../../XMark-DIqxCTTQ.js";
11
- import '../../assets/TimelineIcon.css';const g = "_icon_13w5g_1", a = {
12
- icon: g
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 v(o) {
15
- return typeof o == "string" || typeof o == "number" || typeof o == "boolean" || o === null || p(o);
14
+ function h(t) {
15
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null || n(t);
16
16
  }
17
- const S = ({ loading: o, size: i, color: e, theme: m, icon: r }) => r ? o ? /* @__PURE__ */ t(s, { className: a.icon, svgElement: d, loading: !0 }) : /* @__PURE__ */ t("div", { className: a.icon, "data-color": e, "data-size": i, children: l(r) && /* @__PURE__ */ t(f, { ...r }) || c(r) && /* @__PURE__ */ t(u, { ...r, className: a.avatarGroup }) || n(r) && /* @__PURE__ */ t(s, { ...r, theme: m }) || v(r) && r || /* @__PURE__ */ t(s, { theme: m, svgElement: r }) }) : null;
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
- S as TimelineIcon
26
+ _ as TimelineIcon
20
27
  };
@@ -43,4 +43,5 @@ export declare const Loading: Story;
43
43
  export declare const Summary: Story;
44
44
  export declare const ExtendedContent: Story;
45
45
  export declare const WithAttachments: Story;
46
+ export declare const WithWideLogo: Story;
46
47
  export declare const WithActions: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",