@altinn/altinn-components 0.46.5 → 0.46.6

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
- ._button_1g9ar_1{flex-shrink:0;position:relative;z-index:2;display:inline-flex;align-items:center;column-gap:.625rem;padding:.625rem;border:none;border-radius:4px}._label_1g9ar_13{font-size:1.125rem;font-weight:500;padding:.25rem}._avatar_1g9ar_19{font-size:2.25rem;width:2.25rem;height:2.25rem}._icon_1g9ar_25{font-size:1.5rem;width:1.5rem;height:1.5rem}._badge_1g9ar_31{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
1
+ ._button_rhdbs_1{flex-shrink:0;position:relative;z-index:2;display:inline-flex;align-items:center;column-gap:.625rem;padding:.625rem;border:none;border-radius:4px}._label_rhdbs_13{font-size:1.125rem;font-weight:500;padding:.25rem}._avatar_rhdbs_19{font-size:2.25rem;width:2.25rem;height:2.25rem}._icon_rhdbs_25{font-size:1.5rem;width:1.5rem;height:1.5rem}._iconMobile_rhdbs_31{font-size:1.5rem;width:3.55rem;height:1.5rem}._badge_rhdbs_37{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
@@ -1,13 +1,13 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { c as t } from "../../index-L8X2o7IH.js";
3
- import { DigdirLogomark as c } from "../Header/DigdirLogomark.js";
4
- import '../../assets/FooterLogo.css';const g = "_logo_127g0_1", i = "_symbol_127g0_9", s = {
5
- logo: g,
6
- symbol: i
7
- }, _ = ({ className: r, title: l = "Digdir" }) => /* @__PURE__ */ m("div", { className: t(s.logo, r), children: [
8
- /* @__PURE__ */ o(c, { className: s.symbol }),
2
+ import { c as i } from "../../index-L8X2o7IH.js";
3
+ import { DigdirLogomark as t } from "../Header/DigdirLogomark.js";
4
+ import '../../assets/FooterLogo.css';const c = "_logo_127g0_1", e = "_symbol_127g0_9", s = {
5
+ logo: c,
6
+ symbol: e
7
+ }, d = ({ className: r, title: l = "Digdir" }) => /* @__PURE__ */ m("div", { className: i(s.logo, r), children: [
8
+ /* @__PURE__ */ o(t, { className: s.symbol, "aria-hidden": !0 }),
9
9
  /* @__PURE__ */ o("span", { children: l })
10
10
  ] });
11
11
  export {
12
- _ as FooterLogo
12
+ d as FooterLogo
13
13
  };
@@ -1,20 +1,21 @@
1
- import { jsxs as L, jsx as C } from "react/jsx-runtime";
2
- import { useIsDesktop as n } from "../../hooks/useIsDesktop.js";
3
- const p = ({ className: e, title: i = "Digdir logomark" }) => {
4
- const l = n() ? 8.5 : 7, { width: o, height: t } = { width: `${l}em`, height: `${l * 0.34}em` };
5
- return /* @__PURE__ */ L(
1
+ import { jsxs as e, jsx as C } from "react/jsx-runtime";
2
+ import { useIsDesktop as r } from "../../hooks/useIsDesktop.js";
3
+ const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) => {
4
+ const l = r() ? 8.5 : 7, { width: t, height: n } = { width: `${l}em`, height: `${l * 0.34}em` };
5
+ return /* @__PURE__ */ e(
6
6
  "svg",
7
7
  {
8
8
  fill: "none",
9
9
  xmlns: "http://www.w3.org/2000/svg",
10
- width: o,
11
- height: t,
10
+ width: t,
11
+ height: n,
12
12
  viewBox: "0 0 113.779 38.8565",
13
13
  version: "1.1",
14
- className: e,
14
+ className: L,
15
+ "aria-hidden": o,
15
16
  children: [
16
17
  /* @__PURE__ */ C("title", { children: i }),
17
- /* @__PURE__ */ L("g", { id: "surface1", children: [
18
+ /* @__PURE__ */ e("g", { id: "surface1", children: [
18
19
  /* @__PURE__ */ C(
19
20
  "path",
20
21
  {
@@ -1,40 +1,44 @@
1
- import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import { useState as S } from "react";
1
+ import { jsx as r, jsxs as S } from "react/jsx-runtime";
2
+ import { useState as d, useRef as g, useEffect as b } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
- import { useIsDesktop as d } from "../../hooks/useIsDesktop.js";
5
- import { useRootContext as f } from "../RootProvider/RootProvider.js";
4
+ import { useIsDesktop as k } from "../../hooks/useIsDesktop.js";
5
+ import { useRootContext as v } from "../RootProvider/RootProvider.js";
6
6
  import { s as o } from "../../globalSearch.module-Ejp7X0dO.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { S as r } from "../../index-B6sKSsN9.js";
9
- import { S as g } from "../../MagnifyingGlass-bwVhw07z.js";
10
- const B = ({ onSearch: a }) => {
11
- const l = d(), [n, c] = S(""), { languageCode: i, closeAll: m } = f(), { search: p, placeholder: s } = b(i), h = () => {
12
- a(n), m();
13
- };
14
- return /* @__PURE__ */ e(
8
+ import { S as a } from "../../index-B6sKSsN9.js";
9
+ import { S as x } from "../../MagnifyingGlass-bwVhw07z.js";
10
+ const q = ({ onSearch: t }) => {
11
+ const u = k(), [s, i] = d(""), { languageCode: h, closeAll: m, currentId: n } = v(), { search: p, placeholder: c } = y(h), f = () => {
12
+ t(s), m();
13
+ }, l = g(null);
14
+ return b(() => {
15
+ var e;
16
+ n === "search" && ((e = l.current) == null || e.focus());
17
+ }, [n]), /* @__PURE__ */ r(
15
18
  "form",
16
19
  {
17
- onSubmit: (t) => {
18
- t.preventDefault(), h();
20
+ onSubmit: (e) => {
21
+ e.preventDefault(), f();
19
22
  },
20
- children: /* @__PURE__ */ u(r, { className: o.globalSearch, "data-size": l ? "lg" : "md", children: [
21
- /* @__PURE__ */ e(
22
- r.Input,
23
+ children: /* @__PURE__ */ S(a, { className: o.globalSearch, "data-size": u ? "lg" : "md", children: [
24
+ /* @__PURE__ */ r(
25
+ a.Input,
23
26
  {
24
- placeholder: s,
25
- onChange: (t) => c(t.target.value),
26
- value: n,
27
- "aria-label": s,
27
+ ref: l,
28
+ placeholder: c,
29
+ onChange: (e) => i(e.target.value),
30
+ value: s,
31
+ "aria-label": c,
28
32
  className: o.searchInput
29
33
  }
30
34
  ),
31
- /* @__PURE__ */ e(r.Clear, {}),
32
- /* @__PURE__ */ e(r.Button, { variant: "secondary", icon: !0, "aria-label": p, className: o.searchInputButton, children: /* @__PURE__ */ e(g, {}) })
35
+ /* @__PURE__ */ r(a.Clear, {}),
36
+ /* @__PURE__ */ r(a.Button, { variant: "secondary", icon: !0, "aria-label": p, className: o.searchInputButton, children: /* @__PURE__ */ r(x, {}) })
33
37
  ] })
34
38
  }
35
39
  );
36
- }, b = (a) => {
37
- switch (a) {
40
+ }, y = (t) => {
41
+ switch (t) {
38
42
  case "nn":
39
43
  return {
40
44
  search: "Søk",
@@ -53,5 +57,5 @@ const B = ({ onSearch: a }) => {
53
57
  }
54
58
  };
55
59
  export {
56
- B as GlobalSearch
60
+ q as GlobalSearch
57
61
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "react";
5
5
  import { useIsDesktop as i } from "../../hooks/useIsDesktop.js";
@@ -13,19 +13,19 @@ const v = ({
13
13
  onClick: t,
14
14
  expanded: o
15
15
  }) => {
16
- const { languageCode: n } = l(), { search: r, close: s } = f(n), e = i();
16
+ const { languageCode: a } = l(), { search: r, close: n } = f(a), e = i();
17
17
  return /* @__PURE__ */ c(
18
18
  m,
19
19
  {
20
20
  type: "button",
21
21
  icon: !e,
22
- title: o ? s : r,
22
+ title: o ? n : r,
23
23
  onClick: t,
24
24
  "data-color": "neutral",
25
25
  className: u.searchButton,
26
26
  children: [
27
- o ? /* @__PURE__ */ a(p, { "aria-hidden": "true" }) : /* @__PURE__ */ a(h, { "aria-hidden": "true" }),
28
- e ? o ? s : r : null
27
+ o ? /* @__PURE__ */ s(p, { "aria-hidden": "true" }) : /* @__PURE__ */ s(h, { "aria-hidden": "true" }),
28
+ e ? r : null
29
29
  ]
30
30
  }
31
31
  );
@@ -1,17 +1,23 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { c as p } from "../../index-L8X2o7IH.js";
3
- import { Badge as e } from "../Badge/Badge.js";
4
- import { ButtonBase as g } from "../Button/ButtonBase.js";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { c as n } from "../../index-L8X2o7IH.js";
3
+ import { Badge as g } from "../Badge/Badge.js";
4
+ import { ButtonBase as l } from "../Button/ButtonBase.js";
5
5
  import "react";
6
- import "../RootProvider/RootProvider.js";
6
+ import { useRootContext as c } from "../RootProvider/RootProvider.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { DigdirLogomark as a } from "./DigdirLogomark.js";
9
- import '../../assets/HeaderLogo2.css';const c = "_logo_1d6ig_1", l = {
10
- logo: c
11
- }, L = ({ className: t, as: m = "a", href: i = "/", badge: o }) => /* @__PURE__ */ s(g, { as: m, className: p(l.logo, t), href: i, children: [
12
- /* @__PURE__ */ r(a, {}),
13
- o && /* @__PURE__ */ r(e, { ...o })
14
- ] });
8
+ import { DigdirLogomark as p } from "./DigdirLogomark.js";
9
+ import '../../assets/HeaderLogo2.css';const f = "_logo_1d6ig_1", d = {
10
+ logo: f
11
+ }, x = {
12
+ nn: "Gå til framsida",
13
+ en: "Go to homepage"
14
+ }, C = ({ className: r, as: m = "a", href: s = "/", badge: o }) => {
15
+ const { languageCode: e } = c(), i = x[e ?? ""] ?? "Gå til forsiden";
16
+ return /* @__PURE__ */ a(l, { as: m, className: n(d.logo, r), href: s, ariaLabel: i, children: [
17
+ /* @__PURE__ */ t(p, {}),
18
+ o && /* @__PURE__ */ t(g, { ...o })
19
+ ] });
20
+ };
15
21
  export {
16
- L as HeaderLogo
22
+ C as HeaderLogo
17
23
  };
@@ -1,80 +1,99 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as n } from "react/jsx-runtime";
3
- import { c as f } from "../../index-L8X2o7IH.js";
4
- import s, { forwardRef as _ } from "react";
5
- import { useIsDesktop as y } from "../../hooks/useIsDesktop.js";
6
- import { Badge as p } from "../Badge/Badge.js";
7
- import { ButtonBase as b } from "../Button/ButtonBase.js";
8
- import { ButtonLabel as g } from "../Button/ButtonLabel.js";
9
- import { ButtonIcon as h } from "../Button/ButtonIcon.js";
10
- import "../RootProvider/RootProvider.js";
2
+ import { jsxs as u, jsx as r, Fragment as w } from "react/jsx-runtime";
3
+ import { c as p } from "../../index-L8X2o7IH.js";
4
+ import m, { forwardRef as x } from "react";
5
+ import { useIsDesktop as M } from "../../hooks/useIsDesktop.js";
6
+ import { Badge as h } from "../Badge/Badge.js";
7
+ import { ButtonBase as g } from "../Button/ButtonBase.js";
8
+ import { ButtonLabel as _ } from "../Button/ButtonLabel.js";
9
+ import { ButtonIcon as d } from "../Button/ButtonIcon.js";
10
+ import { useRootContext as O } from "../RootProvider/RootProvider.js";
11
11
  import "../Snackbar/useSnackbar.js";
12
- import { S as v } from "../../XMark-tKk6aExO.js";
13
- import { u as w } from "../../useId-BVFxCjkq.js";
14
- import '../../assets/GlobalMenuButton2.css';var O = function(t, l) {
12
+ import { S as y } from "../../XMark-tKk6aExO.js";
13
+ import { u as I } from "../../useId-BVFxCjkq.js";
14
+ import '../../assets/GlobalMenuButton2.css';var j = function(t, l) {
15
15
  var o = {};
16
16
  for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (o[e] = t[e]);
17
17
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
18
- for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
19
- l.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (o[e[r]] = t[e[r]]);
18
+ for (var n = 0, e = Object.getOwnPropertySymbols(t); n < e.length; n++)
19
+ l.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[n]) && (o[e[n]] = t[e[n]]);
20
20
  return o;
21
21
  };
22
- const I = _((t, l) => {
23
- var { title: o, titleId: e } = t, r = O(t, ["title", "titleId"]);
24
- let a = w();
25
- return a = o ? e || "title-" + a : void 0, s.createElement(
22
+ const k = x((t, l) => {
23
+ var { title: o, titleId: e } = t, n = j(t, ["title", "titleId"]);
24
+ let i = I();
25
+ return i = o ? e || "title-" + i : void 0, m.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": a }, r),
28
- o ? s.createElement("title", { id: a }, o) : null,
29
- s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.75 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17A.75.75 0 0 1 2.75 6m0 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17a.75.75 0 0 1-.75-.75m.75 5.25a.75.75 0 0 0 0 1.5h17a.75.75 0 0 0 0-1.5z", clipRule: "evenodd" })
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": i }, n),
28
+ o ? m.createElement("title", { id: i }, o) : null,
29
+ m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.75 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17A.75.75 0 0 1 2.75 6m0 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17a.75.75 0 0 1-.75-.75m.75 5.25a.75.75 0 0 0 0 1.5h17a.75.75 0 0 0 0-1.5z", clipRule: "evenodd" })
30
30
  );
31
- }), x = "_button_1g9ar_1", j = "_icon_1g9ar_25", B = "_badge_1g9ar_31", i = {
32
- button: x,
33
- icon: j,
34
- badge: B
35
- }, H = ({
31
+ }), B = "_button_rhdbs_1", N = "_icon_rhdbs_25", R = "_iconMobile_rhdbs_31", S = "_badge_rhdbs_37", a = {
32
+ button: B,
33
+ icon: N,
34
+ iconMobile: R,
35
+ badge: S
36
+ }, C = (t) => {
37
+ switch (t) {
38
+ case "nn":
39
+ return {
40
+ close: "Lukk meny"
41
+ };
42
+ case "en":
43
+ return {
44
+ close: "Close menu"
45
+ };
46
+ default:
47
+ return {
48
+ close: "Lukk Meny"
49
+ };
50
+ }
51
+ }, J = ({
36
52
  className: t,
37
53
  as: l = "button",
38
54
  color: o = "accent",
39
55
  variant: e = "solid",
40
- expanded: r,
41
- label: a = "Menu",
56
+ expanded: n,
57
+ label: i = "Menu",
42
58
  badge: c,
43
- ...m
59
+ ...f
44
60
  }) => {
45
- const u = y();
46
- return r ? /* @__PURE__ */ d(
47
- b,
61
+ const s = M(), { languageCode: v } = O(), { close: b } = C(v);
62
+ return n ? /* @__PURE__ */ u(
63
+ g,
48
64
  {
49
- ...m,
65
+ ...f,
50
66
  as: l,
51
67
  type: "button",
52
68
  variant: e,
53
69
  color: o,
54
- className: f(i.button, t),
70
+ className: p(a.button, t),
55
71
  children: [
56
- u && /* @__PURE__ */ n(h, { className: i.closeIcon, icon: /* @__PURE__ */ n(v, { className: i.icon, "aria-label": "Close" }) }),
57
- /* @__PURE__ */ n(g, { children: a }),
58
- c && /* @__PURE__ */ n(p, { ...c, className: i.badge })
72
+ s && /* @__PURE__ */ u(w, { children: [
73
+ /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.icon, "aria-label": b }) }),
74
+ /* @__PURE__ */ r(_, { children: i })
75
+ ] }),
76
+ !s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.iconMobile, "aria-label": b }) }),
77
+ c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
59
78
  ]
60
79
  }
61
- ) : /* @__PURE__ */ d(
62
- b,
80
+ ) : /* @__PURE__ */ u(
81
+ g,
63
82
  {
64
- ...m,
83
+ ...f,
65
84
  as: l,
66
85
  type: "button",
67
86
  variant: e,
68
87
  color: o,
69
- className: f(i.button, t),
88
+ className: p(a.button, t),
70
89
  children: [
71
- u && /* @__PURE__ */ n(h, { icon: /* @__PURE__ */ n(I, { className: i.icon, "aria-hidden": !0 }) }),
72
- /* @__PURE__ */ n(g, { children: a }),
73
- c && /* @__PURE__ */ n(p, { ...c, className: i.badge })
90
+ s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(k, { className: a.icon, "aria-hidden": !0 }) }),
91
+ /* @__PURE__ */ r(_, { children: i }),
92
+ c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
74
93
  ]
75
94
  }
76
95
  );
77
96
  };
78
97
  export {
79
- H as GlobalMenuButton
98
+ J as GlobalMenuButton
80
99
  };
@@ -1,5 +1,6 @@
1
1
  export interface SymbolProps {
2
2
  className?: string;
3
3
  title?: string;
4
+ 'aria-hidden'?: boolean;
4
5
  }
5
- export declare const DigdirLogomark: ({ className, title }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const DigdirLogomark: ({ className, title, "aria-hidden": ariaHidden }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ElementType, MouseEventHandler } from 'react';
2
- import { BadgeProps } from '../Badge/Badge.tsx';
2
+ import { BadgeProps } from '../Badge';
3
3
  export interface HeaderLogoProps {
4
4
  className?: string;
5
5
  as?: ElementType;
@@ -1,6 +1,6 @@
1
1
  import { HeaderLogoProps, MenuProps } from '../';
2
2
  import { BadgeProps } from '../Badge';
3
- import { GlobalMenuProps_old, Account } from '../GlobalMenu_old/index.tsx';
3
+ import { GlobalMenuProps_old, Account } from '../GlobalMenu_old';
4
4
  import { SearchbarProps } from '../Searchbar';
5
5
  import { LocaleSwitcherProps } from './';
6
6
  export interface HeaderProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.46.5",
3
+ "version": "0.46.6",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",