@altinn/altinn-components 0.43.2 → 0.43.3

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
- ._label_e5maf_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_e5maf_13{color:var(--ds-color-text-default);display:inline;vertical-align:text-top}._count_e5maf_19{display:inline;vertical-align:super;font-size:smaller}._radio_e5maf_25,._checkbox_e5maf_26{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_e5maf_25{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_e5maf_26{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_e5maf_25[data-checked=true],._checkbox_e5maf_26[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_e5maf_59{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_e5maf_59{font-size:unset;width:1.25em;height:1.25em}._icon_e5maf_59 svg,._icon_e5maf_59 img{width:100%;height:100%}}
1
+ ._label_ggqvo_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_ggqvo_13{color:var(--ds-color-text-default);display:inline;vertical-align:text-top}._titleWrapper_ggqvo_19{display:inline;line-height:1.25}._count_ggqvo_24{margin-left:.5rem;display:inline;font-size:smaller;white-space:nowrap}._radio_ggqvo_31,._checkbox_ggqvo_32{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_ggqvo_31{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_ggqvo_32{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_ggqvo_31[data-checked=true],._checkbox_ggqvo_32[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_ggqvo_65{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_ggqvo_65{font-size:unset;width:1.25em;height:1.25em}._icon_ggqvo_65 svg,._icon_ggqvo_65 img{width:100%;height:100%}}
@@ -5,16 +5,16 @@ import "react";
5
5
  import { useRootContext as S } from "../RootProvider/RootProvider.js";
6
6
  import { DropdownBase as k } from "../Dropdown/DropdownBase.js";
7
7
  import { DrawerBase as B } from "../Dropdown/DrawerBase.js";
8
+ import { useIsDesktop as D } from "../../hooks/useIsDesktop.js";
8
9
  import { GlobalMenu as f } from "../GlobalMenu/GlobalMenu.js";
9
- import { GlobalMenuButton as D } from "../GlobalMenu/GlobalMenuButton.js";
10
- import { HeaderBase as I } from "./HeaderBase.js";
11
- import { HeaderLogo as l } from "./HeaderLogo.js";
12
- import { HeaderGroup as F } from "./HeaderGroup.js";
10
+ import { GlobalMenuButton as I } from "../GlobalMenu/GlobalMenuButton.js";
11
+ import { HeaderBase as l } from "./HeaderBase.js";
12
+ import { HeaderLogo as F } from "./HeaderLogo.js";
13
+ import { HeaderGroup as G } from "./HeaderGroup.js";
13
14
  import { HeaderSearch as w } from "./HeaderSearch.js";
14
- import { LocaleSwitcher as G } from "./LocaleSwitcher.js";
15
+ import { LocaleSwitcher as L } from "./LocaleSwitcher.js";
15
16
  import { Searchbar as x } from "../Searchbar/Searchbar.js";
16
17
  import "../Snackbar/useSnackbar.js";
17
- import { useIsDesktop as L } from "../../hooks/useIsDesktop.js";
18
18
  import '../../assets/Header.css';const N = "_drawer_afyu3_1", j = "_dropdown_afyu3_6", z = "_relative_afyu3_19", n = {
19
19
  drawer: N,
20
20
  dropdown: j,
@@ -35,21 +35,21 @@ import '../../assets/Header.css';const N = "_drawer_afyu3_1", j = "_dropdown_afy
35
35
  i("search");
36
36
  }, H = () => {
37
37
  i("menu");
38
- }, h = L();
38
+ }, h = D();
39
39
  return /* @__PURE__ */ d(
40
- I,
40
+ l,
41
41
  {
42
42
  currentId: r,
43
43
  open: r === "search" || r === "menu" || r === "locale",
44
44
  onClose: m,
45
45
  children: [
46
- /* @__PURE__ */ o(l, { ...u, badge: v }),
46
+ /* @__PURE__ */ o(F, { ...u, badge: v }),
47
47
  s && h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
48
- /* @__PURE__ */ d(F, { children: [
49
- p && /* @__PURE__ */ o(G, { ...p }),
48
+ /* @__PURE__ */ d(G, { children: [
49
+ p && /* @__PURE__ */ o(L, { ...p }),
50
50
  /* @__PURE__ */ d("div", { className: n.relative, children: [
51
51
  /* @__PURE__ */ o(
52
- D,
52
+ I,
53
53
  {
54
54
  currentAccount: t,
55
55
  onClick: H,
@@ -1,80 +1,85 @@
1
- import { jsx as a, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as r } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import { MenuItem as _ } from "./MenuItem.js";
5
+ import { MenuItem as m } from "./MenuItem.js";
6
6
  import "../Snackbar/useSnackbar.js";
7
- import { S as p } from "../../Checkmark-Byz_C9x4.js";
8
- import '../../assets/MenuOption.css';const N = "_label_e5maf_1", k = "_title_e5maf_13", v = "_count_e5maf_19", I = "_radio_e5maf_25", M = "_checkbox_e5maf_26", j = "_icon_e5maf_59", e = {
9
- label: N,
10
- title: k,
11
- count: v,
12
- radio: I,
13
- checkbox: M,
14
- icon: j
7
+ import { S as _ } from "../../Checkmark-Byz_C9x4.js";
8
+ import '../../assets/MenuOption.css';const b = "_label_ggqvo_1", x = "_title_ggqvo_13", q = "_titleWrapper_ggqvo_19", f = "_count_ggqvo_24", k = "_radio_ggqvo_31", W = "_checkbox_ggqvo_32", I = "_icon_ggqvo_65", e = {
9
+ label: b,
10
+ title: x,
11
+ titleWrapper: q,
12
+ count: f,
13
+ radio: k,
14
+ checkbox: W,
15
+ icon: I
15
16
  }, C = ({
16
- size: t = "md",
17
+ size: n = "md",
17
18
  type: h,
18
- name: S,
19
- active: o,
20
- value: g,
21
- label: n,
22
- title: u,
23
- description: b,
24
- icon: f,
25
- count: s = 0,
26
- checked: c = !1,
27
- disabled: r,
28
- onMouseEnter: w,
29
- onClick: i,
30
- role: l,
31
- ...m
19
+ name: M,
20
+ active: i,
21
+ value: j,
22
+ label: c,
23
+ title: g,
24
+ description: u,
25
+ icon: v,
26
+ count: t = 0,
27
+ checked: s = !1,
28
+ disabled: o,
29
+ onMouseEnter: S,
30
+ onClick: l,
31
+ role: d,
32
+ ...p
32
33
  }) => {
33
- const x = () => {
34
+ const N = () => {
34
35
  switch (h) {
35
36
  case "checkbox":
36
- return /* @__PURE__ */ d("span", { className: e.label, children: [
37
- /* @__PURE__ */ a("span", { className: e.checkbox, "data-checked": c, children: /* @__PURE__ */ a(p, { className: e.icon, "aria-hidden": !0 }) }),
38
- /* @__PURE__ */ a("span", { className: e.title, children: n }),
39
- s > 0 && /* @__PURE__ */ a("span", { className: e.count, children: s })
37
+ return /* @__PURE__ */ r("span", { className: e.label, children: [
38
+ /* @__PURE__ */ a("span", { className: e.checkbox, "data-checked": s, children: /* @__PURE__ */ a(_, { className: e.icon, "aria-hidden": !0 }) }),
39
+ /* @__PURE__ */ r("div", { className: e.titleWrapper, children: [
40
+ /* @__PURE__ */ a("span", { className: e.title, children: c }),
41
+ t > 0 && /* @__PURE__ */ a("span", { className: e.count, "aria-hidden": "true", children: t })
42
+ ] })
40
43
  ] });
41
44
  case "radio":
42
- return /* @__PURE__ */ d("span", { className: e.label, children: [
43
- /* @__PURE__ */ a("span", { className: e.radio, "data-checked": c, children: /* @__PURE__ */ a(p, { className: e.icon, "aria-hidden": !0 }) }),
44
- /* @__PURE__ */ a("span", { className: e.title, children: n }),
45
- s > 0 && /* @__PURE__ */ a("span", { className: e.count, children: s })
45
+ return /* @__PURE__ */ r("span", { className: e.label, children: [
46
+ /* @__PURE__ */ a("span", { className: e.radio, "data-checked": s, children: /* @__PURE__ */ a(_, { className: e.icon, "aria-hidden": !0 }) }),
47
+ /* @__PURE__ */ r("div", { className: e.titleWrapper, children: [
48
+ /* @__PURE__ */ a("span", { className: e.title, children: c }),
49
+ t > 0 && /* @__PURE__ */ a("span", { className: e.count, "aria-hidden": "true", children: t })
50
+ ] })
46
51
  ] });
47
52
  }
48
53
  };
49
- return n ? /* @__PURE__ */ a(
50
- _,
54
+ return c ? /* @__PURE__ */ a(
55
+ m,
51
56
  {
52
- disabled: r,
53
- selected: c,
54
- size: t,
57
+ disabled: o,
58
+ selected: s,
59
+ size: n,
55
60
  as: "div",
56
- active: o,
61
+ active: i,
57
62
  tabIndex: -1,
58
- onClick: i,
59
- role: l,
60
- label: /* @__PURE__ */ a(x, {}),
61
- ...m
63
+ onClick: l,
64
+ role: d,
65
+ label: /* @__PURE__ */ a(N, {}),
66
+ ...p
62
67
  }
63
68
  ) : /* @__PURE__ */ a(
64
- _,
69
+ m,
65
70
  {
66
- disabled: r,
67
- selected: c,
68
- size: t,
71
+ disabled: o,
72
+ selected: s,
73
+ size: n,
69
74
  as: "div",
70
- active: o,
75
+ active: i,
71
76
  tabIndex: -1,
72
- onClick: i,
73
- role: l,
74
- icon: f,
75
- title: u,
76
- description: b,
77
- ...m
77
+ onClick: l,
78
+ role: d,
79
+ icon: v,
80
+ title: g,
81
+ description: u,
82
+ ...p
78
83
  }
79
84
  );
80
85
  };
@@ -2,35 +2,39 @@ import { jsx as f } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
+ import { useIsDesktop as a } from "../../hooks/useIsDesktop.js";
5
6
  import "../Snackbar/useSnackbar.js";
6
- import { SearchField as l } from "../Forms/SearchField.js";
7
- import '../../assets/MenuSearch.css';const m = "_field_1w1s0_1", p = {
8
- field: m
9
- }, y = ({
10
- name: o,
7
+ import { SearchField as c } from "../Forms/SearchField.js";
8
+ import '../../assets/MenuSearch.css';const l = "_field_1w1s0_1", n = {
9
+ field: l
10
+ }, x = ({
11
+ name: e,
11
12
  value: r,
12
13
  placeholder: t = "Search",
13
- clearButtonAltText: i = "Clear search",
14
- onChange: s,
15
- onClear: a
16
- }) => /* @__PURE__ */ f(
17
- l,
18
- {
19
- size: "xs",
20
- name: o,
21
- value: r,
22
- placeholder: t,
23
- onChange: s,
24
- onClear: a,
25
- clearButtonAltText: i,
26
- className: p.field,
27
- autoComplete: "off",
28
- autoFocus: !0,
29
- onKeyDown: (e) => {
30
- (e.key === "ArrowUp" || e.key === "ArrowDown") && e.preventDefault();
14
+ clearButtonAltText: s = "Clear search",
15
+ onChange: i,
16
+ onClear: p
17
+ }) => {
18
+ const m = a();
19
+ return /* @__PURE__ */ f(
20
+ c,
21
+ {
22
+ size: "xs",
23
+ name: e,
24
+ value: r,
25
+ placeholder: t,
26
+ onChange: i,
27
+ onClear: p,
28
+ clearButtonAltText: s,
29
+ className: n.field,
30
+ autoComplete: "off",
31
+ autoFocus: m,
32
+ onKeyDown: (o) => {
33
+ (o.key === "ArrowUp" || o.key === "ArrowDown") && o.preventDefault();
34
+ }
31
35
  }
32
- }
33
- );
36
+ );
37
+ };
34
38
  export {
35
- y as MenuSearch
39
+ x as MenuSearch
36
40
  };
@@ -3,19 +3,19 @@ import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import { useRootContext as u } from "../RootProvider/RootProvider.js";
5
5
  import { DrawerOrDropdown as f } from "../Dropdown/DrawerOrDropdown.js";
6
- import { Menu as g } from "../Menu/Menu.js";
7
- import { useIsDesktop as x } from "../../hooks/useIsDesktop.js";
6
+ import { useIsDesktop as g } from "../../hooks/useIsDesktop.js";
7
+ import { Menu as x } from "../Menu/Menu.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { ToolbarButton as T } from "./ToolbarButton.js";
10
10
  import { ToolbarFilterBase as B } from "./ToolbarFilterBase.js";
11
11
  const v = ({ label: t = "Legg til", items: p, id: e }) => {
12
- const { currentId: i, closeAll: a, toggleId: d } = u(), o = i === e, l = () => d(e), m = x();
12
+ const { currentId: i, closeAll: a, toggleId: d } = u(), o = i === e, l = () => d(e), m = g();
13
13
  return /* @__PURE__ */ c(B, { expanded: o, onBlurCapture: (n) => {
14
14
  const s = n.relatedTarget;
15
15
  (!s || !n.currentTarget.contains(s)) && a();
16
16
  }, children: [
17
17
  /* @__PURE__ */ r(T, { type: "add", onToggle: l, "aria-expanded": o, children: t }),
18
- /* @__PURE__ */ r(f, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(g, { color: "neutral", items: p, keyboardEvents: o && m }) })
18
+ /* @__PURE__ */ r(f, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(x, { color: "neutral", items: p, keyboardEvents: o && m }) })
19
19
  ] });
20
20
  };
21
21
  export {
@@ -1,19 +1,27 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { useRootContext as u } from "../RootProvider/RootProvider.js";
5
- import { DrawerOrDropdown as f } from "../Dropdown/DrawerOrDropdown.js";
6
- import { Menu as x } from "../Menu/Menu.js";
4
+ import { useRootContext as f } from "../RootProvider/RootProvider.js";
5
+ import { DrawerOrDropdown as x } from "../Dropdown/DrawerOrDropdown.js";
6
+ import { Menu as T } from "../Menu/Menu.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { ToolbarButton as T } from "./ToolbarButton.js";
9
- import { ToolbarFilterBase as b } from "./ToolbarFilterBase.js";
10
- const k = ({ label: e, value: n, groups: m, search: i, items: l, id: r = "toolbar-menu" }) => {
11
- const { currentId: p, toggleId: s, closeAll: c } = u(), a = () => s(r), t = p === r;
12
- return /* @__PURE__ */ d(b, { expanded: t, children: [
13
- /* @__PURE__ */ o(T, { type: "switch", onToggle: a, active: !!n, children: e }),
14
- /* @__PURE__ */ o(f, { open: t, drawerTitle: "Endre konto", onClose: c, children: /* @__PURE__ */ o(x, { groups: m, search: i, items: l }) })
8
+ import { ToolbarButton as b } from "./ToolbarButton.js";
9
+ import { ToolbarFilterBase as g } from "./ToolbarFilterBase.js";
10
+ const v = ({
11
+ label: e,
12
+ value: n,
13
+ groups: m,
14
+ search: i,
15
+ items: l,
16
+ id: r = "toolbar-menu",
17
+ title: p = "Endre aktør"
18
+ }) => {
19
+ const { currentId: s, toggleId: c, closeAll: a } = f(), d = () => c(r), t = s === r;
20
+ return /* @__PURE__ */ u(g, { expanded: t, children: [
21
+ /* @__PURE__ */ o(b, { type: "switch", onToggle: d, active: !!n, children: e }),
22
+ /* @__PURE__ */ o(x, { open: t, drawerTitle: p, onClose: a, children: /* @__PURE__ */ o(T, { groups: m, search: i, items: l }) })
15
23
  ] });
16
24
  };
17
25
  export {
18
- k as ToolbarMenu
26
+ v as ToolbarMenu
19
27
  };
@@ -2,10 +2,11 @@ import { MenuItemGroups, MenuItemProps, MenuSearchProps } from '../Menu';
2
2
  export interface ToolbarMenuProps {
3
3
  label: string;
4
4
  value: string | number;
5
+ title?: string;
5
6
  items: MenuItemProps[];
6
7
  groups?: MenuItemGroups;
7
8
  search?: MenuSearchProps;
8
9
  id?: string;
9
10
  className?: string;
10
11
  }
11
- export declare const ToolbarMenu: ({ label, value, groups, search, items, id }: ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const ToolbarMenu: ({ label, value, groups, search, items, id, title, }: ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ label, value, groups, search, items, id }: import('./ToolbarMenu').ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ label, value, groups, search, items, id, title, }: import('./ToolbarMenu').ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {};
7
7
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.43.2",
3
+ "version": "0.43.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",