@altinn/altinn-components 0.10.4 → 0.11.0

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.
Files changed (102) hide show
  1. package/README.md +11 -1
  2. package/dist/assets/Breadcrumbs.css +1 -0
  3. package/dist/assets/BreadcrumbsLink.css +1 -0
  4. package/dist/assets/FieldBase.css +1 -0
  5. package/dist/assets/Flex.css +1 -0
  6. package/dist/assets/Grid.css +1 -0
  7. package/dist/assets/Heading.css +1 -1
  8. package/dist/assets/InputBase.css +1 -0
  9. package/dist/assets/ListItemBase.css +1 -1
  10. package/dist/assets/ListItemHeader.css +1 -1
  11. package/dist/assets/ListItemLabel.css +1 -1
  12. package/dist/assets/MenuItemMedia.css +1 -1
  13. package/dist/assets/QueryLabel.css +1 -1
  14. package/dist/assets/Section.css +1 -1
  15. package/dist/assets/Typography.css +1 -1
  16. package/dist/components/Autocomplete/AutocompleteItem.js +6 -6
  17. package/dist/components/Bookmarks/BookmarksListItem.js +66 -7
  18. package/dist/components/Bookmarks/BookmarksSection.js +36 -13
  19. package/dist/components/Bookmarks/QueryLabel.js +9 -9
  20. package/dist/components/Bookmarks/index.js +7 -9
  21. package/dist/components/Button/Button.js +16 -15
  22. package/dist/components/Button/IconButton.js +22 -10
  23. package/dist/components/Dialog/Dialog.js +2 -2
  24. package/dist/components/Dialog/DialogContent.js +6 -6
  25. package/dist/components/Dialog/DialogListGroup.js +7 -7
  26. package/dist/components/Dialog/DialogSection.js +1 -1
  27. package/dist/components/Dialog/DraftDialog.js +24 -24
  28. package/dist/components/Dropdown/DropdownBase.js +8 -7
  29. package/dist/components/Icon/iconsMap.js +16960 -739
  30. package/dist/components/List/ListItemBase.js +11 -11
  31. package/dist/components/List/ListItemControls.js +15 -15
  32. package/dist/components/List/ListItemHeader.js +49 -49
  33. package/dist/components/List/ListItemLabel.js +8 -8
  34. package/dist/components/Menu/MenuItemMedia.js +5 -5
  35. package/dist/components/Page/Article.js +4 -4
  36. package/dist/components/Page/Breadcrumbs.js +22 -0
  37. package/dist/components/Page/BreadcrumbsLink.js +28 -0
  38. package/dist/components/Page/Flex.js +42 -0
  39. package/dist/components/Page/Grid.js +34 -0
  40. package/dist/components/Page/PageHeader.js +10 -9
  41. package/dist/components/Page/PageNav.js +20 -17
  42. package/dist/components/Page/Section.js +11 -40
  43. package/dist/components/Page/index.js +18 -14
  44. package/dist/components/Searchbar/SearchField.js +38 -28
  45. package/dist/components/TextField/FieldBase.js +16 -0
  46. package/dist/components/TextField/InputBase.js +33 -0
  47. package/dist/components/TextField/TextField.js +7 -0
  48. package/dist/components/TextField/index.js +8 -0
  49. package/dist/components/Typography/Heading.js +3 -3
  50. package/dist/components/Typography/Typography.js +8 -9
  51. package/dist/components/index.js +266 -258
  52. package/dist/footer-BI7NNFeL.js +27 -0
  53. package/dist/globalMenu-A9dXKjrI.js +80 -0
  54. package/dist/header-B7oMg4iq.js +11 -0
  55. package/dist/inboxMenu-DXIoTtPz.js +48 -0
  56. package/dist/index.js +274 -266
  57. package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +16 -2
  58. package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +2 -3
  59. package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +10 -3
  60. package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +19 -3
  61. package/dist/types/lib/components/Bookmarks/index.d.ts +0 -1
  62. package/dist/types/lib/components/Button/Button.d.ts +2 -1
  63. package/dist/types/lib/components/Button/Button.stories.d.ts +1 -1
  64. package/dist/types/lib/components/Button/IconButton.d.ts +2 -1
  65. package/dist/types/lib/components/Button/IconButton.stories.d.ts +1 -1
  66. package/dist/types/lib/components/Layout/LayoutBase.d.ts +1 -1
  67. package/dist/types/lib/components/List/ListItemControls.d.ts +2 -1
  68. package/dist/types/lib/components/List/ListItemHeader.d.ts +2 -2
  69. package/dist/types/lib/components/Menu/MenuItemBase.d.ts +1 -1
  70. package/dist/types/lib/components/Page/Article.d.ts +1 -1
  71. package/dist/types/lib/components/Page/Breadcrumbs.d.ts +5 -0
  72. package/dist/types/lib/components/Page/BreadcrumbsLink.d.ts +11 -0
  73. package/dist/types/lib/components/Page/{PageBase.stories.d.ts → Examples.stories.d.ts} +2 -1
  74. package/dist/types/lib/components/Page/Flex.d.ts +29 -0
  75. package/dist/types/lib/components/Page/Grid.d.ts +22 -0
  76. package/dist/types/lib/components/Page/PageNav.d.ts +6 -3
  77. package/dist/types/lib/components/Page/PageNav.stories.d.ts +2 -1
  78. package/dist/types/lib/components/Page/Section.d.ts +6 -26
  79. package/dist/types/lib/components/Page/index.d.ts +4 -2
  80. package/dist/types/lib/components/Searchbar/Searchbar.stories.d.ts +6 -1
  81. package/dist/types/lib/components/TextField/FieldBase.d.ts +11 -0
  82. package/dist/types/lib/components/TextField/InputBase.d.ts +14 -0
  83. package/dist/types/lib/components/TextField/TextField.d.ts +7 -0
  84. package/dist/types/lib/components/TextField/index.d.ts +3 -0
  85. package/dist/types/lib/components/Typography/Heading.d.ts +2 -2
  86. package/dist/types/lib/components/Typography/Typography.d.ts +1 -1
  87. package/dist/types/lib/components/index.d.ts +1 -0
  88. package/dist/{useAccountMenu-ImwZYwks.js → useAccountMenu-DgXhBMw4.js} +19 -27
  89. package/package.json +7 -2
  90. package/dist/ZoomPlusFill-xyiiemTy.js +0 -17126
  91. package/dist/assets/ListItemMenu.css +0 -1
  92. package/dist/assets/SectionFooter.css +0 -1
  93. package/dist/components/Bookmarks/BookmarksList.js +0 -12
  94. package/dist/components/Icon/__AkselIcon.js +0 -1042
  95. package/dist/components/List/ListItemMenu.js +0 -8
  96. package/dist/components/Page/SectionFooter.js +0 -8
  97. package/dist/components/Page/SectionHeader.js +0 -12
  98. package/dist/types/lib/components/Bookmarks/BookmarksList.d.ts +0 -5
  99. package/dist/types/lib/components/Bookmarks/BookmarksList.stories.d.ts +0 -34
  100. package/dist/types/lib/components/List/ListItemMenu.d.ts +0 -8
  101. package/dist/types/lib/components/Page/SectionFooter.d.ts +0 -6
  102. package/dist/types/lib/components/Page/SectionHeader.d.ts +0 -6
@@ -1,56 +1,56 @@
1
1
  "use client";
2
- import { jsxs as q, jsx as i } from "react/jsx-runtime";
3
- import { c as h } from "../../index-L8X2o7IH.js";
4
- import { useRef as w } from "react";
5
- import { Icon as N } from "../Icon/Icon.js";
2
+ import { jsxs as k, jsx as i } from "react/jsx-runtime";
3
+ import { c as q } from "../../index-L8X2o7IH.js";
4
+ import { useRef as b } from "react";
5
+ import { Icon as w } from "../Icon/Icon.js";
6
6
  import "../Icon/SvgIcon.js";
7
7
  import { IconButton as l } from "../Button/IconButton.js";
8
- import '../../assets/SearchField.css';const b = "_field_1wjpq_1", g = "_icon_1wjpq_10", C = "_input_1wjpq_17", I = "_dismiss_1wjpq_41", K = "_clear_1wjpq_47", s = {
9
- field: b,
10
- icon: g,
11
- input: C,
12
- dismiss: I,
8
+ import '../../assets/SearchField.css';const I = "_field_1wjpq_1", N = "_icon_1wjpq_10", g = "_input_1wjpq_17", C = "_dismiss_1wjpq_41", K = "_clear_1wjpq_47", s = {
9
+ field: I,
10
+ icon: N,
11
+ input: g,
12
+ dismiss: C,
13
13
  clear: K
14
- }, O = ({
14
+ }, F = ({
15
15
  className: m,
16
- expanded: c,
16
+ expanded: a,
17
17
  name: p = "q",
18
18
  value: e,
19
19
  placeholder: u = "Søk",
20
- onFocus: f,
21
- onBlur: d,
20
+ onFocus: d,
21
+ onBlur: f,
22
22
  onChange: _,
23
23
  onClear: x,
24
24
  onClose: y,
25
- onEnter: a,
26
- tabIndex: j
25
+ onEnter: c,
26
+ tabIndex: h
27
27
  }) => {
28
- const o = w(null), k = (t) => {
28
+ const t = b(null), j = (o) => {
29
29
  var r, n;
30
- t.key === "Escape" && ((r = o.current) == null || r.blur()), t.key === "Enter" && ((n = o.current) == null || n.blur(), a == null || a());
30
+ o.key === "Escape" && ((r = t.current) == null || r.blur()), o.key === "Enter" && ((n = t.current) == null || n.blur(), c == null || c());
31
31
  };
32
- return /* @__PURE__ */ q("div", { className: h(s.field, m), "aria-expanded": c, children: [
32
+ return /* @__PURE__ */ k("div", { className: q(s.field, m), "aria-expanded": a, children: [
33
33
  /* @__PURE__ */ i(
34
34
  "input",
35
35
  {
36
- ref: o,
37
- onFocus: f,
38
- onBlur: d,
36
+ ref: t,
37
+ onFocus: d,
38
+ onBlur: f,
39
39
  name: p,
40
40
  value: e,
41
41
  onChange: _,
42
42
  placeholder: u,
43
43
  className: s.input,
44
- onKeyUp: k,
44
+ onKeyUp: j,
45
45
  type: "search",
46
46
  "aria-haspopup": !0,
47
47
  autoComplete: "off",
48
48
  "aria-autocomplete": "list",
49
- "aria-expanded": c,
50
- tabIndex: j ?? 0
49
+ "aria-expanded": a,
50
+ tabIndex: h ?? 0
51
51
  }
52
52
  ),
53
- /* @__PURE__ */ i(N, { name: "magnifying-glass", className: s.icon }),
53
+ /* @__PURE__ */ i(w, { name: "magnifying-glass", className: s.icon }),
54
54
  e && /* @__PURE__ */ i(
55
55
  l,
56
56
  {
@@ -59,11 +59,21 @@ import '../../assets/SearchField.css';const b = "_field_1wjpq_1", g = "_icon_1wj
59
59
  variant: "solid",
60
60
  size: "custom",
61
61
  className: s.clear,
62
- onClick: x
62
+ onClick: x,
63
+ dataTestId: "search-button-clear"
63
64
  }
64
- ) || c && /* @__PURE__ */ i(l, { icon: "x-mark", variant: "text", className: s.dismiss, onClick: y })
65
+ ) || a && /* @__PURE__ */ i(
66
+ l,
67
+ {
68
+ icon: "x-mark",
69
+ variant: "text",
70
+ className: s.dismiss,
71
+ onClick: y,
72
+ dataTestId: "search-button-close"
73
+ }
74
+ )
65
75
  ] });
66
76
  };
67
77
  export {
68
- O as SearchField
78
+ F as SearchField
69
79
  };
@@ -0,0 +1,16 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { c } from "../../index-L8X2o7IH.js";
3
+ import { Typography as m } from "../Typography/Typography.js";
4
+ import { Heading as p } from "../Typography/Heading.js";
5
+ import '../../assets/FieldBase.css';const d = "_field_5tnbv_1", x = "_label_5tnbv_7", _ = "_helperText_5tnbv_11", e = {
6
+ field: d,
7
+ label: x,
8
+ helperText: _
9
+ }, y = ({ as: o, size: n, classname: r, label: s, helperText: l, children: a }) => /* @__PURE__ */ i(o || "label", { className: c(e.field, r), "data-size": n, children: [
10
+ s && /* @__PURE__ */ t(p, { size: "xs", className: e.label, children: s }),
11
+ a,
12
+ l && /* @__PURE__ */ t(m, { className: e.helperText, size: "xs", children: l })
13
+ ] });
14
+ export {
15
+ y as FieldBase
16
+ };
@@ -0,0 +1,33 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { c as m } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/InputBase.css';const x = "_input_dxhtf_1", f = {
4
+ input: x
5
+ }, l = ({
6
+ type: t = "text",
7
+ name: s,
8
+ value: n,
9
+ placeholder: p,
10
+ onChange: i,
11
+ onFocus: o,
12
+ onBlur: e,
13
+ size: r,
14
+ className: u,
15
+ ...a
16
+ }) => /* @__PURE__ */ c(
17
+ "input",
18
+ {
19
+ className: m(f.input, u),
20
+ "data-size": r,
21
+ type: t,
22
+ name: s,
23
+ value: n,
24
+ placeholder: p,
25
+ onChange: i,
26
+ onFocus: o,
27
+ onBlur: e,
28
+ ...a
29
+ }
30
+ );
31
+ export {
32
+ l as InputBase
33
+ };
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { FieldBase as i } from "./FieldBase.js";
3
+ import { InputBase as p } from "./InputBase.js";
4
+ const l = ({ size: r = "md", label: t, helperText: e, ...m }) => /* @__PURE__ */ o(i, { size: r, label: t, helperText: e, children: /* @__PURE__ */ o(p, { ...m, size: r }) });
5
+ export {
6
+ l as TextField
7
+ };
@@ -0,0 +1,8 @@
1
+ import { FieldBase as r } from "./FieldBase.js";
2
+ import { InputBase as p } from "./InputBase.js";
3
+ import { TextField as f } from "./TextField.js";
4
+ export {
5
+ r as FieldBase,
6
+ p as InputBase,
7
+ f as TextField
8
+ };
@@ -1,8 +1,8 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { c as d } from "../../index-L8X2o7IH.js";
3
- import '../../assets/Heading.css';const o = "_heading_15ax1_1", m = {
4
- heading: o
5
- }, h = ({ as: a = "h2", size: e = "md", weight: t = "medium", className: s, children: i }) => /* @__PURE__ */ n(a, { className: d(m.heading, s), "data-size": e, "data-weight": t, children: i });
3
+ import '../../assets/Heading.css';const m = "_heading_mt0g8_1", o = {
4
+ heading: m
5
+ }, h = ({ as: t = "h2", size: a = "md", weight: e = "medium", className: s, children: i }) => /* @__PURE__ */ n(t, { className: d(o.heading, s), "data-size": a, "data-weight": e, children: i });
6
6
  export {
7
7
  h as Heading
8
8
  };
@@ -1,16 +1,15 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { c as s } from "../../index-L8X2o7IH.js";
3
- import '../../assets/Typography.css';const n = "_typography_19j8u_1", y = "_item_19j8u_7", i = {
4
- typography: n,
5
- item: y
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { c as e } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/Typography.css';const n = "_typography_15hc3_1", m = {
4
+ typography: n
6
5
  }, g = ({
7
6
  as: t = "div",
8
7
  size: o = "md",
9
8
  theme: p = "inherit",
10
- className: e,
11
- children: r,
12
- ...a
13
- }) => /* @__PURE__ */ m(t, { className: s(i.typography, e), "data-size": o, "data-theme": p, ...a, children: r });
9
+ className: r,
10
+ children: a,
11
+ ...s
12
+ }) => /* @__PURE__ */ y(t, { className: e(m.typography, r), "data-size": o, "data-theme": p, ...s, children: a });
14
13
  export {
15
14
  g as Typography
16
15
  };