@altinn/altinn-components 0.37.0 → 0.38.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.
Files changed (68) hide show
  1. package/dist/assets/Byline.css +1 -1
  2. package/dist/assets/DrawerOrDropdown.css +1 -1
  3. package/dist/assets/FloatingActionButton.css +1 -0
  4. package/dist/assets/Header.css +1 -1
  5. package/dist/assets/ListItemLabel.css +1 -1
  6. package/dist/assets/MenuItemBase.css +1 -1
  7. package/dist/assets/MenuItemLabel.css +1 -1
  8. package/dist/assets/ModalBase.css +1 -1
  9. package/dist/components/Account/AccountMenu.js +39 -35
  10. package/dist/components/Button/FloatingActionButton.js +36 -0
  11. package/dist/components/Button/IconButton.js +9 -7
  12. package/dist/components/Button/index.js +6 -4
  13. package/dist/components/Byline/Byline.js +18 -18
  14. package/dist/components/ContextMenu/ContextMenu.js +58 -43
  15. package/dist/components/Dialog/DialogListItem.js +113 -126
  16. package/dist/components/Dropdown/DrawerOrDropdown.js +4 -4
  17. package/dist/components/Header/Header.js +42 -57
  18. package/dist/components/Header/LocaleButton.js +3 -2
  19. package/dist/components/Header/LocaleSwitcher.js +38 -23
  20. package/dist/components/Layout/Layout.js +27 -16
  21. package/dist/components/Layout/LayoutContent.js +4 -4
  22. package/dist/components/List/ListItemHeader.js +55 -53
  23. package/dist/components/List/ListItemLabel.js +32 -31
  24. package/dist/components/Menu/MenuBase.js +9 -9
  25. package/dist/components/Menu/MenuItem.js +22 -21
  26. package/dist/components/Menu/MenuItemBase.js +31 -27
  27. package/dist/components/Menu/MenuItemLabel.js +41 -25
  28. package/dist/components/Menu/MenuItems.js +43 -37
  29. package/dist/components/Modal/ModalBase.js +5 -5
  30. package/dist/components/Searchbar/Autocomplete.js +23 -30
  31. package/dist/components/Searchbar/Searchbar.js +4 -4
  32. package/dist/components/SkipLink/SkipLink.js +18 -0
  33. package/dist/components/SkipLink/index.js +4 -0
  34. package/dist/components/Typography/Heading.js +26 -24
  35. package/dist/components/Typography/useHighlightedText.js +28 -21
  36. package/dist/components/index.js +402 -400
  37. package/dist/hooks/useEnterKey.js +8 -8
  38. package/dist/hooks/useMenu.js +43 -28
  39. package/dist/index.js +408 -406
  40. package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +1 -0
  41. package/dist/types/lib/components/Button/FloatingActionButton.d.ts +14 -0
  42. package/dist/types/lib/components/Button/IconButton.d.ts +2 -1
  43. package/dist/types/lib/components/Button/index.d.ts +1 -0
  44. package/dist/types/lib/components/Dropdown/DrawerOrDropdown.d.ts +1 -1
  45. package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +1 -0
  46. package/dist/types/lib/components/Header/LocaleButton.d.ts +2 -1
  47. package/dist/types/lib/components/Header/LocaleSwitcher.d.ts +2 -5
  48. package/dist/types/lib/components/Layout/Layout.d.ts +3 -1
  49. package/dist/types/lib/components/Layout/Layout.stories.d.ts +7 -1
  50. package/dist/types/lib/components/Layout/LayoutContent.d.ts +9 -2
  51. package/dist/types/lib/components/List/ListItemHeader.d.ts +3 -1
  52. package/dist/types/lib/components/List/ListItemLabel.d.ts +2 -1
  53. package/dist/types/lib/components/Menu/MenuBase.d.ts +4 -2
  54. package/dist/types/lib/components/Menu/MenuItem.d.ts +4 -2
  55. package/dist/types/lib/components/Menu/MenuItemBase.d.ts +3 -2
  56. package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +2 -1
  57. package/dist/types/lib/components/Menu/MenuItems.d.ts +3 -1
  58. package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +1 -0
  59. package/dist/types/lib/components/SkipLink/SkipLink.d.ts +9 -0
  60. package/dist/types/lib/components/SkipLink/SkipLink.stories.d.ts +15 -0
  61. package/dist/types/lib/components/SkipLink/index.d.ts +1 -0
  62. package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +2 -1
  63. package/dist/types/lib/hooks/useEnterKey.d.ts +1 -1
  64. package/dist/types/lib/hooks/useMenu.d.ts +6 -2
  65. package/dist/types/lib/stories/InboxBeta.stories.d.ts +15 -0
  66. package/dist/types/lib/stories/Profile.stories.d.ts +1 -0
  67. package/package.json +1 -1
  68. package/dist/types/lib/components/Header/LocaleSwitcher.stories.d.ts +0 -19
@@ -1 +1 @@
1
- ._byline_zacbk_1{display:inline-flex;align-items:center;column-gap:.5em}._avatar_zacbk_7,._avatarGroup_zacbk_11{font-size:1.25rem}._avatar_zacbk_7[data-size=lg]{font-size:2.25rem}._label_zacbk_19{display:inline-flex;flex-wrap:wrap;column-gap:.25em;color:var(--ds-color-text-subtle)}._label_zacbk_19[data-size=xs],._label_zacbk_19[data-size=sm]{font-size:14px;line-height:1.125rem;padding:.1875rem 0}._label_zacbk_19[data-size=md],._label_zacbk_19[data-size=lg]{font-size:16px;line-height:1.25rem}._label_zacbk_19>strong{font-weight:500;color:var(--ds-color-text-default)}
1
+ ._byline_1o0os_1{display:inline-flex;align-items:center;column-gap:.5em}._avatar_1o0os_7,._avatarGroup_1o0os_12{font-size:1.25rem;flex-shrink:0}._avatar_1o0os_7[data-size=lg]{font-size:2.25rem}._label_1o0os_21{display:inline-flex;flex-wrap:wrap;column-gap:.25em;color:var(--ds-color-text-subtle)}._label_1o0os_21[data-size=xs],._label_1o0os_21[data-size=sm]{font-size:14px;line-height:1.125rem;padding:.1875rem 0}._label_1o0os_21[data-size=md],._label_1o0os_21[data-size=lg]{font-size:16px;line-height:1.25rem}._label_1o0os_21>strong{font-weight:500;color:var(--ds-color-text-default)}
@@ -1 +1 @@
1
- ._drawerOrDropdown_ijmwc_1{background-color:var(--ds-color-background-default);display:none}._drawerOrDropdown_ijmwc_1[data-expanded=true]{position:fixed;top:5.5rem;right:0;bottom:0;left:0;display:block;z-index:2}@media (min-width: 1024px){._header_ijmwc_18,._footer_ijmwc_19{display:none}._drawerOrDropdown_ijmwc_1[data-expanded=true]{position:absolute;top:auto;right:auto;bottom:auto;left:0;min-width:16rem;max-width:24rem;margin-top:.5rem;border-radius:.375rem;overflow:hidden}}
1
+ ._drawerOrDropdown_2swxb_1{background-color:var(--ds-color-background-default);display:none}._drawerOrDropdown_2swxb_1[data-expanded=true]{position:fixed;top:5.5rem;right:0;bottom:0;left:0;display:block;z-index:2}@media (min-width: 1024px){._header_2swxb_17,._footer_2swxb_18{display:none}._drawerOrDropdown_2swxb_1[data-expanded=true]{position:absolute;top:auto;right:auto;bottom:auto;left:0;min-width:16rem;max-width:24rem;margin-top:.5rem;border-radius:.375rem;overflow:hidden}}
@@ -0,0 +1 @@
1
+ ._button_v6n2g_1{--dsc-button-size: var(--ds-size-14);width:var(--ds-button-size);height:var(--ds-button-size);border-radius:50%;flex-shrink:0;position:fixed;bottom:0;right:0;margin:1rem}
@@ -1 +1 @@
1
- ._drawer_1vzjh_1[data-expanded=true]{display:block}._dropdown_1vzjh_5[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1vzjh_5[data-expanded=true]{width:320px;display:block}._drawer_1vzjh_1[data-expanded=true]{display:none}}._relative_1vzjh_19{position:relative}
1
+ ._drawer_1tael_1[data-expanded=true]{display:block;width:100%}._dropdown_1tael_6[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1tael_6[data-expanded=true]{width:320px;display:block}._drawer_1tael_1[data-expanded=true]{display:none}}._relative_1tael_20{position:relative}
@@ -1 +1 @@
1
- ._label_1b76c_1{pointer-events:none;position:relative;display:flex;flex-direction:column;align-items:start;justify-content:center;margin-top:var(--dsc-item-my);margin-bottom:var(--dsc-item-my)}
1
+ ._label_1cju7_1{pointer-events:none;position:relative;display:flex;flex-direction:column;align-items:start;justify-content:center;margin-top:var(--dsc-item-my);margin-bottom:var(--dsc-item-my)}._label_1cju7_1 mark{background-color:var(--ds-color-surface-tinted)}
@@ -1 +1 @@
1
- ._item_1itcj_1{font:inherit;color:inherit;padding:0;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_1itcj_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_1itcj_1[data-size=md]{min-height:56px}._item_1itcj_1[data-size=md]{min-height:44px}._item_1itcj_1[data-size=sm]{min-height:40px}._content_1itcj_45{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._item_1itcj_1,._item_1itcj_1[data-theme]{background-color:transparent}._item_1itcj_1{pointer-events:none}._item_1itcj_1[data-interactive=true]{pointer-events:all}[data-theme=subtle] ._item_1itcj_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_1itcj_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_1itcj_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_1itcj_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_1itcj_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_1itcj_1[data-selected=true]{background-color:var(--ds-color-background-tinted)}._content_1itcj_45{display:flex;width:100%;align-items:center;column-gap:.5em}._item_1itcj_1:focus-visible{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._item_1itcj_1:focus-visible *{--_ds--focus: }
1
+ ._item_1qmxq_1{font:inherit;color:inherit;padding:0;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_1qmxq_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_1qmxq_1[data-size=md]{min-height:56px}._item_1qmxq_1[data-size=md]{min-height:44px}._item_1qmxq_1[data-size=sm]{min-height:40px}._content_1qmxq_45{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._item_1qmxq_1,._item_1qmxq_1[data-theme]{background-color:transparent}._item_1qmxq_1{pointer-events:none}._item_1qmxq_1[data-interactive=true]{pointer-events:all}[data-theme=subtle] ._item_1qmxq_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_1qmxq_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_1qmxq_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_1qmxq_1:hover,[data-theme=default] [data-active=true]{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_1qmxq_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_1qmxq_1[data-selected=true]{background-color:var(--ds-color-background-tinted)}._content_1qmxq_45{display:flex;width:100%;align-items:center;column-gap:.5em}._item_1qmxq_1:focus-visible{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._item_1qmxq_1:focus-visible *{--_ds--focus: }
@@ -1 +1 @@
1
- ._label_mk4ho_1{flex-grow:1;display:flex;flex-direction:column;padding:0 .125rem}._label_mk4ho_1[data-size=lg]{font-size:1.125rem}._label_mk4ho_1[data-size=md],._label_mk4ho_1[data-size=sm]{font-size:1rem}._title_mk4ho_20{display:inline-flex;align-items:center;column-gap:.5em}
1
+ ._label_k9qsn_1{flex-grow:1;display:flex;flex-direction:column;padding:0 .125rem}._label_k9qsn_1[data-size=lg]{font-size:1.125rem}._label_k9qsn_1[data-size=md],._label_k9qsn_1[data-size=sm]{font-size:1rem}._title_k9qsn_20{display:inline-flex;align-items:center;column-gap:.5em}._label_k9qsn_1 mark{background-color:var(--ds-color-surface-tinted)}
@@ -1 +1 @@
1
- ._modal_1tnpv_1{padding:0;width:100%;max-width:450px;border:none;background-color:#fff;border-radius:.5rem;box-shadow:var(--ds-shadow-xs)}._modal_1tnpv_1[data-backdrop-color=inherit]::backdrop{background-color:#111d4640}._modal_1tnpv_1[data-backdrop-color=transparent]::backdrop{background-color:transparent}._modal_1tnpv_1[data-variant=full]{width:100%;max-width:none;height:100%;min-height:unset}._modal_1tnpv_1[data-variant=content]{max-width:988px;margin:auto}._content_1tnpv_30{position:relative}
1
+ ._modal_4vfmr_1{padding:0;width:100%;max-width:450px;border:none;background-color:#fff;border-radius:.5rem;box-shadow:var(--ds-shadow-xs)}._modal_4vfmr_1[data-backdrop-color=inherit]::backdrop{background-color:#111d4640}._modal_4vfmr_1[data-backdrop-color=transparent]::backdrop{background-color:transparent}._modal_4vfmr_1[data-variant=default]{max-width:640px;margin:auto}._modal_4vfmr_1[data-variant=content]{max-width:988px;margin:auto}._modal_4vfmr_1[data-variant=full]{width:100%;max-width:none;height:100%;min-height:unset}._content_4vfmr_35{position:relative}
@@ -1,55 +1,59 @@
1
1
  "use client";
2
- import { jsx as h } from "react/jsx-runtime";
3
- import { useState as L } from "react";
2
+ import { jsx as w } from "react/jsx-runtime";
3
+ import { useState as I } 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
- const m = (n) => `${n} hits`, R = ({
8
+ const b = (n) => `${n} hits`, k = ({
9
9
  items: n = [],
10
- groups: i = {},
11
- search: e,
10
+ groups: h = {},
11
+ search: t,
12
12
  onSelectAccount: r,
13
- currentAccount: d,
14
- menuItemsVirtual: g
13
+ currentAccount: s,
14
+ menuItemsVirtual: C
15
15
  }) => {
16
- var u;
17
- const a = n.map((t) => ({
18
- ...t,
19
- title: (t == null ? void 0 : t.title) || t.name,
20
- groupId: t.groupId || "search",
21
- selected: t.selected ?? (d == null ? void 0 : d.id) === t.id,
22
- onClick: () => r == null ? void 0 : r(t.id)
23
- })), [o, s] = L(""), l = o ? a.filter((t) => {
24
- var p;
25
- return (p = t == null ? void 0 : t.name) == null ? void 0 : p.toLowerCase().includes(o.toLowerCase());
26
- }).map((t) => ({
27
- ...t,
28
- groupId: "search"
29
- })) : a, f = o ? {
16
+ var p;
17
+ const d = n.map((o) => ({
18
+ ...o,
19
+ title: (o == null ? void 0 : o.title) || o.name,
20
+ groupId: o.groupId || "search",
21
+ selected: o.selected ?? (s == null ? void 0 : s.id) === o.id,
22
+ onClick: () => r == null ? void 0 : r(o.id)
23
+ })), [l, a] = I(""), e = l ? d.filter(
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()));
27
+ }
28
+ ).map((o) => ({
29
+ ...o,
30
+ groupId: "search",
31
+ title: (o == null ? void 0 : o.title) || o.name,
32
+ highlightWords: [l]
33
+ })) : d, L = l ? {
30
34
  search: {
31
- title: ((u = e == null ? void 0 : e.getResultsLabel) == null ? void 0 : u.call(e, l.length)) ?? m(l.length)
35
+ title: ((p = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : p.call(t, e.length)) ?? b(e.length)
32
36
  }
33
- } : i, C = {
37
+ } : h, c = {
34
38
  name: "account-search",
35
- value: o,
36
- placeholder: (e == null ? void 0 : e.placeholder) ?? "Find account",
37
- onChange: (t) => s(t.target.value),
38
- onClear: () => s("")
39
- }, I = [
40
- ...l.length > 0 ? l : [{ id: "search", groupId: "search", hidden: !0 }]
39
+ value: l,
40
+ placeholder: (t == null ? void 0 : t.placeholder) ?? "Find account",
41
+ onChange: (o) => a(o.target.value),
42
+ onClear: () => a("")
43
+ }, u = [
44
+ ...e.length > 0 ? e : [{ id: "search", groupId: "search", hidden: !0 }]
41
45
  ];
42
- return /* @__PURE__ */ h(
46
+ return console.log("items", u), /* @__PURE__ */ w(
43
47
  M,
44
48
  {
45
49
  theme: "default",
46
- search: e && C,
47
- groups: f,
48
- items: I,
49
- menuItemsVirtual: g
50
+ search: t && c,
51
+ groups: L,
52
+ items: u,
53
+ menuItemsVirtual: C
50
54
  }
51
55
  );
52
56
  };
53
57
  export {
54
- R as AccountMenu
58
+ k as AccountMenu
55
59
  };
@@ -0,0 +1,36 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import { ButtonBase as u } from "./ButtonBase.js";
5
+ import { ButtonIcon as l } from "./ButtonIcon.js";
6
+ import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
8
+ import '../../assets/FloatingActionButton.css';const c = "_button_v6n2g_1", b = {
9
+ button: c
10
+ }, j = ({
11
+ variant: n = "solid",
12
+ size: r,
13
+ icon: t,
14
+ iconSize: i,
15
+ iconAltText: s,
16
+ color: m,
17
+ onClick: a,
18
+ dataTestId: e,
19
+ onBlurCapture: p
20
+ }) => /* @__PURE__ */ o(
21
+ u,
22
+ {
23
+ className: b.button,
24
+ variant: n,
25
+ color: m,
26
+ size: r,
27
+ onClick: a,
28
+ "data-testid": e,
29
+ "aria-label": s,
30
+ onBlurCapture: p,
31
+ children: t && /* @__PURE__ */ o(l, { icon: t, size: i })
32
+ }
33
+ );
34
+ export {
35
+ j as FloatingActionButton
36
+ };
@@ -1,11 +1,11 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { ButtonBase as f } from "./ButtonBase.js";
5
- import { ButtonIcon as u } from "./ButtonIcon.js";
4
+ import { ButtonBase as u } from "./ButtonBase.js";
5
+ import { ButtonIcon as B } from "./ButtonIcon.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- const z = ({
8
+ const g = ({
9
9
  variant: r = "solid",
10
10
  rounded: i = !1,
11
11
  size: m,
@@ -16,9 +16,10 @@ const z = ({
16
16
  className: n,
17
17
  selected: s,
18
18
  onClick: l,
19
- dataTestId: d
19
+ dataTestId: d,
20
+ onBlurCapture: f
20
21
  }) => /* @__PURE__ */ o(
21
- f,
22
+ u,
22
23
  {
23
24
  variant: r,
24
25
  rounded: i,
@@ -29,9 +30,10 @@ const z = ({
29
30
  selected: s,
30
31
  "data-testid": d,
31
32
  "aria-label": p,
32
- children: t && /* @__PURE__ */ o(u, { icon: t, size: e })
33
+ onBlurCapture: f,
34
+ children: t && /* @__PURE__ */ o(B, { icon: t, size: e })
33
35
  }
34
36
  );
35
37
  export {
36
- z as IconButton
38
+ g as IconButton
37
39
  };
@@ -1,16 +1,18 @@
1
1
  import { ButtonBase as r } from "./ButtonBase.js";
2
- import { ButtonLabel as n } from "./ButtonLabel.js";
2
+ import { ButtonLabel as e } from "./ButtonLabel.js";
3
3
  import { ButtonIcon as p } from "./ButtonIcon.js";
4
4
  import { Button as B } from "./Button.js";
5
5
  import { ComboButton as x } from "./ComboButton.js";
6
- import { IconButton as b } from "./IconButton.js";
6
+ import { IconButton as c } from "./IconButton.js";
7
+ import { FloatingActionButton as i } from "./FloatingActionButton.js";
7
8
  import { ButtonGroup as I } from "./ButtonGroup.js";
8
9
  export {
9
10
  B as Button,
10
11
  r as ButtonBase,
11
12
  I as ButtonGroup,
12
13
  p as ButtonIcon,
13
- n as ButtonLabel,
14
+ e as ButtonLabel,
14
15
  x as ComboButton,
15
- b as IconButton
16
+ i as FloatingActionButton,
17
+ c as IconButton
16
18
  };
@@ -1,30 +1,30 @@
1
- import { jsxs as b, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as _, jsx as a } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { Avatar as _ } from "../Avatar/Avatar.js";
5
- import { AvatarGroup as v } from "../Avatar/AvatarGroup.js";
4
+ import { Avatar as v } from "../Avatar/Avatar.js";
5
+ import { AvatarGroup as b } from "../Avatar/AvatarGroup.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { Skeleton as c } from "../Skeleton/Skeleton.js";
7
+ import { Skeleton as l } from "../Skeleton/Skeleton.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import '../../assets/Byline.css';const d = "_byline_zacbk_1", y = "_avatar_zacbk_7", k = "_avatarGroup_zacbk_11", u = "_label_zacbk_19", t = {
9
+ import '../../assets/Byline.css';const d = "_byline_1o0os_1", y = "_avatar_1o0os_7", u = "_avatarGroup_1o0os_12", N = "_label_1o0os_21", o = {
10
10
  byline: d,
11
11
  avatar: y,
12
- avatarGroup: k,
13
- label: u
14
- }, B = ({
15
- loading: l,
12
+ avatarGroup: u,
13
+ label: N
14
+ }, S = ({
15
+ loading: s,
16
16
  color: n = "neutral",
17
- size: r = "xs",
18
- avatar: o,
17
+ size: t = "xs",
18
+ avatar: r,
19
19
  avatarGroup: e,
20
- datetime: s,
21
- children: m,
22
- as: i,
20
+ datetime: m,
21
+ children: i,
22
+ as: c,
23
23
  ...p
24
- }) => /* @__PURE__ */ b(i || "div", { ...p, className: t.byline, "data-color": n, "data-size": r, children: [
25
- (e || o) && /* @__PURE__ */ a(c, { variant: "circle", className: t.avatar, loading: l, children: e ? /* @__PURE__ */ a(v, { ...e, size: r, className: t.avatarGroup }) : o && /* @__PURE__ */ a(_, { ...o, size: r, className: t.avatar }) }),
26
- /* @__PURE__ */ a("time", { "data-size": r, dateTime: s, className: t.label, children: /* @__PURE__ */ a(c, { loading: l, children: m }) })
24
+ }) => /* @__PURE__ */ _(c || "div", { ...p, className: o.byline, "data-color": n, "data-size": t, children: [
25
+ (e || r) && /* @__PURE__ */ a(l, { variant: "circle", className: o.avatar, loading: s, children: e ? /* @__PURE__ */ a(b, { ...e, size: t, className: o.avatarGroup }) : r && /* @__PURE__ */ a(v, { ...r, size: t, className: o.avatar }) }),
26
+ /* @__PURE__ */ a("time", { "data-size": t, dateTime: m, className: o.label, children: /* @__PURE__ */ a(l, { loading: s, children: i }) })
27
27
  ] });
28
28
  export {
29
- B as Byline
29
+ S as Byline
30
30
  };
@@ -1,68 +1,83 @@
1
1
  "use client";
2
- import { jsxs as v, jsx as s } from "react/jsx-runtime";
3
- import { c as O } from "../../index-L8X2o7IH.js";
4
- import * as a from "react";
5
- import { forwardRef as b, useRef as h, useMemo as w } from "react";
6
- import { IconButton as y } from "../Button/IconButton.js";
7
- import { useClickOutside as I } from "../../hooks/useClickOutside.js";
2
+ import { jsxs as y, jsx as f } from "react/jsx-runtime";
3
+ import { c as I } from "../../index-L8X2o7IH.js";
4
+ import * as m from "react";
5
+ import { forwardRef as w, useRef as O, useMemo as k } from "react";
6
+ import { IconButton as E } from "../Button/IconButton.js";
7
+ import { useClickOutside as C } from "../../hooks/useClickOutside.js";
8
+ import { useEnterKey as M } from "../../hooks/useEnterKey.js";
8
9
  import { DropdownBase as j } from "../Dropdown/DropdownBase.js";
9
- import { MenuItems as C } from "../Menu/MenuItems.js";
10
- import { useRootContext as _ } from "../RootProvider/RootProvider.js";
10
+ import { MenuItems as _ } from "../Menu/MenuItems.js";
11
+ import { useRootContext as R } from "../RootProvider/RootProvider.js";
11
12
  import "../Snackbar/useSnackbar.js";
12
- import { u as R } from "../../useId-BVFxCjkq.js";
13
- import '../../assets/ContextMenu.css';var E = function(e, l) {
14
- var r = {};
15
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (r[t] = e[t]);
13
+ import { u as P } from "../../useId-BVFxCjkq.js";
14
+ import '../../assets/ContextMenu.css';var T = function(e, s) {
15
+ var n = {};
16
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && s.indexOf(t) < 0 && (n[t] = e[t]);
16
17
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
17
18
  for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
18
- l.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
19
- return r;
19
+ s.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (n[t[o]] = e[t[o]]);
20
+ return n;
20
21
  };
21
- const M = b((e, l) => {
22
- var { title: r, titleId: t } = e, o = E(e, ["title", "titleId"]);
23
- let n = R();
24
- return n = r ? t || "title-" + n : void 0, a.createElement(
22
+ const A = w((e, s) => {
23
+ var { title: n, titleId: t } = e, o = T(e, ["title", "titleId"]);
24
+ let i = P();
25
+ return i = n ? t || "title-" + i : void 0, m.createElement(
25
26
  "svg",
26
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby": n }, o),
27
- r ? a.createElement("title", { id: n }, r) : null,
28
- a.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m4.5 1.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m6 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0", clipRule: "evenodd" })
27
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: s, "aria-labelledby": i }, o),
28
+ n ? m.createElement("title", { id: i }, n) : null,
29
+ m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m4.5 1.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m6 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0", clipRule: "evenodd" })
29
30
  );
30
- }), k = "_toggle_nol5i_1", B = {
31
- toggle: k
32
- }, q = ({
31
+ }), B = "_toggle_nol5i_1", S = {
32
+ toggle: B
33
+ }, Q = ({
33
34
  id: e = "context-menu",
34
- ariaLabel: l,
35
- placement: r = "right",
35
+ ariaLabel: s,
36
+ placement: n = "right",
36
37
  groups: t = {},
37
38
  className: o,
38
- items: n
39
+ items: i
39
40
  }) => {
40
- const { currentId: p, toggleId: u, closeAll: f } = _(), m = h(null), g = () => u(e), c = p === e;
41
- I(m, () => {
42
- c && u(e);
41
+ const { currentId: v, toggleId: p, closeAll: a } = R(), d = O(null), g = "context-menu-" + e, x = () => p(e), u = v === e;
42
+ C(d, () => {
43
+ u && p(e);
43
44
  });
44
- const x = w(() => n.map((i) => ({
45
- ...i,
45
+ const b = k(() => i.map((r) => ({
46
+ ...r,
47
+ tabIndex: -1,
46
48
  onClick: () => {
47
- var d;
48
- (d = i.onClick) == null || d.call(i), f();
49
+ var c;
50
+ (c = r.onClick) == null || c.call(r), a();
49
51
  }
50
- })), [n, f]);
51
- return /* @__PURE__ */ v("div", { className: O(B.toggle, o), "data-color": "neutral", ref: m, children: [
52
- /* @__PURE__ */ s(
53
- y,
52
+ })), [i, a]);
53
+ M((r) => {
54
+ var c;
55
+ if (u) {
56
+ r.preventDefault();
57
+ const l = (c = d.current) == null ? void 0 : c.querySelector('[data-active="true"]');
58
+ l && (l.tagName === "A" && l.hasAttribute("href") ? l.click() : l.dispatchEvent(new MouseEvent("click", { bubbles: !0 }))), a();
59
+ }
60
+ });
61
+ const h = (r) => {
62
+ var l;
63
+ ((l = r == null ? void 0 : r.relatedTarget) == null ? void 0 : l.closest(`[data-testid="${g}"]`)) || a();
64
+ };
65
+ return /* @__PURE__ */ y("div", { className: I(S.toggle, o), "data-color": "neutral", ref: d, "data-testid": g, children: [
66
+ /* @__PURE__ */ f(
67
+ E,
54
68
  {
55
69
  size: "xs",
56
70
  rounded: !0,
57
- icon: M,
71
+ icon: A,
58
72
  variant: "text",
59
- onClick: g,
60
- iconAltText: l || `Open ${e}`
73
+ onClick: x,
74
+ iconAltText: s || `Open ${e}`,
75
+ onBlurCapture: h
61
76
  }
62
77
  ),
63
- c && /* @__PURE__ */ s(j, { placement: r, open: c, children: /* @__PURE__ */ s(C, { groups: t, items: x }) })
78
+ u && /* @__PURE__ */ f(j, { placement: n, open: u, children: /* @__PURE__ */ f(_, { groups: t, items: b, keyboardEvents: !0 }) })
64
79
  ] });
65
80
  };
66
81
  export {
67
- q as ContextMenu
82
+ Q as ContextMenu
68
83
  };