@altinn/altinn-components 0.10.4 → 0.12.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 (168) 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/SnackbarBase.css +1 -1
  16. package/dist/assets/SnackbarItem.css +1 -0
  17. package/dist/assets/Typography.css +1 -1
  18. package/dist/components/AccessAreaList/AccessAreaList.js +6 -5
  19. package/dist/components/AccessAreaList/AccessAreaListItem.js +13 -12
  20. package/dist/components/AccessPackageList/AccessPackageList.js +5 -4
  21. package/dist/components/AccessPackageList/AccessPackageListItem.js +6 -5
  22. package/dist/components/Autocomplete/AutocompleteItem.js +13 -12
  23. package/dist/components/Autocomplete/ScopeListItem.js +3 -2
  24. package/dist/components/Bookmarks/BookmarksListItem.js +69 -7
  25. package/dist/components/Bookmarks/BookmarksSection.js +33 -13
  26. package/dist/components/Bookmarks/QueryLabel.js +9 -9
  27. package/dist/components/Bookmarks/index.js +7 -9
  28. package/dist/components/Button/Button.js +16 -15
  29. package/dist/components/Button/IconButton.js +22 -10
  30. package/dist/components/Byline/Byline.js +4 -3
  31. package/dist/components/ContextMenu/ContextMenu.js +11 -10
  32. package/dist/components/Dialog/Dialog.js +16 -15
  33. package/dist/components/Dialog/DialogActions.js +3 -2
  34. package/dist/components/Dialog/DialogByline.js +5 -4
  35. package/dist/components/Dialog/DialogContent.js +8 -7
  36. package/dist/components/Dialog/DialogHeading.js +8 -7
  37. package/dist/components/Dialog/DialogHistory.js +6 -5
  38. package/dist/components/Dialog/DialogHistoryDetails.js +11 -10
  39. package/dist/components/Dialog/DialogHistoryItem.js +6 -5
  40. package/dist/components/Dialog/DialogList.js +3 -2
  41. package/dist/components/Dialog/DialogListGroup.js +8 -7
  42. package/dist/components/Dialog/DialogListItem.js +19 -18
  43. package/dist/components/Dialog/DialogMetadata.js +10 -9
  44. package/dist/components/Dialog/DialogSection.js +5 -4
  45. package/dist/components/Dialog/DialogTimeline.js +7 -6
  46. package/dist/components/Dialog/DialogTimelineItem.js +3 -2
  47. package/dist/components/Dialog/DialogTransmissions.js +3 -2
  48. package/dist/components/Dialog/DraftDialog.js +19 -18
  49. package/dist/components/Dropdown/DrawerButton.js +3 -2
  50. package/dist/components/Dropdown/DrawerOrDropdown.js +3 -2
  51. package/dist/components/Dropdown/DropdownBase.js +8 -7
  52. package/dist/components/GlobalMenu/AccountButton.js +3 -2
  53. package/dist/components/GlobalMenu/AccountMenu.js +12 -11
  54. package/dist/components/GlobalMenu/BackButton.js +3 -2
  55. package/dist/components/GlobalMenu/GlobalMenu.js +21 -20
  56. package/dist/components/Header/Header.js +3 -2
  57. package/dist/components/Header/HeaderBase.js +4 -3
  58. package/dist/components/Icon/iconsMap.js +16960 -739
  59. package/dist/components/Layout/Layout.js +7 -6
  60. package/dist/components/LayoutAction/ActionMenu.js +4 -3
  61. package/dist/components/List/List.js +5 -4
  62. package/dist/components/List/ListItemBase.js +11 -11
  63. package/dist/components/List/ListItemControls.js +15 -15
  64. package/dist/components/List/ListItemHeader.js +49 -49
  65. package/dist/components/List/ListItemLabel.js +8 -8
  66. package/dist/components/Menu/MenuItemMedia.js +5 -5
  67. package/dist/components/Menu/MenuItems.js +1 -0
  68. package/dist/components/Menu/MenuSearch.js +5 -4
  69. package/dist/components/Page/Article.js +4 -4
  70. package/dist/components/Page/Breadcrumbs.js +23 -0
  71. package/dist/components/Page/BreadcrumbsLink.js +28 -0
  72. package/dist/components/Page/Flex.js +42 -0
  73. package/dist/components/Page/Grid.js +34 -0
  74. package/dist/components/Page/PageHeader.js +11 -9
  75. package/dist/components/Page/PageNav.js +21 -17
  76. package/dist/components/Page/Section.js +12 -40
  77. package/dist/components/Page/index.js +18 -14
  78. package/dist/components/ResourceList/ResourceList.js +3 -2
  79. package/dist/components/ResourceList/ResourceListItem.js +3 -2
  80. package/dist/components/RootProvider/RootProvider.js +13 -12
  81. package/dist/components/Searchbar/SearchField.js +38 -28
  82. package/dist/components/Searchbar/Searchbar.js +3 -2
  83. package/dist/components/Snackbar/Snackbar.js +17 -8
  84. package/dist/components/Snackbar/SnackbarBase.js +5 -21
  85. package/dist/components/Snackbar/SnackbarItem.js +32 -0
  86. package/dist/components/Snackbar/index.js +2 -6
  87. package/dist/components/Snackbar/useSnackbar.js +47 -0
  88. package/dist/components/TextField/FieldBase.js +16 -0
  89. package/dist/components/TextField/InputBase.js +33 -0
  90. package/dist/components/TextField/TextField.js +7 -0
  91. package/dist/components/TextField/index.js +8 -0
  92. package/dist/components/Timeline/TimelineSection.js +3 -2
  93. package/dist/components/Toolbar/ToolbarAccountMenu.js +5 -4
  94. package/dist/components/Toolbar/ToolbarAdd.js +6 -5
  95. package/dist/components/Toolbar/ToolbarDaterange.js +11 -10
  96. package/dist/components/Toolbar/ToolbarFilter.js +12 -11
  97. package/dist/components/Toolbar/ToolbarMenu.js +3 -2
  98. package/dist/components/Toolbar/ToolbarOptions.js +10 -9
  99. package/dist/components/Toolbar/ToolbarSearch.js +5 -4
  100. package/dist/components/Transmission/TransmissionItem.js +3 -2
  101. package/dist/components/Transmission/TransmissionList.js +3 -2
  102. package/dist/components/Typography/Heading.js +3 -3
  103. package/dist/components/Typography/Typography.js +8 -9
  104. package/dist/components/index.js +270 -266
  105. package/dist/footer-BI7NNFeL.js +27 -0
  106. package/dist/globalMenu-A9dXKjrI.js +80 -0
  107. package/dist/header-B7oMg4iq.js +11 -0
  108. package/dist/inboxMenu-DXIoTtPz.js +48 -0
  109. package/dist/index.js +264 -260
  110. package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +18 -2
  111. package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +2 -4
  112. package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +8 -3
  113. package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +42 -3
  114. package/dist/types/lib/components/Bookmarks/index.d.ts +0 -1
  115. package/dist/types/lib/components/Button/Button.d.ts +2 -1
  116. package/dist/types/lib/components/Button/Button.stories.d.ts +1 -1
  117. package/dist/types/lib/components/Button/IconButton.d.ts +2 -1
  118. package/dist/types/lib/components/Button/IconButton.stories.d.ts +1 -1
  119. package/dist/types/lib/components/Layout/LayoutBase.d.ts +1 -1
  120. package/dist/types/lib/components/LayoutAction/ActionFooter.stories.d.ts +0 -2
  121. package/dist/types/lib/components/List/ListItemControls.d.ts +2 -1
  122. package/dist/types/lib/components/List/ListItemHeader.d.ts +2 -2
  123. package/dist/types/lib/components/Menu/MenuItemBase.d.ts +1 -1
  124. package/dist/types/lib/components/Page/Article.d.ts +1 -1
  125. package/dist/types/lib/components/Page/Breadcrumbs.d.ts +5 -0
  126. package/dist/types/lib/components/Page/BreadcrumbsLink.d.ts +11 -0
  127. package/dist/types/lib/components/Page/{PageBase.stories.d.ts → Examples.stories.d.ts} +2 -1
  128. package/dist/types/lib/components/Page/Flex.d.ts +29 -0
  129. package/dist/types/lib/components/Page/Grid.d.ts +22 -0
  130. package/dist/types/lib/components/Page/PageNav.d.ts +6 -3
  131. package/dist/types/lib/components/Page/PageNav.stories.d.ts +2 -1
  132. package/dist/types/lib/components/Page/Section.d.ts +6 -26
  133. package/dist/types/lib/components/Page/index.d.ts +4 -2
  134. package/dist/types/lib/components/Searchbar/Searchbar.stories.d.ts +6 -1
  135. package/dist/types/lib/components/Snackbar/Snackbar.d.ts +1 -16
  136. package/dist/types/lib/components/Snackbar/Snackbar.stories.d.ts +3 -8
  137. package/dist/types/lib/components/Snackbar/SnackbarBase.d.ts +6 -11
  138. package/dist/types/lib/components/Snackbar/SnackbarItem.d.ts +16 -0
  139. package/dist/types/lib/components/Snackbar/index.d.ts +2 -4
  140. package/dist/types/lib/components/Snackbar/useSnackbar.d.ts +39 -0
  141. package/dist/types/lib/components/TextField/FieldBase.d.ts +11 -0
  142. package/dist/types/lib/components/TextField/InputBase.d.ts +14 -0
  143. package/dist/types/lib/components/TextField/TextField.d.ts +7 -0
  144. package/dist/types/lib/components/TextField/index.d.ts +3 -0
  145. package/dist/types/lib/components/Typography/Heading.d.ts +2 -2
  146. package/dist/types/lib/components/Typography/Typography.d.ts +1 -1
  147. package/dist/types/lib/components/index.d.ts +1 -0
  148. package/dist/{useAccountMenu-ImwZYwks.js → useAccountMenu-DgXhBMw4.js} +19 -27
  149. package/package.json +7 -2
  150. package/dist/ZoomPlusFill-xyiiemTy.js +0 -17126
  151. package/dist/assets/ListItemMenu.css +0 -1
  152. package/dist/assets/SectionFooter.css +0 -1
  153. package/dist/assets/SnackbarLabel.css +0 -1
  154. package/dist/assets/SnackbarMedia.css +0 -1
  155. package/dist/components/Bookmarks/BookmarksList.js +0 -12
  156. package/dist/components/Icon/__AkselIcon.js +0 -1042
  157. package/dist/components/List/ListItemMenu.js +0 -8
  158. package/dist/components/Page/SectionFooter.js +0 -8
  159. package/dist/components/Page/SectionHeader.js +0 -12
  160. package/dist/components/Snackbar/SnackbarLabel.js +0 -7
  161. package/dist/components/Snackbar/SnackbarMedia.js +0 -11
  162. package/dist/types/lib/components/Bookmarks/BookmarksList.d.ts +0 -5
  163. package/dist/types/lib/components/Bookmarks/BookmarksList.stories.d.ts +0 -34
  164. package/dist/types/lib/components/List/ListItemMenu.d.ts +0 -8
  165. package/dist/types/lib/components/Page/SectionFooter.d.ts +0 -6
  166. package/dist/types/lib/components/Page/SectionHeader.d.ts +0 -6
  167. package/dist/types/lib/components/Snackbar/SnackbarLabel.d.ts +0 -5
  168. package/dist/types/lib/components/Snackbar/SnackbarMedia.d.ts +0 -6
@@ -1,42 +1,14 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { c as h } from "../../index-L8X2o7IH.js";
3
- import '../../assets/Section.css';const _ = "_section_1qkfl_1", j = {
4
- section: _
5
- }, k = ({
6
- as: a = "section",
7
- theme: t = "inherit",
8
- color: n = "transparent",
9
- flex: e = "col",
10
- reverse: o = !1,
11
- align: s = "initial",
12
- justify: i = "initial",
13
- padding: c = "none",
14
- spacing: d = "none",
15
- margin: r = "none",
16
- shadow: l = "none",
17
- inset: m = !1,
18
- className: p,
19
- style: f,
20
- children: g
21
- }) => /* @__PURE__ */ x(
22
- a,
23
- {
24
- className: h(j.section, p),
25
- style: f,
26
- "data-flex": e,
27
- "data-reverse": o,
28
- "data-align": s,
29
- "data-justify": i,
30
- "data-theme": t,
31
- "data-color": n,
32
- "data-inset": m,
33
- "data-padding": c,
34
- "data-spacing": d,
35
- "data-margin": r,
36
- "data-shadow": l,
37
- children: g
38
- }
39
- );
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { c as e } from "../../index-L8X2o7IH.js";
3
+ import "../Icon/SvgIcon.js";
4
+ import "react";
5
+ import "../Autocomplete/AutocompleteBase.js";
6
+ import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
8
+ import { Flex as n } from "./Flex.js";
9
+ import '../../assets/Section.css';const p = "_section_167jj_1", a = {
10
+ section: p
11
+ }, h = ({ as: o = "section", className: t, bg: s, shadow: i, children: r, ...c }) => /* @__PURE__ */ m(n, { as: o, "data-bg": s, "data-shadow": i, className: e(a.section, t), ...c, children: r });
40
12
  export {
41
- k as Section
13
+ h as Section
42
14
  };
@@ -1,16 +1,20 @@
1
- import { PageBase as r } from "./PageBase.js";
2
- import { PageNav as a } from "./PageNav.js";
3
- import { PageHeader as m } from "./PageHeader.js";
4
- import { SectionHeader as x } from "./SectionHeader.js";
5
- import { SectionFooter as i } from "./SectionFooter.js";
6
- import { Article as n } from "./Article.js";
7
- import { Section as S } from "./Section.js";
1
+ import { PageBase as o } from "./PageBase.js";
2
+ import { PageNav as t } from "./PageNav.js";
3
+ import { PageHeader as f } from "./PageHeader.js";
4
+ import { Article as a } from "./Article.js";
5
+ import { Section as d } from "./Section.js";
6
+ import { Flex as g } from "./Flex.js";
7
+ import { Grid as B } from "./Grid.js";
8
+ import { Breadcrumbs as b } from "./Breadcrumbs.js";
9
+ import { BreadcrumbsLink as n } from "./BreadcrumbsLink.js";
8
10
  export {
9
- n as Article,
10
- r as PageBase,
11
- m as PageHeader,
12
- a as PageNav,
13
- S as Section,
14
- i as SectionFooter,
15
- x as SectionHeader
11
+ a as Article,
12
+ b as Breadcrumbs,
13
+ n as BreadcrumbsLink,
14
+ g as Flex,
15
+ B as Grid,
16
+ o as PageBase,
17
+ f as PageHeader,
18
+ t as PageNav,
19
+ d as Section
16
20
  };
@@ -4,9 +4,10 @@ import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
5
  import "../Autocomplete/AutocompleteBase.js";
6
6
  import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
7
8
  import { ResourceListItem as p } from "./ResourceListItem.js";
8
9
  import { ListBase as s } from "../List/ListBase.js";
9
- const x = ({ items: o, defaultItemSize: t = "md", ...m }) => /* @__PURE__ */ e(s, { ...m, children: o.map((r) => /* @__PURE__ */ i(p, { ...r, key: r.id, size: t })) });
10
+ const R = ({ items: o, defaultItemSize: t = "md", ...m }) => /* @__PURE__ */ e(s, { ...m, children: o.map((r) => /* @__PURE__ */ i(p, { ...r, key: r.id, size: t })) });
10
11
  export {
11
- x as ResourceList
12
+ R as ResourceList
12
13
  };
@@ -4,8 +4,9 @@ import "react";
4
4
  import "../Icon/SvgIcon.js";
5
5
  import "../Autocomplete/AutocompleteBase.js";
6
6
  import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
7
8
  import { ListItem as e } from "../List/ListItem.js";
8
- const u = ({
9
+ const x = ({
9
10
  ownerName: t,
10
11
  resourceName: r,
11
12
  ownerLogoUrlAlt: i,
@@ -26,5 +27,5 @@ const u = ({
26
27
  }
27
28
  );
28
29
  export {
29
- u as ResourceListItem
30
+ x as ResourceListItem
30
31
  };
@@ -1,33 +1,34 @@
1
1
  "use client";
2
2
  import { jsx as c } from "react/jsx-runtime";
3
- import { createContext as u, useContext as d, useState as I } from "react";
4
- import { useEscapeKey as p } from "../../hooks/useEscapeKey.js";
3
+ import { createContext as d, useContext as u, useState as p } from "react";
4
+ import { useEscapeKey as I } from "../../hooks/useEscapeKey.js";
5
+ import { SnackbarProvider as m } from "../Snackbar/useSnackbar.js";
5
6
  const x = {
6
7
  currentId: ""
7
- }, s = u(x), R = ({ children: o, initialValue: t }) => {
8
- const [n, e] = I((t == null ? void 0 : t.currentId) || "");
8
+ }, s = d(x), R = ({ children: o, initialValue: t }) => {
9
+ const [n, r] = p((t == null ? void 0 : t.currentId) || "");
9
10
  return /* @__PURE__ */ c(
10
11
  s.Provider,
11
12
  {
12
13
  value: {
13
14
  currentId: n,
14
- setCurrentId: e
15
+ setCurrentId: r
15
16
  },
16
- children: o
17
+ children: /* @__PURE__ */ c(m, { children: o })
17
18
  }
18
19
  );
19
- }, g = () => {
20
- const { currentId: o, setCurrentId: t } = d(s), n = (r) => t(o === r ? "" : r), e = () => {
20
+ }, a = () => {
21
+ const { currentId: o, setCurrentId: t } = u(s), n = (e) => t(o === e ? "" : e), r = () => {
21
22
  t("");
22
23
  };
23
- return p(e), {
24
+ return I(r), {
24
25
  currentId: o,
25
26
  toggleId: n,
26
- closeAll: e,
27
- openId: (r) => t(r)
27
+ closeAll: r,
28
+ openId: (e) => t(e)
28
29
  };
29
30
  };
30
31
  export {
31
32
  R as RootProvider,
32
- g as useRootContext
33
+ a as useRootContext
33
34
  };
@@ -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
  };
@@ -4,9 +4,10 @@ import "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../Icon/SvgIcon.js";
6
6
  import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
7
8
  import { SearchField as s } from "./SearchField.js";
8
9
  import { SearchbarBase as a } from "./SearchbarBase.js";
9
- const A = ({
10
+ const B = ({
10
11
  className: i,
11
12
  autocomplete: r,
12
13
  expanded: o = !1,
@@ -18,5 +19,5 @@ const A = ({
18
19
  r && /* @__PURE__ */ t(f, { ...r, expanded: o, onSelect: m })
19
20
  ] });
20
21
  export {
21
- A as Searchbar
22
+ B as Searchbar
22
23
  };
@@ -1,11 +1,20 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
1
+ "use client";
2
+ import { jsx as s } from "react/jsx-runtime";
2
3
  import { SnackbarBase as i } from "./SnackbarBase.js";
3
- import { SnackbarLabel as t } from "./SnackbarLabel.js";
4
- import { SnackbarMedia as b } from "./SnackbarMedia.js";
5
- const S = ({ as: a = "a", color: o, message: m, icon: n, ...c }) => /* @__PURE__ */ e(i, { as: a, color: o, ...c, children: [
6
- /* @__PURE__ */ r(b, { icon: n }),
7
- /* @__PURE__ */ r(t, { children: m })
8
- ] });
4
+ import { SnackbarItem as m } from "./SnackbarItem.js";
5
+ import { useSnackbar as c } from "./useSnackbar.js";
6
+ const d = ({ className: a }) => {
7
+ const { storedMessages: o, open: e, closeSnackbarItem: n } = c();
8
+ return e ? /* @__PURE__ */ s(i, { className: a, children: (o || []).map((r) => /* @__PURE__ */ s(
9
+ m,
10
+ {
11
+ onDismiss: () => n(r.id),
12
+ dismissable: r.dismissable,
13
+ ...r
14
+ },
15
+ r.id
16
+ )) }) : null;
17
+ };
9
18
  export {
10
- S as Snackbar
19
+ d as Snackbar
11
20
  };
@@ -1,23 +1,7 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import { c as l } from "../../index-L8X2o7IH.js";
3
- import "../Icon/SvgIcon.js";
4
- import { IconButton as d } from "../Button/IconButton.js";
5
- import '../../assets/SnackbarBase.css';const _ = "_item_1dlhj_1", p = "_content_1dlhj_26", x = "_action_1dlhj_34", t = {
6
- item: _,
7
- content: p,
8
- action: x
9
- }, k = ({
10
- as: n,
11
- children: c,
12
- className: s,
13
- color: e,
14
- dismissable: i = !0,
15
- onDismiss: a,
16
- ...m
17
- }) => /* @__PURE__ */ r(n || "div", { className: l(t.item, s), "data-color": e, ...m, children: [
18
- /* @__PURE__ */ o("div", { className: t.content, children: c }),
19
- i && /* @__PURE__ */ o("div", { className: t.action, children: /* @__PURE__ */ o(d, { icon: "x-mark", variant: "text", onClick: a, className: t.dismiss }) })
20
- ] });
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import '../../assets/SnackbarBase.css';const a = "_stack_1lu9j_1", c = {
3
+ stack: a
4
+ }, o = ({ children: s }) => /* @__PURE__ */ t("section", { role: "alert", className: c.stack, children: s });
21
5
  export {
22
- k as SnackbarBase
6
+ o as SnackbarBase
23
7
  };
@@ -0,0 +1,32 @@
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { c as d } from "../../index-L8X2o7IH.js";
3
+ import { Icon as _ } from "../Icon/Icon.js";
4
+ import "../Icon/SvgIcon.js";
5
+ import "react";
6
+ import "../Autocomplete/AutocompleteBase.js";
7
+ import { IconButton as p } from "../Button/IconButton.js";
8
+ import "../RootProvider/RootProvider.js";
9
+ import "./useSnackbar.js";
10
+ import '../../assets/SnackbarItem.css';const j = "_item_1jw8i_1", v = "_media_1jw8i_23", x = "_icon_1jw8i_32", N = "_content_1jw8i_36", w = "_action_1jw8i_44", t = {
11
+ item: j,
12
+ media: v,
13
+ icon: x,
14
+ content: N,
15
+ action: w
16
+ }, g = ({
17
+ as: i,
18
+ message: n,
19
+ className: c,
20
+ color: m,
21
+ icon: e = "bell",
22
+ dismissable: a = !0,
23
+ onDismiss: s,
24
+ ...r
25
+ }) => /* @__PURE__ */ l(i || "div", { className: d(t.item, c), "data-color": m, ...r, children: [
26
+ /* @__PURE__ */ o("div", { className: t.media, children: /* @__PURE__ */ o(_, { name: e, variant: "solid", className: t.icon }) }),
27
+ /* @__PURE__ */ o("div", { className: t.content, children: n }),
28
+ a && /* @__PURE__ */ o("div", { className: t.action, children: /* @__PURE__ */ o(p, { icon: "x-mark", variant: "text", onClick: s, className: t.dismiss }) })
29
+ ] });
30
+ export {
31
+ g as SnackbarItem
32
+ };
@@ -1,10 +1,6 @@
1
1
  import { Snackbar as o } from "./Snackbar.js";
2
- import { SnackbarBase as b } from "./SnackbarBase.js";
3
- import { SnackbarMedia as f } from "./SnackbarMedia.js";
4
- import { SnackbarLabel as m } from "./SnackbarLabel.js";
2
+ import { SnackbarItem as m } from "./SnackbarItem.js";
5
3
  export {
6
4
  o as Snackbar,
7
- b as SnackbarBase,
8
- m as SnackbarLabel,
9
- f as SnackbarMedia
5
+ m as SnackbarItem
10
6
  };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx as h } from "react/jsx-runtime";
3
+ import { createContext as x, useState as d, useRef as b, useCallback as v, useEffect as C, useContext as S } from "react";
4
+ var T = /* @__PURE__ */ ((e) => (e[e.infinite = 0] = "infinite", e[e.short = 1e3] = "short", e[e.normal = 3e3] = "normal", e[e.long = 5e3] = "long", e))(T || {});
5
+ const a = x(void 0), l = 3e3, P = ({ children: e }) => {
6
+ const [f, o] = d(!1), [i, c] = d([]), s = b(null), m = () => {
7
+ c([]), o(!1), s.current && clearTimeout(s.current);
8
+ }, g = (t) => {
9
+ const n = btoa(String(Math.random())).substring(0, 12);
10
+ return c((r) => [...r, { ...t, id: n }]), o(!0), n;
11
+ }, u = v((t) => {
12
+ c((n) => {
13
+ const r = n.filter((p) => p.id !== t);
14
+ return o(r.length > 0), r;
15
+ });
16
+ }, []);
17
+ return C(() => {
18
+ const t = i.find((r) => (r.duration ?? l) > 0), n = (t == null ? void 0 : t.duration) || l;
19
+ return t && (s.current = setTimeout(() => {
20
+ u(t.id);
21
+ }, n)), () => {
22
+ s.current && clearTimeout(s.current);
23
+ };
24
+ }, [i, u]), /* @__PURE__ */ h(
25
+ a.Provider,
26
+ {
27
+ value: {
28
+ open: f,
29
+ storedMessages: i,
30
+ openSnackbar: g,
31
+ closeSnackbarItem: u,
32
+ dismissSnackbar: m
33
+ },
34
+ children: e
35
+ }
36
+ );
37
+ }, k = () => {
38
+ const e = S(a);
39
+ if (!e)
40
+ throw new Error("useSnackbar must be used within a SnackbarProvider");
41
+ return e;
42
+ };
43
+ export {
44
+ T as SnackbarDuration,
45
+ P as SnackbarProvider,
46
+ k as useSnackbar
47
+ };
@@ -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
+ };
@@ -6,6 +6,7 @@ import "../Autocomplete/AutocompleteBase.js";
6
6
  import { Avatar as _ } from "../Avatar/Avatar.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import { Byline as p } from "../Byline/Byline.js";
9
+ import "../Snackbar/useSnackbar.js";
9
10
  import '../../assets/TimelineSection.css';const u = "_section_1nusr_1", h = "_sidebar_1nusr_6", l = "_media_1nusr_19", N = "_dot_1nusr_26", v = "_border_1nusr_37", x = "_content_1nusr_52", o = {
10
11
  section: u,
11
12
  sidebar: h,
@@ -13,7 +14,7 @@ import '../../assets/TimelineSection.css';const u = "_section_1nusr_1", h = "_si
13
14
  dot: N,
14
15
  border: v,
15
16
  content: x
16
- }, k = ({
17
+ }, q = ({
17
18
  loading: e,
18
19
  size: s = "xs",
19
20
  seen: c = !0,
@@ -36,5 +37,5 @@ import '../../assets/TimelineSection.css';const u = "_section_1nusr_1", h = "_si
36
37
  ] })
37
38
  ] });
38
39
  export {
39
- k as TimelineSection
40
+ q as TimelineSection
40
41
  };
@@ -8,13 +8,14 @@ import { useRootContext as d } from "../RootProvider/RootProvider.js";
8
8
  import { ToolbarFilterBase as f } from "./ToolbarFilterBase.js";
9
9
  import { DrawerOrDropdown as x } from "../Dropdown/DrawerOrDropdown.js";
10
10
  import { AccountMenu as T } from "../GlobalMenu/AccountMenu.js";
11
- const k = ({ currentAccount: o, id: t = "toolbar-accounts", ...m }) => {
12
- const { currentId: i, toggleId: l, closeAll: p } = d(), s = () => l(t), e = i === t;
11
+ import "../Snackbar/useSnackbar.js";
12
+ const v = ({ currentAccount: o, id: t = "toolbar-accounts", ...m }) => {
13
+ const { currentId: i, toggleId: p, closeAll: l } = d(), s = () => p(t), e = i === t;
13
14
  return /* @__PURE__ */ n(f, { expanded: e, children: [
14
15
  /* @__PURE__ */ r(a, { type: "switch", onToggle: s, active: !!o, children: o == null ? void 0 : o.name }),
15
- /* @__PURE__ */ r(x, { open: e, drawerTitle: "Endre konto", onClose: p, children: /* @__PURE__ */ r(T, { ...m, currentAccount: o }) })
16
+ /* @__PURE__ */ r(x, { open: e, drawerTitle: "Endre konto", onClose: l, children: /* @__PURE__ */ r(T, { ...m, currentAccount: o }) })
16
17
  ] });
17
18
  };
18
19
  export {
19
- k as ToolbarAccountMenu
20
+ v as ToolbarAccountMenu
20
21
  };
@@ -8,13 +8,14 @@ import { ToolbarButton as s } from "./ToolbarButton.js";
8
8
  import { useRootContext as c } from "../RootProvider/RootProvider.js";
9
9
  import { ToolbarFilterBase as g } from "./ToolbarFilterBase.js";
10
10
  import { DrawerOrDropdown as a } from "../Dropdown/DrawerOrDropdown.js";
11
- const D = ({ label: r = "Legg til", items: n, id: t }) => {
12
- const { closeAll: m, currentId: l, toggleId: i } = c(), e = l === t;
11
+ import "../Snackbar/useSnackbar.js";
12
+ const I = ({ label: r = "Legg til", items: m, id: t }) => {
13
+ const { closeAll: n, currentId: i, toggleId: l } = c(), e = i === t;
13
14
  return /* @__PURE__ */ p(g, { expanded: e, children: [
14
- /* @__PURE__ */ o(s, { type: "add", onToggle: () => i(t), children: r }),
15
- /* @__PURE__ */ o(a, { drawerTitle: r, onClose: m, open: e, children: /* @__PURE__ */ o(d, { theme: "global", items: n }) })
15
+ /* @__PURE__ */ o(s, { type: "add", onToggle: () => l(t), children: r }),
16
+ /* @__PURE__ */ o(a, { drawerTitle: r, onClose: n, open: e, children: /* @__PURE__ */ o(d, { theme: "global", items: m }) })
16
17
  ] });
17
18
  };
18
19
  export {
19
- D as ToolbarAdd
20
+ I as ToolbarAdd
20
21
  };
@@ -9,12 +9,13 @@ import { ToolbarButton as x } from "./ToolbarButton.js";
9
9
  import { useRootContext as S } from "../RootProvider/RootProvider.js";
10
10
  import { ToolbarFilterBase as w } from "./ToolbarFilterBase.js";
11
11
  import { DrawerOrDropdown as y } from "../Dropdown/DrawerOrDropdown.js";
12
+ import "../Snackbar/useSnackbar.js";
12
13
  import { Datepicker as q } from "../Datepicker/Datepicker.js";
13
- import '../../assets/ToolbarDaterange.css';const B = "_datepicker_mqb1p_1", I = "_fields_mqb1p_6", N = "_description_mqb1p_10", i = {
14
+ import '../../assets/ToolbarDaterange.css';const B = "_datepicker_mqb1p_1", I = "_fields_mqb1p_6", N = "_description_mqb1p_10", s = {
14
15
  datepicker: B,
15
16
  fields: I,
16
17
  description: N
17
- }, P = ({
18
+ }, Q = ({
18
19
  id: c = "toolbar-filter-datetange",
19
20
  title: f = "Select daterange",
20
21
  description: g = "Choose dates or click to set daterange.",
@@ -23,17 +24,17 @@ import '../../assets/ToolbarDaterange.css';const B = "_datepicker_mqb1p_1", I =
23
24
  label: u = "Select daterange",
24
25
  value: b
25
26
  }) => {
26
- const { currentId: T, toggleId: _ } = S(), l = () => _(c), m = T === c, [t, r] = p(""), [s, a] = p(""), k = (e) => {
27
+ const { currentId: T, toggleId: _ } = S(), l = () => _(c), m = T === c, [t, r] = p(""), [i, a] = p(""), k = (e) => {
27
28
  r(e.target.value);
28
29
  }, C = (e) => {
29
30
  a(e.target.value);
30
31
  }, v = (e) => {
31
- s ? (r(e), a("")) : t && e < t ? (a(t), r(e)) : t ? a(e) : r(e);
32
+ i ? (r(e), a("")) : t && e < t ? (a(t), r(e)) : t ? a(e) : r(e);
32
33
  };
33
34
  return /* @__PURE__ */ n(w, { expanded: m, children: [
34
35
  /* @__PURE__ */ o(x, { type: "switch", onToggle: l, active: !!b, children: u }),
35
36
  /* @__PURE__ */ o(y, { open: m, drawerTitle: f, onClose: l, children: /* @__PURE__ */ n(F, { children: [
36
- /* @__PURE__ */ n("div", { className: i.fields, children: [
37
+ /* @__PURE__ */ n("div", { className: s.fields, children: [
37
38
  /* @__PURE__ */ o(
38
39
  d,
39
40
  {
@@ -44,15 +45,15 @@ import '../../assets/ToolbarDaterange.css';const B = "_datepicker_mqb1p_1", I =
44
45
  onChange: k
45
46
  }
46
47
  ),
47
- /* @__PURE__ */ o(d, { name: "toDate", value: s, type: "date", label: D, onChange: C })
48
+ /* @__PURE__ */ o(d, { name: "toDate", value: i, type: "date", label: D, onChange: C })
48
49
  ] }),
49
- /* @__PURE__ */ n("section", { className: i.datepicker, children: [
50
- /* @__PURE__ */ o(q, { onSelect: v, selectFrom: t, selectTo: s }),
51
- /* @__PURE__ */ o("p", { className: i.description, children: g })
50
+ /* @__PURE__ */ n("section", { className: s.datepicker, children: [
51
+ /* @__PURE__ */ o(q, { onSelect: v, selectFrom: t, selectTo: i }),
52
+ /* @__PURE__ */ o("p", { className: s.description, children: g })
52
53
  ] })
53
54
  ] }) })
54
55
  ] });
55
56
  };
56
57
  export {
57
- P as ToolbarDaterange
58
+ Q as ToolbarDaterange
58
59
  };