@altinn/altinn-components 0.38.4 → 0.38.5

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,56 +1,56 @@
1
1
  "use client";
2
- import { jsx as w } from "react/jsx-runtime";
3
- import { useState as I } from "react";
2
+ import { jsx as I } from "react/jsx-runtime";
3
+ import { useState as c } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../RootProvider/RootProvider.js";
6
6
  import { Menu as M } from "../Menu/Menu.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
8
  const b = (n) => `${n} hits`, k = ({
9
9
  items: n = [],
10
- groups: h = {},
10
+ groups: f = {},
11
11
  search: t,
12
12
  onSelectAccount: r,
13
13
  currentAccount: s,
14
- menuItemsVirtual: C
14
+ menuItemsVirtual: h
15
15
  }) => {
16
- var p;
16
+ var u;
17
17
  const d = n.map((o) => ({
18
18
  ...o,
19
19
  title: (o == null ? void 0 : o.title) || o.name,
20
20
  groupId: o.groupId || "search",
21
21
  selected: o.selected ?? (s == null ? void 0 : s.id) === o.id,
22
22
  onClick: () => r == null ? void 0 : r(o.id)
23
- })), [l, a] = I(""), e = l ? d.filter(
23
+ })), [l, a] = c(""), e = l ? d.filter(
24
24
  (o) => {
25
- var g, i, f;
26
- return ((g = o == null ? void 0 : o.name) == null ? void 0 : g.toLowerCase().includes(l.toLowerCase())) || ((f = (i = o == null ? void 0 : o.description) == null ? void 0 : i.toString()) == null ? void 0 : f.toLowerCase().includes(l.toLowerCase()));
25
+ var p, g, i;
26
+ return ((p = o == null ? void 0 : o.name) == null ? void 0 : p.toLowerCase().includes(l.toLowerCase())) || ((i = (g = o == null ? void 0 : o.description) == null ? void 0 : g.toString()) == null ? void 0 : i.toLowerCase().includes(l.toLowerCase()));
27
27
  }
28
28
  ).map((o) => ({
29
29
  ...o,
30
30
  groupId: "search",
31
31
  title: (o == null ? void 0 : o.title) || o.name,
32
32
  highlightWords: [l]
33
- })) : d, L = l ? {
33
+ })) : d, C = l ? {
34
34
  search: {
35
- title: ((p = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : p.call(t, e.length)) ?? b(e.length)
35
+ title: ((u = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : u.call(t, e.length)) ?? b(e.length)
36
36
  }
37
- } : h, c = {
37
+ } : f, L = {
38
38
  name: "account-search",
39
39
  value: l,
40
40
  placeholder: (t == null ? void 0 : t.placeholder) ?? "Find account",
41
41
  onChange: (o) => a(o.target.value),
42
42
  onClear: () => a("")
43
- }, u = [
43
+ }, w = [
44
44
  ...e.length > 0 ? e : [{ id: "search", groupId: "search", hidden: !0 }]
45
45
  ];
46
- return console.log("items", u), /* @__PURE__ */ w(
46
+ return /* @__PURE__ */ I(
47
47
  M,
48
48
  {
49
49
  theme: "default",
50
- search: t && c,
51
- groups: L,
52
- items: u,
53
- menuItemsVirtual: C
50
+ search: t && L,
51
+ groups: C,
52
+ items: w,
53
+ menuItemsVirtual: h
54
54
  }
55
55
  );
56
56
  };
@@ -1,21 +1,17 @@
1
1
  import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { Button as n } from "../Button/Button.js";
5
4
  import "../RootProvider/RootProvider.js";
6
- import { Heading as e } from "../Typography/Heading.js";
7
- import { List as p } from "../List/List.js";
5
+ import { Typography as p } from "../Typography/Typography.js";
6
+ import { Heading as s } from "../Typography/Heading.js";
7
+ import { List as e } from "../List/List.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { Flex as s } from "../Page/Flex.js";
10
- import { Section as c } from "../Page/Section.js";
11
- import { S as a } from "../../Checkmark-D17Nyv_u.js";
12
- const z = ({ title: i, children: m, checkAllLabel: o }) => /* @__PURE__ */ t(c, { spacing: 3, children: [
13
- i && /* @__PURE__ */ t(s, { direction: "row", align: "center", justify: "between", children: [
14
- /* @__PURE__ */ r(e, { size: "lg", children: i }),
15
- o && /* @__PURE__ */ r(n, { variant: "text", icon: a, size: "sm", children: o })
16
- ] }),
17
- /* @__PURE__ */ r(p, { spacing: 3, children: m })
9
+ import { Section as n } from "../Page/Section.js";
10
+ const j = ({ title: o, description: i, children: m }) => /* @__PURE__ */ t(n, { spacing: 3, children: [
11
+ o && /* @__PURE__ */ r(s, { size: "lg", children: o }),
12
+ i && /* @__PURE__ */ r(p, { size: "sm", style: { marginBottom: ".5em" }, children: i }),
13
+ /* @__PURE__ */ r(e, { spacing: 3, children: m })
18
14
  ] });
19
15
  export {
20
- z as DialogListGroup
16
+ j as DialogListGroup
21
17
  };
@@ -13,6 +13,7 @@ declare const meta: {
13
13
  };
14
14
  export default meta;
15
15
  type Story = StoryObj<typeof meta>;
16
- export declare const Default: Story;
17
16
  export declare const GroupedByDate: Story;
18
- export declare const GroupedByRoute: Story;
17
+ export declare const SearchResults: Story;
18
+ export declare const SingleGroup: Story;
19
+ export declare const Ungrouped: Story;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface DialogListGroupProps {
3
- title?: string;
3
+ title?: string | ReactNode;
4
+ description?: string | ReactNode;
4
5
  children?: ReactNode;
5
- checkAllLabel?: string;
6
6
  }
7
- export declare const DialogListGroup: ({ title, children, checkAllLabel }: DialogListGroupProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DialogListGroup: ({ title, description, children }: DialogListGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -10,4 +10,6 @@ export default meta;
10
10
  export declare const Default: () => import("react/jsx-runtime").JSX.Element;
11
11
  export declare const WithContact: () => import("react/jsx-runtime").JSX.Element;
12
12
  export declare const PageNotFound: () => import("react/jsx-runtime").JSX.Element;
13
+ export declare const UnknownError: () => import("react/jsx-runtime").JSX.Element;
14
+ export declare const DownForMaintenance: () => import("react/jsx-runtime").JSX.Element;
13
15
  export declare const LoginError: () => 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.38.4",
3
+ "version": "0.38.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",