@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.
- package/dist/assets/LayoutSidebar.css +1 -1
- package/dist/assets/SearchbarBase.css +1 -1
- package/dist/components/InboxSearch/InboxSearch.js +30 -0
- package/dist/components/InboxSearch/index.js +4 -0
- package/dist/components/Layout/Layout.js +33 -29
- package/dist/components/Layout/LayoutSidebar.js +19 -3
- package/dist/components/Searchbar/Searchbar.js +17 -15
- package/dist/components/Searchbar/SearchbarBase.js +19 -12
- package/dist/types/lib/components/InboxSearch/InboxSearch.d.ts +5 -0
- package/dist/types/lib/components/InboxSearch/index.d.ts +1 -0
- package/dist/types/lib/components/Layout/LayoutSidebar.d.ts +2 -1
- package/dist/types/lib/components/Searchbar/Searchbar.d.ts +2 -1
- package/dist/types/lib/components/Searchbar/Searchbar.stories.d.ts +1 -1
- package/dist/types/lib/components/Searchbar/SearchbarBase.d.ts +2 -1
- package/dist/types/lib/stories/Inbox.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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
|
-
.
|
|
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
|
+
};
|
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
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
|
|
5
|
-
import { LayoutContent as
|
|
6
|
-
import { LayoutSidebar as
|
|
7
|
-
import { Footer as
|
|
8
|
-
import { GlobalHeader as
|
|
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
|
|
12
|
-
import { Menu as
|
|
13
|
-
import { Header as
|
|
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 {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
23
|
-
children:
|
|
24
|
-
skipLink:
|
|
25
|
-
useGlobalHeader:
|
|
23
|
+
content: n = {},
|
|
24
|
+
children: x,
|
|
25
|
+
skipLink: f,
|
|
26
|
+
useGlobalHeader: p = !1
|
|
26
27
|
}) => {
|
|
27
|
-
const { currentId:
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
o && /* @__PURE__ */
|
|
33
|
-
(o == null ? void 0 : o.menu) && /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
42
|
+
u && /* @__PURE__ */ t(B, { ...u })
|
|
39
43
|
] });
|
|
40
44
|
};
|
|
41
45
|
export {
|
|
42
|
-
|
|
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
|
|
3
|
-
sidebar:
|
|
4
|
-
}, c = ({
|
|
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
|
|
2
|
-
import { useState as
|
|
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
|
|
5
|
-
import { useRootContext as
|
|
6
|
-
import { SearchbarBase as
|
|
7
|
-
import { SearchbarField as
|
|
8
|
-
import { Autocomplete as
|
|
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
|
|
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] =
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
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") && (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
66
|
+
L as Searchbar
|
|
65
67
|
};
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/SearchbarBase.css';const d = "
|
|
4
|
-
searchbar:
|
|
5
|
-
searchbarExpanded:
|
|
6
|
-
|
|
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:
|
|
9
|
-
expanded:
|
|
9
|
+
children: s,
|
|
10
|
+
expanded: e = !1,
|
|
10
11
|
onBlurCapture: c,
|
|
11
|
-
autocomplete:
|
|
12
|
+
autocomplete: o = !1,
|
|
13
|
+
useGlobalHeader: t = !1
|
|
12
14
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
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
|
-
|
|
24
|
+
m as SearchbarBase
|
|
18
25
|
};
|
|
@@ -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;
|