@altinn/altinn-components 0.45.4 → 0.46.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
- ._sidebar_lkphj_1,._sidebar_lkphj_1[aria-hidden=true]{display:none}@media (min-width: 1024px){._sidebar_lkphj_1{align-self:flex-start;flex-shrink:0;display:flex;flex-direction:column;width:224px}._sidebar_lkphj_1[data-sticky=true]{position:sticky;top:0}._sidebar_lkphj_1[aria-hidden=true]{display:none}}
1
+ ._sidebar_bcso7_1,._sidebar_bcso7_1[aria-hidden=true]{display:none}@media (min-width: 1024px){._sidebar_bcso7_1{align-self:flex-start;flex-shrink:0;display:flex;flex-direction:column;width:224px}._sidebar_bcso7_1[data-use-global-header=true]{margin-top:4.125rem}._sidebar_bcso7_1[data-sticky=true]{position:sticky;top:0}._sidebar_bcso7_1[aria-hidden=true]{display:none}}
@@ -1 +1 @@
1
- ._searchbar_1qnvb_1{position:relative}._searchbar_1qnvb_1[data-autocomplete=true][aria-expanded=true] input{border-bottom-left-radius:0;border-bottom-right-radius:0}._searchbar_1qnvb_1 nav{display:none}._searchbarExpanded_1qnvb_14 nav{position:absolute;display:block;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px}
1
+ ._searchbar_13e7s_1{position:relative}._searchbar_13e7s_1[data-autocomplete=true][aria-expanded=true] input{border-bottom-left-radius:0;border-bottom-right-radius:0}._searchbar_13e7s_1 nav{display:none}._searchbarExpanded_13e7s_14 nav{position:absolute;display:block;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px}._searchbarLocal_13e7s_22{width:100%;padding:var(--dsc-spacing-4) 0;z-index:100;margin-bottom:16px}@media (min-width: 1024px){._searchbarLocal_13e7s_22{max-width:320px;margin-right:auto}._searchbarLocal_13e7s_22._searchbarExpanded_13e7s_14{max-width:640px}}
@@ -0,0 +1,30 @@
1
+ import { jsxs as i, Fragment as s, jsx as e } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import { useRootContext as m } from "../RootProvider/RootProvider.js";
5
+ import { Searchbar as x } from "../Searchbar/Searchbar.js";
6
+ import "../Snackbar/useSnackbar.js";
7
+ import { Backdrop as p } from "../Dropdown/Backdrop.js";
8
+ const f = ({ search: n }) => {
9
+ const { currentId: o, toggleId: t, openId: c } = m(), a = () => {
10
+ c("inboxSearch");
11
+ }, r = () => {
12
+ t("inboxSearch");
13
+ };
14
+ return /* @__PURE__ */ i(s, { children: [
15
+ o === "inboxSearch" && /* @__PURE__ */ e(p, { onClick: r }),
16
+ /* @__PURE__ */ e(
17
+ x,
18
+ {
19
+ ...n,
20
+ expanded: o === "inboxSearch",
21
+ onClose: r,
22
+ onFocus: a,
23
+ useGlobalHeader: !0
24
+ }
25
+ )
26
+ ] });
27
+ };
28
+ export {
29
+ f as InboxSearch
30
+ };
@@ -0,0 +1,4 @@
1
+ import { InboxSearch as e } from "./InboxSearch.js";
2
+ export {
3
+ e as InboxSearch
4
+ };
@@ -1,43 +1,47 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as m } from "react/jsx-runtime";
2
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
3
  import { LayoutBase as L } from "./LayoutBase.js";
4
- import { LayoutBody as x } from "./LayoutBody.js";
5
- import { LayoutContent as j } from "./LayoutContent.js";
6
- import { LayoutSidebar as B } from "./LayoutSidebar.js";
7
- import { Footer as C } from "../Footer/Footer.js";
8
- import { GlobalHeader as F } from "../GlobalHeader/GlobalHeader.js";
4
+ import { LayoutBody as S } from "./LayoutBody.js";
5
+ import { LayoutContent as i } from "./LayoutContent.js";
6
+ import { LayoutSidebar as j } from "./LayoutSidebar.js";
7
+ import { Footer as B } from "../Footer/Footer.js";
8
+ import { GlobalHeader as C } from "../GlobalHeader/GlobalHeader.js";
9
9
  import "../../index-L8X2o7IH.js";
10
10
  import "react";
11
- import { useRootContext as H } from "../RootProvider/RootProvider.js";
12
- import { Menu as S } from "../Menu/Menu.js";
13
- import { Header as G } from "../Header/Header.js";
11
+ import { useRootContext as F } from "../RootProvider/RootProvider.js";
12
+ import { Menu as I } from "../Menu/Menu.js";
13
+ import { Header as v } from "../Header/Header.js";
14
14
  import "../Snackbar/useSnackbar.js";
15
- import { SkipLink as I } from "../SkipLink/SkipLink.js";
16
- const O = ({
17
- color: c,
18
- theme: f = "subtle",
19
- header: t,
20
- footer: n,
15
+ import { InboxSearch as M } from "../InboxSearch/InboxSearch.js";
16
+ import { SkipLink as R } from "../SkipLink/SkipLink.js";
17
+ const T = ({
18
+ color: h,
19
+ theme: y = "subtle",
20
+ header: m,
21
+ footer: u,
21
22
  sidebar: o,
22
- content: l = {},
23
- children: y,
24
- skipLink: r,
25
- useGlobalHeader: h = !1
23
+ content: n = {},
24
+ children: x,
25
+ skipLink: f,
26
+ useGlobalHeader: p = !1
26
27
  }) => {
27
- const { currentId: u } = H();
28
- return /* @__PURE__ */ p(L, { color: c, theme: u === "accountFullscreen" ? "default" : f, currentId: u, children: [
29
- r && /* @__PURE__ */ m(I, { ...r }),
30
- t && (h ? /* @__PURE__ */ m(F, { ...t }) : /* @__PURE__ */ m(G, { ...t })),
31
- /* @__PURE__ */ p(x, { currentId: u, children: [
32
- o && /* @__PURE__ */ p(B, { hidden: o == null ? void 0 : o.hidden, color: o == null ? void 0 : o.color, ...o, children: [
33
- (o == null ? void 0 : o.menu) && /* @__PURE__ */ m(S, { ...o == null ? void 0 : o.menu }),
28
+ const { currentId: r } = F(), l = m && "search" in m ? m.search : void 0;
29
+ return /* @__PURE__ */ c(L, { color: h, theme: r === "accountFullscreen" ? "default" : y, currentId: r, children: [
30
+ f && /* @__PURE__ */ t(R, { ...f }),
31
+ m && (p ? /* @__PURE__ */ t(C, { ...m }) : /* @__PURE__ */ t(v, { ...m })),
32
+ /* @__PURE__ */ c(S, { currentId: r, children: [
33
+ o && /* @__PURE__ */ c(j, { hidden: o == null ? void 0 : o.hidden, color: o == null ? void 0 : o.color, ...o, useGlobalHeader: p, children: [
34
+ (o == null ? void 0 : o.menu) && /* @__PURE__ */ t(I, { ...o == null ? void 0 : o.menu }),
34
35
  o == null ? void 0 : o.children
35
36
  ] }),
36
- /* @__PURE__ */ m(j, { color: l == null ? void 0 : l.color, id: "main-content", children: y })
37
+ /* @__PURE__ */ c(i, { color: n == null ? void 0 : n.color, id: "main-content", children: [
38
+ p && l && /* @__PURE__ */ t(M, { search: l }),
39
+ x
40
+ ] })
37
41
  ] }),
38
- n && /* @__PURE__ */ m(C, { ...n })
42
+ u && /* @__PURE__ */ t(B, { ...u })
39
43
  ] });
40
44
  };
41
45
  export {
42
- O as Layout
46
+ T as Layout
43
47
  };
@@ -1,7 +1,23 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import '../../assets/LayoutSidebar.css';const d = "_sidebar_lkphj_1", i = {
3
- sidebar: d
4
- }, c = ({ color: a, hidden: s = !1, sticky: e, children: r }) => /* @__PURE__ */ t("aside", { className: i.sidebar, "data-color": a, "data-sticky": e, "aria-hidden": s, children: r });
2
+ import '../../assets/LayoutSidebar.css';const o = "_sidebar_bcso7_1", i = {
3
+ sidebar: o
4
+ }, c = ({
5
+ color: a,
6
+ hidden: s = !1,
7
+ sticky: e,
8
+ children: r,
9
+ useGlobalHeader: d = !1
10
+ }) => /* @__PURE__ */ t(
11
+ "aside",
12
+ {
13
+ className: i.sidebar,
14
+ "data-color": a,
15
+ "data-sticky": e,
16
+ "data-use-global-header": d,
17
+ "aria-hidden": s,
18
+ children: r
19
+ }
20
+ );
5
21
  export {
6
22
  c as LayoutSidebar
7
23
  };
@@ -1,23 +1,24 @@
1
- import { jsxs as S, jsx as g } from "react/jsx-runtime";
2
- import { useState as k } from "react";
1
+ import { jsxs as k, jsx as g } from "react/jsx-runtime";
2
+ import { useState as v } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
- import { useIsDesktop as v } from "../../hooks/useIsDesktop.js";
5
- import { useRootContext as j } from "../RootProvider/RootProvider.js";
6
- import { SearchbarBase as x } from "./SearchbarBase.js";
7
- import { SearchbarField as D } from "./SearchbarField.js";
8
- import { Autocomplete as P } from "./Autocomplete.js";
4
+ import { useIsDesktop as j } from "../../hooks/useIsDesktop.js";
5
+ import { useRootContext as x } from "../RootProvider/RootProvider.js";
6
+ import { SearchbarBase as D } from "./SearchbarBase.js";
7
+ import { SearchbarField as P } from "./SearchbarField.js";
8
+ import { Autocomplete as y } from "./Autocomplete.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
- const K = ({
10
+ const L = ({
11
11
  className: I,
12
12
  autocomplete: a,
13
13
  expanded: u = !1,
14
14
  onClose: o,
15
15
  tabIndex: T,
16
+ useGlobalHeader: A = !1,
16
17
  ...e
17
18
  }) => {
18
- const [i, l] = k(!1), { previousId: A, openId: B } = j(), F = v();
19
- return /* @__PURE__ */ S(
20
- x,
19
+ const [i, l] = v(!1), { previousId: B, openId: F } = x(), S = j();
20
+ return /* @__PURE__ */ k(
21
+ D,
21
22
  {
22
23
  className: I,
23
24
  expanded: u,
@@ -25,11 +26,12 @@ const K = ({
25
26
  onBlurCapture: (t) => {
26
27
  var s, n, m, d, p, b, c, f;
27
28
  const r = (m = (n = (s = t.target) == null ? void 0 : s.attributes) == null ? void 0 : n.getNamedItem("data-testid")) == null ? void 0 : m.value;
28
- (d = t == null ? void 0 : t.relatedTarget) != null && d.closest('[data-autocomplete="true"]') || t.relatedTarget === null || (r === "search-button-clear" || r === "search-button-close" || r === "searchbar-input" && ((p = t.relatedTarget) == null ? void 0 : p.getAttribute("data-testid")) !== "searchbar-input" && ((b = t.relatedTarget) == null ? void 0 : b.getAttribute("data-testid")) !== "search-button-clear" && ((c = t.relatedTarget) == null ? void 0 : c.getAttribute("data-testid")) !== "search-button-close" && ((f = t.relatedTarget) == null ? void 0 : f.getAttribute("data-testid")) !== "autocomplete-list") && (F || A !== "menu" ? o == null || o() : B("menu"));
29
+ (d = t == null ? void 0 : t.relatedTarget) != null && d.closest('[data-autocomplete="true"]') || t.relatedTarget === null || (r === "search-button-clear" || r === "search-button-close" || r === "searchbar-input" && ((p = t.relatedTarget) == null ? void 0 : p.getAttribute("data-testid")) !== "searchbar-input" && ((b = t.relatedTarget) == null ? void 0 : b.getAttribute("data-testid")) !== "search-button-clear" && ((c = t.relatedTarget) == null ? void 0 : c.getAttribute("data-testid")) !== "search-button-close" && ((f = t.relatedTarget) == null ? void 0 : f.getAttribute("data-testid")) !== "autocomplete-list") && (S || B !== "menu" ? o == null || o() : F("menu"));
29
30
  },
31
+ useGlobalHeader: A,
30
32
  children: [
31
33
  /* @__PURE__ */ g(
32
- D,
34
+ P,
33
35
  {
34
36
  ...e,
35
37
  expanded: u,
@@ -47,7 +49,7 @@ const K = ({
47
49
  }
48
50
  ),
49
51
  a && /* @__PURE__ */ g(
50
- P,
52
+ y,
51
53
  {
52
54
  ...a,
53
55
  expanded: u,
@@ -61,5 +63,5 @@ const K = ({
61
63
  );
62
64
  };
63
65
  export {
64
- K as Searchbar
66
+ L as Searchbar
65
67
  };
@@ -1,18 +1,25 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { c as b } from "../../index-L8X2o7IH.js";
3
- import '../../assets/SearchbarBase.css';const d = "_searchbar_1qnvb_1", h = "_searchbarExpanded_1qnvb_14", a = {
4
- searchbar: d,
5
- searchbarExpanded: h
6
- }, l = ({
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/SearchbarBase.css';const n = "_searchbar_13e7s_1", d = "_searchbarExpanded_13e7s_14", _ = "_searchbarLocal_13e7s_22", a = {
4
+ searchbar: n,
5
+ searchbarExpanded: d,
6
+ searchbarLocal: _
7
+ }, m = ({
7
8
  className: r,
8
- children: e,
9
- expanded: s = !1,
9
+ children: s,
10
+ expanded: e = !1,
10
11
  onBlurCapture: c,
11
- autocomplete: t = !1
12
+ autocomplete: o = !1,
13
+ useGlobalHeader: t = !1
12
14
  }) => {
13
- const n = b(a.searchbar, r, s && a.searchbarExpanded);
14
- return /* @__PURE__ */ o("div", { className: n, "data-autocomplete": t, onBlurCapture: c, children: e });
15
+ const h = l(
16
+ a.searchbar,
17
+ r,
18
+ e && a.searchbarExpanded,
19
+ t && a.searchbarLocal
20
+ );
21
+ return /* @__PURE__ */ b("div", { className: h, "data-autocomplete": o, onBlurCapture: c, children: s });
15
22
  };
16
23
  export {
17
- l as SearchbarBase
24
+ m as SearchbarBase
18
25
  };
@@ -0,0 +1,5 @@
1
+ import { SearchbarProps } from '../Searchbar';
2
+ export interface InboxSearchProps {
3
+ search: SearchbarProps;
4
+ }
5
+ export declare const InboxSearch: ({ search }: InboxSearchProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { InboxSearch, type InboxSearchProps } from './InboxSearch';
@@ -10,5 +10,6 @@ export interface LayoutSidebarProps {
10
10
  hidden?: boolean;
11
11
  sticky?: boolean;
12
12
  children?: ReactNode;
13
+ useGlobalHeader?: boolean;
13
14
  }
14
- export declare const LayoutSidebar: ({ color, hidden, sticky, children }: LayoutSidebarProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const LayoutSidebar: ({ color, hidden, sticky, children, useGlobalHeader, }: LayoutSidebarProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,5 +4,6 @@ export interface SearchbarProps extends SearchbarFieldProps {
4
4
  autocomplete?: AutocompleteProps;
5
5
  expanded?: boolean;
6
6
  tabIndex?: number;
7
+ useGlobalHeader?: boolean;
7
8
  }
8
- export declare const Searchbar: ({ className, autocomplete, expanded, onClose, tabIndex, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Searchbar: ({ className, autocomplete, expanded, onClose, tabIndex, useGlobalHeader, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
2
2
  import { SearchbarProps } from '..';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ className, autocomplete, expanded, onClose, tabIndex, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ className, autocomplete, expanded, onClose, tabIndex, useGlobalHeader, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
6
6
  parameters: {};
7
7
  args: {
8
8
  placeholder: string;
@@ -5,5 +5,6 @@ export interface SearchbarBaseProps {
5
5
  expanded?: boolean;
6
6
  autocomplete?: boolean;
7
7
  onBlurCapture?: React.FocusEventHandler<HTMLDivElement>;
8
+ useGlobalHeader?: boolean;
8
9
  }
9
- export declare const SearchbarBase: ({ className, children, expanded, onBlurCapture, autocomplete, }: SearchbarBaseProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const SearchbarBase: ({ className, children, expanded, onBlurCapture, autocomplete, useGlobalHeader, }: SearchbarBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,6 +9,7 @@ declare const meta: {
9
9
  export default meta;
10
10
  export declare const InboxPage: () => import("react/jsx-runtime").JSX.Element;
11
11
  export declare const InboxEmptyPage: () => import("react/jsx-runtime").JSX.Element;
12
+ export declare const InboxWithGlobalSearch: () => import("react/jsx-runtime").JSX.Element;
12
13
  export declare const SearchPage: () => import("react/jsx-runtime").JSX.Element;
13
14
  export declare const SearchEmptyPage: () => import("react/jsx-runtime").JSX.Element;
14
15
  export declare const DraftsPage: () => 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.45.4",
3
+ "version": "0.46.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",