@altinn/altinn-components 0.50.5 → 0.50.7

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
- ._searchbar_1sz2n_1{position:relative}._searchbar_1sz2n_1[data-autocomplete=true][aria-expanded=true] input{border-bottom-left-radius:0;border-bottom-right-radius:0}._searchbar_1sz2n_1 nav{display:none}._searchbarExpanded_1sz2n_14 nav{position:absolute;display:block;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px}._searchbarLocal_1sz2n_22{width:100%;padding:var(--dsc-spacing-4) 0;margin-bottom:16px}._searchbarLocal_1sz2n_22._searchbarExpanded_1sz2n_14{z-index:100}@media (min-width: 1024px){._searchbarLocal_1sz2n_22{max-width:320px;margin-right:auto;z-index:100}._searchbarLocal_1sz2n_22._searchbarExpanded_1sz2n_14{max-width:640px}}
1
+ ._searchbar_1lexx_1{position:relative}._searchbar_1lexx_1[data-autocomplete=true][aria-expanded=true] input{border-bottom-left-radius:0;border-bottom-right-radius:0}._searchbar_1lexx_1 nav{display:none}._searchbarExpanded_1lexx_14 nav{position:absolute;display:block;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px}._searchbarLocal_1lexx_22{width:100%;padding:var(--dsc-spacing-4) 0;margin-bottom:16px}._searchbarLocal_1lexx_22._searchbarExpanded_1lexx_14{z-index:100}@media (min-width: 1024px){._searchbarLocal_1lexx_22{max-width:360px;margin-right:auto;z-index:100}._searchbarLocal_1lexx_22._searchbarExpanded_1lexx_14{max-width:640px}}
@@ -1,79 +1,81 @@
1
- import { jsxs as k, jsx as q } from "react/jsx-runtime";
2
- import { c as A } from "../../index-L8X2o7IH.js";
3
- import { ListItemBase as C } from "./ListItemBase.js";
1
+ import { jsxs as N, jsx as n } from "react/jsx-runtime";
2
+ import { c as k } from "../../index-L8X2o7IH.js";
3
+ import { useId as q } from "react";
4
+ import { ListItemBase as A } from "./ListItemBase.js";
4
5
  import { ListItemHeader as D } from "./ListItemHeader.js";
5
6
  import '../../assets/ListItem.css';const E = "_item_1nwey_3", F = {
6
7
  item: E
7
- }, O = ({
8
- className: c,
9
- color: m,
10
- variant: n = "default",
11
- shadow: f = "xs",
12
- border: p = "none",
13
- loading: e,
14
- disabled: o,
8
+ }, P = ({
9
+ className: f,
10
+ color: o,
11
+ variant: l = "default",
12
+ shadow: p = "xs",
13
+ border: I = "none",
14
+ loading: m,
15
+ disabled: r,
15
16
  collapsible: a,
16
17
  expanded: t,
17
- size: r,
18
- icon: l,
18
+ size: i,
19
+ icon: u,
19
20
  label: s,
20
- title: u,
21
- description: L,
22
- badge: x,
23
- linkIcon: y = !1,
24
- select: I,
25
- selected: _,
26
- controls: h,
27
- children: j,
28
- interactive: i,
21
+ title: L,
22
+ description: h,
23
+ badge: y,
24
+ linkIcon: _ = !1,
25
+ select: d,
26
+ selected: j,
27
+ controls: x,
28
+ children: v,
29
+ interactive: e,
29
30
  id: w,
30
31
  containerAs: B,
31
- ...H
32
+ ...C
32
33
  }) => {
33
- const N = typeof s == "function" ? s() : s;
34
- return /* @__PURE__ */ k(
35
- C,
34
+ const H = typeof s == "function" ? s() : s, c = q();
35
+ return /* @__PURE__ */ N(
36
+ A,
36
37
  {
37
- className: A(F.item, c),
38
- size: r,
39
- color: m,
40
- variant: n,
41
- shadow: f,
42
- border: p,
43
- disabled: o,
44
- selected: _,
38
+ className: k(F.item, f),
39
+ size: i,
40
+ color: o,
41
+ variant: l,
42
+ shadow: p,
43
+ border: I,
44
+ disabled: r,
45
+ selected: j,
45
46
  expanded: t,
46
- loading: e,
47
- interactive: i,
47
+ loading: m,
48
+ interactive: e,
48
49
  id: w,
49
50
  as: B,
50
51
  children: [
51
- /* @__PURE__ */ q(
52
+ /* @__PURE__ */ n(
52
53
  D,
53
54
  {
54
- color: m,
55
- loading: e,
56
- linkIcon: y,
57
- disabled: o,
55
+ color: o,
56
+ loading: m,
57
+ linkIcon: _,
58
+ disabled: r,
58
59
  collapsible: a,
59
60
  expanded: t,
60
- select: I,
61
- title: u,
62
- size: r,
63
- description: L,
64
- icon: l,
65
- badge: x,
66
- controls: h,
67
- interactive: i,
68
- ...H,
69
- children: N
61
+ select: d,
62
+ title: L,
63
+ size: i,
64
+ description: h,
65
+ icon: u,
66
+ badge: y,
67
+ controls: x,
68
+ interactive: e,
69
+ ariaControlsId: t ? c : void 0,
70
+ ...C,
71
+ children: H
70
72
  }
71
73
  ),
72
- t ? j : null
74
+ t ? /* @__PURE__ */ n("div", { id: c, children: v }) : null
73
75
  ]
74
76
  }
75
77
  );
76
78
  };
77
79
  export {
78
- O as ListItem
80
+ P as ListItem
79
81
  };
@@ -1,102 +1,106 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { c as E } from "../../index-L8X2o7IH.js";
3
- import { useId as w, isValidElement as z } from "react";
4
- import { Icon as A } from "../Icon/Icon.js";
5
- import { Badge as D } from "../Badge/Badge.js";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { c as w } from "../../index-L8X2o7IH.js";
3
+ import { useId as z, isValidElement as A } from "react";
4
+ import { Icon as D } from "../Icon/Icon.js";
5
+ import { Badge as H } from "../Badge/Badge.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { ListItemLink as H } from "./ListItemLink.js";
8
- import { ListItemLabel as R } from "./ListItemLabel.js";
9
- import { ListItemIcon as U } from "./ListItemIcon.js";
10
- import { ListItemControls as V } from "./ListItemControls.js";
11
- import { ListItemSelect as q } from "./ListItemSelect.js";
7
+ import { ListItemLink as R } from "./ListItemLink.js";
8
+ import { ListItemLabel as U } from "./ListItemLabel.js";
9
+ import { ListItemIcon as V } from "./ListItemIcon.js";
10
+ import { ListItemControls as q } from "./ListItemControls.js";
11
+ import { ListItemSelect as G } from "./ListItemSelect.js";
12
12
  import "../Snackbar/useSnackbar.js";
13
- import { S as G, a as J } from "../../ChevronUp-_BBfEirx.js";
14
- import { S as K } from "../../ChevronRight-ANFWmIs1.js";
15
- import '../../assets/ListItemHeader.css';const M = "_header_29hv7_1", O = "_label_29hv7_27", P = "_link_29hv7_43", Q = "_badge_29hv7_47", T = "_linkIcon_29hv7_51", W = "_linkFocus_29hv7_61", X = "_controls_29hv7_69", o = {
16
- header: M,
17
- label: O,
18
- link: P,
19
- badge: Q,
20
- linkIcon: T,
21
- linkFocus: W,
22
- controls: X
23
- }, ho = ({
24
- as: _,
25
- highlightWords: v,
13
+ import { S as J, a as K } from "../../ChevronUp-_BBfEirx.js";
14
+ import { S as M } from "../../ChevronRight-ANFWmIs1.js";
15
+ import '../../assets/ListItemHeader.css';const O = "_header_29hv7_1", P = "_label_29hv7_27", Q = "_link_29hv7_43", T = "_badge_29hv7_47", W = "_linkIcon_29hv7_51", X = "_linkFocus_29hv7_61", Y = "_controls_29hv7_69", o = {
16
+ header: O,
17
+ label: P,
18
+ link: Q,
19
+ badge: T,
20
+ linkIcon: W,
21
+ linkFocus: X,
22
+ controls: Y
23
+ }, _o = ({
24
+ as: f,
25
+ highlightWords: I,
26
26
  interactive: a = !0,
27
- color: f,
27
+ color: k,
28
28
  loading: s,
29
29
  disabled: r,
30
- collapsible: I,
31
- linkIcon: k,
32
- expanded: u,
33
- select: l,
30
+ collapsible: c,
31
+ linkIcon: u,
32
+ expanded: l,
33
+ select: m,
34
34
  href: L,
35
- onClick: b,
36
- onKeyPress: N,
35
+ onClick: N,
36
+ onKeyPress: b,
37
37
  tabIndex: S,
38
- size: c,
38
+ size: h,
39
39
  title: n,
40
40
  description: C,
41
- icon: x,
42
- active: m,
43
- badge: t,
44
- controls: d,
45
- className: y,
46
- children: F,
47
- ariaLabel: h
41
+ icon: y,
42
+ active: d,
43
+ badge: e,
44
+ controls: _,
45
+ className: F,
46
+ children: j,
47
+ ariaLabel: p,
48
+ ariaControlsId: x
48
49
  }) => {
49
- const p = I ? u ? G : J : k ? K : void 0, j = () => t && !s && typeof t == "object" && "label" in t ? /* @__PURE__ */ e(D, { ...t, className: o.badge }) : z(t) ? t : null, g = h !== void 0 ? h : typeof n == "string" ? n : void 0, B = w();
50
+ const v = c ? l ? J : K : u ? M : void 0, g = () => e && !s && typeof e == "object" && "label" in e ? /* @__PURE__ */ t(H, { ...e, className: o.badge }) : A(e) ? e : null, B = p !== void 0 ? p : typeof n == "string" ? n : void 0, E = z();
50
51
  return /* @__PURE__ */ i(
51
52
  "div",
52
53
  {
53
- className: E(o.header, y),
54
- "data-color": f,
54
+ className: w(o.header, F),
55
+ "data-color": k,
55
56
  "data-interactive": a,
56
- "data-size": c,
57
- "data-has-active-child": m,
57
+ "data-size": h,
58
+ "data-has-active-child": d,
58
59
  "aria-disabled": r,
59
60
  children: [
60
61
  /* @__PURE__ */ i(
61
- H,
62
+ R,
62
63
  {
63
- as: _,
64
+ as: f,
64
65
  href: L,
65
- onClick: b,
66
- onKeyPress: N,
66
+ onClick: N,
67
+ onKeyPress: b,
67
68
  tabIndex: S,
68
69
  loading: s,
69
70
  disabled: r || s,
70
- active: m,
71
- ariaLabel: g,
71
+ active: d,
72
+ ariaLabel: B,
72
73
  className: o.link,
74
+ expanded: l,
75
+ ariaControlsId: x,
76
+ collapsible: c,
73
77
  children: [
74
- a && /* @__PURE__ */ e("div", { className: o.linkFocus, "aria-hidden": "true" }),
75
- l && /* @__PURE__ */ e(q, { ...l, className: o.select }),
76
- /* @__PURE__ */ e(U, { loading: s, icon: x }),
77
- /* @__PURE__ */ e(
78
- R,
78
+ a && /* @__PURE__ */ t("div", { className: o.linkFocus, "aria-hidden": "true" }),
79
+ m && /* @__PURE__ */ t(G, { ...m, className: o.select }),
80
+ /* @__PURE__ */ t(V, { loading: s, icon: y }),
81
+ /* @__PURE__ */ t(
82
+ U,
79
83
  {
80
- size: c,
84
+ size: h,
81
85
  loading: s,
82
- highlightWords: v,
86
+ highlightWords: I,
83
87
  title: n,
84
88
  description: C,
85
- id: B,
89
+ id: E,
86
90
  className: o.label,
87
- children: F
91
+ children: j
88
92
  }
89
93
  )
90
94
  ]
91
95
  }
92
96
  ),
93
- /* @__PURE__ */ i(V, { className: o.controls, children: [
94
- d && !s && /* @__PURE__ */ e("span", { className: o.customControls, children: d }),
95
- j(),
96
- p && !r && /* @__PURE__ */ e("span", { className: o.linkIcon, children: /* @__PURE__ */ e(
97
- A,
97
+ /* @__PURE__ */ i(q, { className: o.controls, children: [
98
+ _ && !s && /* @__PURE__ */ t("span", { className: o.customControls, children: _ }),
99
+ g(),
100
+ v && !r && /* @__PURE__ */ t("span", { className: o.linkIcon, children: /* @__PURE__ */ t(
101
+ D,
98
102
  {
99
- svgElement: p,
103
+ svgElement: v,
100
104
  style: {
101
105
  fontSize: "1.5rem"
102
106
  }
@@ -108,5 +112,5 @@ import '../../assets/ListItemHeader.css';const M = "_header_29hv7_1", O = "_labe
108
112
  );
109
113
  };
110
114
  export {
111
- ho as ListItemHeader
115
+ _o as ListItemHeader
112
116
  };
@@ -1,8 +1,8 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { c as v } from "../../index-L8X2o7IH.js";
3
- import '../../assets/ListItemLink.css';const f = "_link_c8adz_1", l = {
4
- link: f
5
- }, I = ({
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { c as p } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/ListItemLink.css';const I = "_link_c8adz_1", l = {
4
+ link: I
5
+ }, z = ({
6
6
  as: u,
7
7
  loading: a,
8
8
  disabled: e,
@@ -10,35 +10,40 @@ import '../../assets/ListItemLink.css';const f = "_link_c8adz_1", l = {
10
10
  href: s,
11
11
  onClick: t,
12
12
  onKeyPress: i,
13
- className: m,
14
- active: o,
13
+ className: d,
14
+ active: _,
15
15
  ariaLabel: n,
16
16
  children: c,
17
- tabIndex: _ = 0
17
+ tabIndex: b = 0,
18
+ expanded: m,
19
+ collapsible: f,
20
+ ariaControlsId: k
18
21
  }) => {
19
22
  const r = u || "div";
20
23
  if (r === "div")
21
- return /* @__PURE__ */ p("div", { className: v(l.link, m), children: c });
22
- const b = !a && s || r !== "a" && n;
23
- return /* @__PURE__ */ p(
24
+ return /* @__PURE__ */ v("div", { className: p(l.link, d), children: c });
25
+ const A = !a && s || r !== "a" && n;
26
+ return /* @__PURE__ */ v(
24
27
  r,
25
28
  {
26
- className: v(l.link, m),
29
+ className: p(l.link, d),
27
30
  href: s,
28
- onKeyPress: (d) => {
29
- d.key === "Enter" && (t == null || t()), i == null || i(d);
31
+ onKeyPress: (o) => {
32
+ o.key === "Enter" && (t == null || t()), i == null || i(o);
30
33
  },
31
34
  onClick: t,
32
35
  "data-interactive": "true",
33
36
  "aria-disabled": a || e,
34
37
  "aria-selected": x,
35
- ...b && { "aria-label": n },
36
- "data-active": o,
37
- tabIndex: a || e ? -1 : _,
38
+ "aria-expanded": f ? m : void 0,
39
+ "aria-controls": m ? k : void 0,
40
+ ...A && { "aria-label": n },
41
+ "data-active": _,
42
+ tabIndex: a || e ? -1 : b,
38
43
  children: c
39
44
  }
40
45
  );
41
46
  };
42
47
  export {
43
- I as ListItemLink
48
+ z as ListItemLink
44
49
  };
@@ -1,13 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
2
  import { c as b } from "../../index-L8X2o7IH.js";
3
- import '../../assets/SearchbarBase.css';const l = "_searchbar_1sz2n_1", d = "_searchbarExpanded_1sz2n_14", _ = "_searchbarLocal_1sz2n_22", a = {
4
- searchbar: l,
5
- searchbarExpanded: d,
6
- searchbarLocal: _
3
+ import '../../assets/SearchbarBase.css';const x = "_searchbar_1lexx_1", n = "_searchbarExpanded_1lexx_14", d = "_searchbarLocal_1lexx_22", a = {
4
+ searchbar: x,
5
+ searchbarExpanded: n,
6
+ searchbarLocal: d
7
7
  }, m = ({
8
8
  className: r,
9
- children: s,
10
- expanded: e = !1,
9
+ children: e,
10
+ expanded: s = !1,
11
11
  onBlurCapture: c,
12
12
  autocomplete: o = !1,
13
13
  useGlobalHeader: t = !1
@@ -15,10 +15,10 @@ import '../../assets/SearchbarBase.css';const l = "_searchbar_1sz2n_1", d = "_se
15
15
  const h = b(
16
16
  a.searchbar,
17
17
  r,
18
- e && a.searchbarExpanded,
18
+ s && a.searchbarExpanded,
19
19
  t && a.searchbarLocal
20
20
  );
21
- return /* @__PURE__ */ n("div", { className: h, "data-autocomplete": o, onBlurCapture: c, children: s });
21
+ return /* @__PURE__ */ l("div", { className: h, "data-autocomplete": o, onBlurCapture: c, children: e });
22
22
  };
23
23
  export {
24
24
  m as SearchbarBase
@@ -59,6 +59,7 @@ declare const meta: {
59
59
  href?: string | undefined;
60
60
  onClick?: (() => void) | undefined;
61
61
  onKeyPress?: React.KeyboardEventHandler | undefined;
62
+ ariaControlsId?: string | undefined;
62
63
  favourite?: boolean | undefined;
63
64
  favouriteLabel?: string | undefined;
64
65
  onToggleFavourite?: ((id: string) => void) | undefined;
@@ -40,4 +40,4 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
40
40
  /** Used as decerning text for the ListItem without title, defaults to title */
41
41
  ariaLabel?: string;
42
42
  }
43
- export declare const ListItemHeader: ({ as, highlightWords, interactive, color, loading, disabled, collapsible, linkIcon, expanded, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, active, badge, controls, className, children, ariaLabel, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const ListItemHeader: ({ as, highlightWords, interactive, color, loading, disabled, collapsible, linkIcon, expanded, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, active, badge, controls, className, children, ariaLabel, ariaControlsId, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,5 +12,8 @@ export interface ListItemLinkProps {
12
12
  className?: string;
13
13
  active?: boolean;
14
14
  children?: React.ReactNode;
15
+ expanded?: boolean;
16
+ collapsible?: boolean;
17
+ ariaControlsId?: string;
15
18
  }
16
- export declare const ListItemLink: ({ as, loading, disabled, selected, href, onClick, onKeyPress, className, active, ariaLabel, children, tabIndex, }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const ListItemLink: ({ as, loading, disabled, selected, href, onClick, onKeyPress, className, active, ariaLabel, children, tabIndex, expanded, collapsible, ariaControlsId, }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
@@ -50,6 +50,7 @@ declare const meta: {
50
50
  href?: string | undefined;
51
51
  onClick?: (() => void) | undefined;
52
52
  onKeyPress?: React.KeyboardEventHandler | undefined;
53
+ ariaControlsId?: string | undefined;
53
54
  }>) => import("react/jsx-runtime").JSX.Element)[];
54
55
  };
55
56
  export default meta;
@@ -49,6 +49,7 @@ declare const meta: {
49
49
  containerAs?: React.ElementType | undefined;
50
50
  shadow?: import('..').Shadow | undefined;
51
51
  collapsible?: boolean | undefined;
52
+ ariaControlsId?: string | undefined;
52
53
  };
53
54
  };
54
55
  export default meta;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.50.5",
3
+ "version": "0.50.7",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",