@altinn/altinn-components 0.24.0 → 0.24.1

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
- ._drawer_d2s9o_1[data-expanded=true]{display:block}._dropdown_d2s9o_5[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_d2s9o_5[data-expanded=true]{width:320px;display:block}._drawer_d2s9o_1[data-expanded=true]{display:none}}
1
+ ._drawer_1vzjh_1[data-expanded=true]{display:block}._dropdown_1vzjh_5[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1vzjh_5[data-expanded=true]{width:320px;display:block}._drawer_1vzjh_1[data-expanded=true]{display:none}}._relative_1vzjh_19{position:relative}
@@ -4,58 +4,59 @@ import { DropdownBase as p } from "../Dropdown/DropdownBase.js";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import { DrawerBase as m } from "../Dropdown/DrawerBase.js";
6
6
  import "react";
7
- import { useRootContext as b } from "../RootProvider/RootProvider.js";
7
+ import { useRootContext as C } from "../RootProvider/RootProvider.js";
8
8
  import { GlobalMenu as c } from "../GlobalMenu/GlobalMenu.js";
9
- import { HeaderBase as v } from "./HeaderBase.js";
10
- import { HeaderLogo as H } from "./HeaderLogo.js";
11
- import { HeaderButton as N } from "./HeaderButton.js";
12
- import { LocaleButton as _ } from "./LocaleButton.js";
9
+ import { HeaderBase as u } from "./HeaderBase.js";
10
+ import { HeaderLogo as N } from "./HeaderLogo.js";
11
+ import { HeaderButton as b } from "./HeaderButton.js";
12
+ import { LocaleButton as H } from "./LocaleButton.js";
13
13
  import { LocaleSwitcher as h } from "./LocaleSwitcher.js";
14
- import { Searchbar as B } from "../Search/Searchbar.js";
14
+ import { Searchbar as j } from "../Search/Searchbar.js";
15
15
  import "../Search/AutocompleteBase.js";
16
16
  import "../Snackbar/useSnackbar.js";
17
- import { HeaderGroup as L } from "./HeaderGroup.js";
18
- import { HeaderSearch as S } from "./HeaderSearch.js";
19
- import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s9o_5", a = {
20
- drawer: k,
21
- dropdown: I
22
- }, W = ({ menu: r, locale: n, search: i, currentAccount: l, logo: f = {}, badge: w }) => {
23
- const { currentId: e, toggleId: t, openId: g, closeAll: d } = b(), y = () => {
17
+ import { HeaderGroup as B } from "./HeaderGroup.js";
18
+ import { HeaderSearch as L } from "./HeaderSearch.js";
19
+ import '../../assets/Header.css';const S = "_drawer_1vzjh_1", k = "_dropdown_1vzjh_5", z = "_relative_1vzjh_19", a = {
20
+ drawer: S,
21
+ dropdown: k,
22
+ relative: z
23
+ }, X = ({ menu: r, locale: l, search: i, currentAccount: t, logo: f = {}, badge: w }) => {
24
+ const { currentId: e, toggleId: n, openId: g, closeAll: d } = C(), v = () => {
24
25
  g("search");
25
- }, u = () => {
26
- t("search");
26
+ }, _ = () => {
27
+ n("search");
27
28
  }, x = () => {
28
- t("menu");
29
- }, C = () => {
30
- t("locale");
29
+ n("menu");
30
+ }, y = () => {
31
+ n("locale");
31
32
  };
32
33
  return /* @__PURE__ */ s(
33
- v,
34
+ u,
34
35
  {
35
36
  currentId: e,
36
37
  open: e === "search" || e === "menu" || e === "locale",
37
38
  onClose: d,
38
39
  children: [
39
- /* @__PURE__ */ o(H, { ...f, className: a.logo }),
40
- /* @__PURE__ */ s(L, { className: a.menu, children: [
41
- /* @__PURE__ */ o("div", { style: { position: "relative" }, children: /* @__PURE__ */ o(_, { onClick: C, expanded: e === "locale" }) }),
42
- /* @__PURE__ */ s("div", { style: { position: "relative" }, children: [
40
+ /* @__PURE__ */ o(N, { ...f, className: a.logo }),
41
+ /* @__PURE__ */ s(B, { children: [
42
+ l && /* @__PURE__ */ o("div", { className: a.relative, children: /* @__PURE__ */ o(H, { onClick: y, expanded: e === "locale" }) }),
43
+ /* @__PURE__ */ s("div", { className: a.relative, children: [
43
44
  /* @__PURE__ */ o(
44
- N,
45
+ b,
45
46
  {
46
47
  color: "company",
47
48
  variant: "solid",
48
49
  badge: w,
49
- avatar: l && {
50
- type: l.type,
51
- name: l.name
50
+ avatar: t && {
51
+ type: t.type,
52
+ name: t.name
52
53
  },
53
54
  onClick: x,
54
55
  expanded: e === "menu",
55
56
  label: r == null ? void 0 : r.menuLabel
56
57
  }
57
58
  ),
58
- n && /* @__PURE__ */ o(
59
+ l && /* @__PURE__ */ o(
59
60
  p,
60
61
  {
61
62
  layout: "desktop",
@@ -63,7 +64,7 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
63
64
  placement: "right",
64
65
  open: e === "locale",
65
66
  className: a.dropdown,
66
- children: /* @__PURE__ */ o(h, { ...n })
67
+ children: /* @__PURE__ */ o(h, { ...l })
67
68
  }
68
69
  ),
69
70
  r && /* @__PURE__ */ o(
@@ -74,18 +75,18 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
74
75
  placement: "right",
75
76
  open: e === "menu",
76
77
  className: a.dropdown,
77
- children: /* @__PURE__ */ o(c, { ...r, currentAccount: l, onClose: d })
78
+ children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d })
78
79
  }
79
80
  )
80
81
  ] })
81
82
  ] }),
82
- i && /* @__PURE__ */ o(S, { expanded: e === "search", children: /* @__PURE__ */ o(B, { ...i, expanded: e === "search", onClose: u, onFocus: y }) }),
83
- n && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "locale", className: a.drawer, children: /* @__PURE__ */ o(h, { ...n }) }),
84
- r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount: l, onClose: d }) })
83
+ i && /* @__PURE__ */ o(L, { expanded: e === "search", children: /* @__PURE__ */ o(j, { ...i, expanded: e === "search", onClose: _, onFocus: v }) }),
84
+ l && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "locale", className: a.drawer, children: /* @__PURE__ */ o(h, { ...l }) }),
85
+ r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d }) })
85
86
  ]
86
87
  }
87
88
  );
88
89
  };
89
90
  export {
90
- W as Header
91
+ X as Header
91
92
  };
@@ -7,25 +7,25 @@ import "../RootProvider/RootProvider.js";
7
7
  import "../Search/AutocompleteBase.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { S as l } from "../../MagnifyingGlass-DWIcpwS4.js";
10
- import { S as u } from "../../XMark-Bv1I87Ev.js";
11
- import '../../assets/ToolbarSearch.css';const _ = "_field_3uyps_1", f = "_icon_3uyps_5", d = "_input_3uyps_14", y = "_clear_3uyps_31", o = {
12
- field: _,
10
+ import { S as _ } from "../../XMark-Bv1I87Ev.js";
11
+ import '../../assets/ToolbarSearch.css';const u = "_field_3uyps_1", f = "_icon_3uyps_5", d = "_input_3uyps_14", y = "_clear_3uyps_31", o = {
12
+ field: u,
13
13
  icon: f,
14
14
  input: d,
15
15
  clear: y
16
16
  }, T = ({
17
- value: t,
17
+ value: s,
18
18
  name: r,
19
19
  placeholder: c = "Search",
20
20
  clearButtonAltText: n = "Clear search",
21
21
  onChange: e,
22
- onClear: s
22
+ onClear: t
23
23
  }) => /* @__PURE__ */ a("div", { className: o.field, children: [
24
24
  /* @__PURE__ */ i(
25
25
  "input",
26
26
  {
27
27
  type: "search",
28
- value: t,
28
+ value: s,
29
29
  name: r,
30
30
  placeholder: c,
31
31
  className: o.input,
@@ -33,14 +33,14 @@ import '../../assets/ToolbarSearch.css';const _ = "_field_3uyps_1", f = "_icon_3
33
33
  }
34
34
  ),
35
35
  /* @__PURE__ */ i(m, { svgElement: l, className: o.icon }),
36
- s && /* @__PURE__ */ i(
36
+ t && !!s && /* @__PURE__ */ i(
37
37
  p,
38
38
  {
39
- icon: u,
39
+ icon: _,
40
40
  variant: "solid",
41
41
  size: "custom",
42
42
  className: o.clear,
43
- onClick: s,
43
+ onClick: t,
44
44
  iconAltText: n
45
45
  }
46
46
  )
@@ -20,3 +20,4 @@ declare const meta: {
20
20
  export default meta;
21
21
  export declare const CurrentAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
22
22
  export declare const Login: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const ChangeLocale: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",