@altinn/altinn-components 0.56.34 → 0.57.2

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 (264) hide show
  1. package/dist/Section-jhq4n77E.js +2260 -0
  2. package/dist/{Trash-DBcymOP9.js → Trash-BG9YcGIl.js} +33 -14
  3. package/dist/assets/Breadcrumbs.css +1 -1
  4. package/dist/assets/BreadcrumbsLink.css +1 -1
  5. package/dist/assets/ButtonGroup.css +1 -1
  6. package/dist/assets/ItemBase.css +1 -0
  7. package/dist/assets/ItemLink.css +1 -0
  8. package/dist/assets/MetaItemBase.css +1 -1
  9. package/dist/assets/QueryLabelItem.css +1 -1
  10. package/dist/assets/Section.css +1 -1
  11. package/dist/components/AccessAreaListItem/AccessAreaListItem.js +15 -16
  12. package/dist/components/AccessPackageListItem/AccessPackageListItem.js +8 -9
  13. package/dist/components/Account/AccountList.js +16 -19
  14. package/dist/components/Account/AccountListItem.js +7 -8
  15. package/dist/components/Account/AccountListItemControls.js +1 -1
  16. package/dist/components/Account/AccountListItemDetails.js +13 -15
  17. package/dist/components/Account/AccountListVirtual.js +10 -12
  18. package/dist/components/Account/AccountMenu.js +10 -11
  19. package/dist/components/Account/AccountNotificationSettings.js +1 -1
  20. package/dist/components/Account/AccountOrganization.js +14 -15
  21. package/dist/components/AccountSelector/AccountSelector.js +12 -13
  22. package/dist/components/ActivityLog/ActivityLog.js +12 -13
  23. package/dist/components/ActivityLog/ActivityLogItem.js +1 -1
  24. package/dist/components/ActivityLog/ActivityLogSegment.js +1 -1
  25. package/dist/components/Alert/Alert.js +1 -1
  26. package/dist/components/Article/Article.js +3 -4
  27. package/dist/components/Article/ArticleContact.js +8 -10
  28. package/dist/components/Article/ArticleHeader.js +5 -7
  29. package/dist/components/Attachment/AttachmentLink.js +7 -7
  30. package/dist/components/Banner/Banner.js +7 -8
  31. package/dist/components/Bookmarks/BookmarkModal.js +11 -12
  32. package/dist/components/Bookmarks/BookmarkSettingsItem.js +10 -11
  33. package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +12 -13
  34. package/dist/components/Bookmarks/BookmarkSettingsList.js +14 -16
  35. package/dist/components/Breadcrumbs/Breadcrumbs.js +8 -8
  36. package/dist/components/Breadcrumbs/BreadcrumbsLink.js +3 -3
  37. package/dist/components/Bulk/BulkHeader.js +14 -16
  38. package/dist/components/Button/ButtonGroup.js +11 -11
  39. package/dist/components/Button/ButtonIcon.js +3 -4
  40. package/dist/components/Button/ComboButton.js +1 -1
  41. package/dist/components/Button/FloatingActionButton.js +2 -2
  42. package/dist/components/Button/IconButton.js +1 -1
  43. package/dist/components/Byline/Byline.js +6 -28
  44. package/dist/components/Byline/index.js +1 -1
  45. package/dist/components/ContextMenu/ContextMenu.js +13 -15
  46. package/dist/components/Dashboard/DashboardCard.js +22 -24
  47. package/dist/components/Dashboard/DashboardHeader.js +12 -15
  48. package/dist/components/Datepicker/Datepicker.js +1 -1
  49. package/dist/components/Datepicker/DatepickerHeader.js +6 -7
  50. package/dist/components/Datepicker/DatepickerTable.js +1 -1
  51. package/dist/components/Dialog/Dialog.js +1 -1
  52. package/dist/components/Dialog/DialogActions.js +19 -22
  53. package/dist/components/Dialog/DialogActivityLog.js +1 -1
  54. package/dist/components/Dialog/DialogAttachments.js +6 -8
  55. package/dist/components/Dialog/DialogBody.js +1 -1
  56. package/dist/components/Dialog/DialogByline.js +3 -18
  57. package/dist/components/Dialog/DialogContact.js +6 -8
  58. package/dist/components/Dialog/DialogHeader.js +30 -33
  59. package/dist/components/Dialog/DialogHistory.js +9 -10
  60. package/dist/components/Dialog/DialogHistoryItem.js +1 -1
  61. package/dist/components/Dialog/DialogHistorySegment.js +1 -1
  62. package/dist/components/Dialog/DialogLayout.js +4 -5
  63. package/dist/components/Dialog/DialogList.js +5 -24
  64. package/dist/components/Dialog/DialogListGroup.js +6 -16
  65. package/dist/components/Dialog/DialogListItem.js +10 -169
  66. package/dist/components/Dialog/DialogMetadata.js +6 -124
  67. package/dist/components/Dialog/DialogSection.js +7 -9
  68. package/dist/components/Dialog/DialogSeenBy.js +7 -8
  69. package/dist/components/Dialog/DialogSelect.js +1 -1
  70. package/dist/components/Dialog/DialogStatus.js +5 -46
  71. package/dist/components/Dialog/DialogTabs.js +1 -1
  72. package/dist/components/Dialog/SeenByLog.js +14 -16
  73. package/dist/components/Dialog/SeenByLogButton.js +1 -1
  74. package/dist/components/Dialog/SeenByLogItem.js +11 -12
  75. package/dist/components/Dialog/index.js +39 -44
  76. package/dist/components/Dropdown/DrawerButton.js +1 -1
  77. package/dist/components/Dropdown/DrawerHeader.js +7 -8
  78. package/dist/components/Dropdown/DrawerOrDropdown.js +1 -1
  79. package/dist/components/Dropdown/Dropdown.js +7 -173
  80. package/dist/components/Dropdown/DropdownBase.js +1 -1
  81. package/dist/components/Dropdown/FloatingDropdown.js +25 -26
  82. package/dist/components/Dropdown/index.js +3 -3
  83. package/dist/components/Forms/Checkbox.js +1 -1
  84. package/dist/components/Forms/CheckboxOptions.js +1 -1
  85. package/dist/components/Forms/FieldBase.js +6 -11
  86. package/dist/components/Forms/FieldsetBase.js +1 -1
  87. package/dist/components/Forms/Radio.js +1 -1
  88. package/dist/components/Forms/RadioOptions.js +1 -1
  89. package/dist/components/Forms/SearchField.js +2 -6
  90. package/dist/components/Forms/SelectField.js +4 -5
  91. package/dist/components/Forms/Switch.js +1 -1
  92. package/dist/components/Forms/SwitchOptions.js +1 -1
  93. package/dist/components/Forms/TextField.js +3 -4
  94. package/dist/components/Forms/TextFieldDropdown.js +51 -56
  95. package/dist/components/Forms/TextareaField.js +3 -4
  96. package/dist/components/Forms/index.js +24 -25
  97. package/dist/components/GlobalHeader/GlobalAccountButton.js +18 -20
  98. package/dist/components/GlobalHeader/GlobalHeader.js +5 -5
  99. package/dist/components/GlobalHeader/GlobalMenuButton.js +12 -13
  100. package/dist/components/GlobalHeader/HeaderDrawer.js +29 -31
  101. package/dist/components/GlobalHeader/HeaderDropdown.js +5 -6
  102. package/dist/components/GlobalHeader/HeaderLogo.js +6 -6
  103. package/dist/components/GlobalMenu/GlobalMenu.js +9 -10
  104. package/dist/components/GlobalMenu/LocaleSwitcher.js +16 -18
  105. package/dist/components/GlobalMenu/LogoutButton.js +1 -1
  106. package/dist/components/GlobalMenu_old/BackButton.js +3 -4
  107. package/dist/components/GlobalMenu_old/CurrentAccount.js +3 -4
  108. package/dist/components/GlobalMenu_old/GlobalMenu.js +9 -10
  109. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +15 -16
  110. package/dist/components/GlobalMenu_old/LogoutButton.js +1 -1
  111. package/dist/components/Header/Header.js +1 -1
  112. package/dist/components/Header/HeaderBase.js +1 -1
  113. package/dist/components/Header/HeaderButton.js +30 -32
  114. package/dist/components/Header/LocaleButton.js +1 -1
  115. package/dist/components/Header/LocaleSwitcher.js +15 -17
  116. package/dist/components/Icon/Icon.js +6 -27
  117. package/dist/components/Icon/index.js +7 -7
  118. package/dist/components/InboxSearch/InboxSearch.js +7 -7
  119. package/dist/components/Item/ItemBase.js +35 -0
  120. package/dist/components/Item/ItemLabel.js +4 -31
  121. package/dist/components/Item/ItemLink.js +53 -0
  122. package/dist/components/Item/ItemMedia.js +7 -29
  123. package/dist/components/Item/ItemSelect.js +5 -6
  124. package/dist/components/Item/index.js +9 -7
  125. package/dist/components/Layout/Layout.js +19 -20
  126. package/dist/components/List/List.js +6 -10
  127. package/dist/components/List/ListBase.js +1 -1
  128. package/dist/components/List/ListItem.js +6 -79
  129. package/dist/components/List/ListItemHeader.js +8 -114
  130. package/dist/components/List/ListItemIcon.js +7 -22
  131. package/dist/components/List/ListItemLabel.js +6 -57
  132. package/dist/components/List/index.js +9 -15
  133. package/dist/components/Menu/Menu.js +2 -3
  134. package/dist/components/Menu/MenuItem.js +8 -207
  135. package/dist/components/Menu/MenuItems.js +2 -4
  136. package/dist/components/Menu/MenuListSearch.js +2 -3
  137. package/dist/components/Menu/MenuOption.js +3 -3
  138. package/dist/components/Menu/TabMenu.js +5 -6
  139. package/dist/components/Menu/VirtualizedMenuItems.js +2 -4
  140. package/dist/components/Menu/example.data.js +7 -8
  141. package/dist/components/Menu/index.js +18 -19
  142. package/dist/components/Menu/useMenuSearch.js +4 -145
  143. package/dist/components/Metadata/MetaItem.js +5 -23
  144. package/dist/components/Metadata/MetaItemBase.js +47 -30
  145. package/dist/components/Metadata/MetaItemIcon.js +7 -20
  146. package/dist/components/Metadata/MetaProgress.js +5 -14
  147. package/dist/components/Metadata/MetaTimestamp.js +5 -22
  148. package/dist/components/Metadata/Metadata.js +9 -12
  149. package/dist/components/Metadata/index.js +13 -16
  150. package/dist/components/Modal/Modal.js +9 -10
  151. package/dist/components/Modal/ModalBase.js +29 -30
  152. package/dist/components/Modal/ModalHeader.js +15 -17
  153. package/dist/components/Modal/ModalIcon.js +10 -12
  154. package/dist/components/Notifications/NotificationItem.js +1 -1
  155. package/dist/components/Notifications/NotificationItemBase.js +8 -9
  156. package/dist/components/Notifications/NotificationItemControls.js +6 -7
  157. package/dist/components/Notifications/NotificationItemIcon.js +13 -15
  158. package/dist/components/Page/AccordionSection.js +6 -7
  159. package/dist/components/Page/ContactButtons.js +1 -1
  160. package/dist/components/Page/ContactSection.js +13 -15
  161. package/dist/components/Page/PageMenu.js +10 -11
  162. package/dist/components/Page/PageNav.js +1 -1
  163. package/dist/components/Page/Section.js +5 -27
  164. package/dist/components/Page/index.js +5 -5
  165. package/dist/components/ResourceListItem/ResourceListItem.js +11 -12
  166. package/dist/components/RootProvider/RootProvider.js +7 -56
  167. package/dist/components/RootProvider/index.js +1 -1
  168. package/dist/components/Search/SearchItem.js +9 -12
  169. package/dist/components/Searchbar/Autocomplete.js +1 -1
  170. package/dist/components/Searchbar/AutocompleteItem.js +5 -6
  171. package/dist/components/Searchbar/Searchbar.js +1 -1
  172. package/dist/components/Searchbar/SearchbarField.js +27 -30
  173. package/dist/components/Settings/SettingsItem.js +1 -1
  174. package/dist/components/Settings/SettingsItemBase.js +17 -19
  175. package/dist/components/Settings/SettingsList.js +16 -18
  176. package/dist/components/Settings/SettingsModal.js +1 -1
  177. package/dist/components/Settings/SettingsSection.js +11 -12
  178. package/dist/components/Settings/UsedByLog.js +18 -20
  179. package/dist/components/Settings/UsedByLogItem.js +7 -8
  180. package/dist/components/Snackbar/SnackbarItem.js +19 -21
  181. package/dist/components/Timeline/Timeline.js +3 -4
  182. package/dist/components/Timeline/TimelineActivity.js +13 -15
  183. package/dist/components/Timeline/TimelineBase.js +1 -1
  184. package/dist/components/Timeline/TimelineFooter.js +7 -8
  185. package/dist/components/Timeline/TimelineHeader.js +6 -7
  186. package/dist/components/Timeline/TimelineIcon.js +10 -12
  187. package/dist/components/Timeline/TimelineSection.js +17 -19
  188. package/dist/components/Timeline/TimelineSegment.js +18 -20
  189. package/dist/components/Toolbar/DatepickerFilter.js +13 -14
  190. package/dist/components/Toolbar/QueryLabelItem.js +2 -2
  191. package/dist/components/Toolbar/SelectDateFilter.js +7 -8
  192. package/dist/components/Toolbar/Toolbar.js +10 -12
  193. package/dist/components/Toolbar/ToolbarFilter.js +58 -54
  194. package/dist/components/Toolbar/ToolbarFilterAddMenu.js +22 -24
  195. package/dist/components/Toolbar/ToolbarFilterButton.js +24 -25
  196. package/dist/components/Toolbar/ToolbarFilterMenu.js +83 -73
  197. package/dist/components/Toolbar/ToolbarMenu.js +6 -65
  198. package/dist/components/Toolbar/ToolbarSearch.js +4 -37
  199. package/dist/components/Toolbar/example.data.js +7 -8
  200. package/dist/components/Toolbar/index.js +10 -11
  201. package/dist/components/Transmission/Transmission.js +25 -27
  202. package/dist/components/Transmission/TransmissionList.js +8 -10
  203. package/dist/components/Transmission/TransmissionType.js +1 -1
  204. package/dist/components/Typography/Heading.js +6 -41
  205. package/dist/components/Typography/index.js +2 -2
  206. package/dist/components/UserListItem/UserListItem.js +21 -23
  207. package/dist/components/index.js +420 -446
  208. package/dist/hooks/useAccountSelector.js +1 -1
  209. package/dist/index.js +434 -460
  210. package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +1 -1
  211. package/dist/types/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -0
  212. package/dist/types/lib/components/Bulk/Bulk.stories.d.ts +1 -1
  213. package/dist/types/lib/components/Dialog/DialogList.d.ts +1 -1
  214. package/dist/types/lib/components/Dialog/DialogList.stories.d.ts +2 -1
  215. package/dist/types/lib/components/Dialog/DialogListGroup.d.ts +1 -1
  216. package/dist/types/lib/components/Dialog/DialogListItem.d.ts +11 -11
  217. package/dist/types/lib/components/Item/ItemBase.d.ts +29 -0
  218. package/dist/types/lib/components/Item/ItemControls.d.ts +1 -2
  219. package/dist/types/lib/components/Item/ItemLink.d.ts +19 -0
  220. package/dist/types/lib/components/Item/ItemSelect.d.ts +4 -3
  221. package/dist/types/lib/components/Item/index.d.ts +2 -0
  222. package/dist/types/lib/components/List/ListItem.d.ts +1 -1
  223. package/dist/types/lib/components/List/ListItemHeader.d.ts +2 -2
  224. package/dist/types/lib/components/List/index.d.ts +0 -1
  225. package/dist/types/lib/components/Metadata/MetaItemBase.d.ts +2 -1
  226. package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +1 -1
  227. package/dist/types/lib/components/Toolbar/Toolbar.d.ts +2 -1
  228. package/dist/types/lib/components/Toolbar/Toolbar.stories.d.ts +3 -1
  229. package/dist/types/lib/components/Toolbar/ToolbarFilter.d.ts +2 -1
  230. package/dist/types/lib/components/Toolbar/ToolbarFilter.stories.d.ts +1 -1
  231. package/dist/types/lib/components/Toolbar/ToolbarFilterButton.d.ts +2 -1
  232. package/dist/types/lib/components/Toolbar/ToolbarFilterMenu.d.ts +2 -1
  233. package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +2 -1
  234. package/dist/types/lib/components/Toolbar/ToolbarSearch.d.ts +1 -1
  235. package/dist/types/lib/components/Toolbar/ToolbarSearch.stories.d.ts +1 -1
  236. package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +1 -1
  237. package/package.json +3 -3
  238. package/dist/Checkmark-Byz_C9x4.js +0 -24
  239. package/dist/ChevronDown-D_a7nb-G.js +0 -24
  240. package/dist/ChevronRight-ANFWmIs1.js +0 -24
  241. package/dist/ChevronUp-hn05LboH.js +0 -24
  242. package/dist/ChevronUpDown-DqGsU4MC.js +0 -24
  243. package/dist/InformationSquare-D3WAxfVw.js +0 -24
  244. package/dist/MagnifyingGlass-bwVhw07z.js +0 -24
  245. package/dist/SearchField-BU7Imhpe.js +0 -687
  246. package/dist/XMark-tKk6aExO.js +0 -24
  247. package/dist/assets/Byline.css +0 -1
  248. package/dist/assets/DialogListItem.css +0 -1
  249. package/dist/assets/Dropdown.css +0 -1
  250. package/dist/assets/Heading.css +0 -1
  251. package/dist/assets/Icon.css +0 -1
  252. package/dist/assets/ItemLabel.css +0 -1
  253. package/dist/assets/ItemMedia.css +0 -1
  254. package/dist/assets/List.css +0 -1
  255. package/dist/assets/ListItem.css +0 -1
  256. package/dist/assets/ListItemHeader.css +0 -1
  257. package/dist/assets/ListItemLabel.css +0 -1
  258. package/dist/assets/ListItemSelect.css +0 -1
  259. package/dist/assets/MenuItem.css +0 -1
  260. package/dist/assets/MetaItemIcon.css +0 -1
  261. package/dist/assets/SearchField.css +0 -1
  262. package/dist/components/List/ListItemSelect.js +0 -19
  263. package/dist/types/lib/components/List/ListItemSelect.d.ts +0 -6
  264. /package/dist/assets/{ListItemIcon.css → ModalIcon.css} +0 -0
@@ -1,687 +0,0 @@
1
- "use client";
2
- import { jsx as o, jsxs as E } from "react/jsx-runtime";
3
- import { c as oe } from "./index-p1eeF8LQ.js";
4
- import { useRef as j, useState as Q, useMemo as V, useEffect as G, Fragment as Ie, useLayoutEffect as ne, useId as re } from "react";
5
- import { Input as ie } from "./components/Forms/Input.js";
6
- import { FieldBase as se } from "./components/Forms/FieldBase.js";
7
- import { useMenu as de } from "./hooks/useMenu.js";
8
- import "./components/RootProvider/RootProvider.js";
9
- import { Button as ae } from "./components/Button/Button.js";
10
- import "react-dom";
11
- import "./components/Snackbar/useSnackbar.js";
12
- import { MenuItem as fe } from "./components/Menu/MenuItem.js";
13
- import { MenuList as Z } from "./components/Menu/MenuList.js";
14
- import { MenuListItem as pe } from "./components/Menu/MenuListItem.js";
15
- import { MenuListGroup as me } from "./components/Menu/MenuListGroup.js";
16
- import { MenuListDivider as he } from "./components/Menu/MenuListDivider.js";
17
- import { MenuListHeading as ye } from "./components/Menu/MenuListHeading.js";
18
- import { a as ve } from "./useMenuVirtualization-Cs426RCN.js";
19
- import { useMenuSearch as be } from "./components/Menu/useMenuSearch.js";
20
- import { TypingIcon as we } from "./components/Icon/TypingIcon.js";
21
- import { S as ce } from "./MagnifyingGlass-bwVhw07z.js";
22
- import { S as le } from "./XMark-tKk6aExO.js";
23
- import './assets/SearchField.css';const Ce = "_search_18jfe_1", ke = "_searchInput_18jfe_8", te = {
24
- search: Ce,
25
- searchInput: ke
26
- }, xe = ({
27
- style: v,
28
- index: b,
29
- name: B,
30
- value: M,
31
- placeholder: u = "Search",
32
- clearButtonAltText: h = "Clear search",
33
- onChange: A,
34
- onClear: y,
35
- onNavigate: k,
36
- combobox: f = !1,
37
- listId: a,
38
- "aria-activedescendant": w,
39
- onKeyDown: p,
40
- onInput: m,
41
- onFocus: _,
42
- ...x
43
- }) => /* @__PURE__ */ o("li", { className: te.search, style: v, "data-index": b, "data-menu-search": "true", children: f ? (
44
- // biome-ignore lint/a11y/useFocusableInteractive: <explanation>
45
- // biome-ignore lint/a11y/useAriaPropsForRole: <explanation>
46
- // biome-ignore lint/a11y/useSemanticElements: <explanation>
47
- /* @__PURE__ */ o("div", { role: "combobox", "aria-expanded": !0, "aria-haspopup": "listbox", "aria-owns": a, children: /* @__PURE__ */ o(
48
- ue,
49
- {
50
- size: "xs",
51
- className: te.searchInput,
52
- name: B,
53
- value: M,
54
- placeholder: u,
55
- onChange: A,
56
- onClear: y,
57
- clearButtonAltText: h,
58
- autoComplete: "off",
59
- autoCorrect: "off",
60
- autoCapitalize: "off",
61
- "aria-autocomplete": "list",
62
- "aria-controls": a,
63
- "aria-activedescendant": w,
64
- autoFocus: !0,
65
- onKeyDown: (r) => {
66
- (r.key === "ArrowUp" || r.key === "ArrowDown") && (r.preventDefault(), k?.()), p?.(r);
67
- },
68
- onInput: m,
69
- onFocus: _,
70
- ...x
71
- }
72
- ) })
73
- ) : /* @__PURE__ */ o(
74
- ue,
75
- {
76
- size: "xs",
77
- className: te.searchInput,
78
- name: B,
79
- value: M,
80
- placeholder: u,
81
- onChange: A,
82
- onClear: y,
83
- clearButtonAltText: h,
84
- autoComplete: "off",
85
- autoCorrect: "off",
86
- autoCapitalize: "off",
87
- autoFocus: !0,
88
- onKeyDown: (r) => {
89
- (r.key === "ArrowUp" || r.key === "ArrowDown") && (r.preventDefault(), k?.()), p?.(r);
90
- },
91
- onInput: m,
92
- onFocus: _,
93
- ...x
94
- }
95
- ) }), ge = ({
96
- level: v = 0,
97
- maxLevels: b,
98
- expanded: B,
99
- a11yMode: M = "menu",
100
- open: u,
101
- scrollToTopOnOpen: h = !1,
102
- autoActivateFirstItem: A = !0,
103
- autoFocusList: y = !0,
104
- announceNoResults: k = !1,
105
- search: f,
106
- items: a,
107
- groups: w = {},
108
- size: p,
109
- id: m,
110
- color: _,
111
- variant: x,
112
- scrollRefStyles: r = {},
113
- keyboardEvents: g = !1,
114
- onSelect: T = () => {
115
- },
116
- onActiveItemIdChange: N
117
- }) => {
118
- if (b && v >= b)
119
- return null;
120
- const d = M === "combobox", i = d && m ? `${m}-listbox` : m, F = j(u), P = j(u), [R, C] = Q(!1), Y = V(
121
- () => a.map((n, I) => ({
122
- ...n,
123
- id: n.id || `${m}-item-${I}`
124
- })),
125
- [a, m]
126
- ), O = j(null), { menu: s, setActiveIndex: S, activeItem: W } = de({
127
- items: Y,
128
- groups: w,
129
- groupByKey: "groupId",
130
- keyboardEvents: g,
131
- autoActivateFirstItem: A,
132
- onSelect: T,
133
- ref: O
134
- });
135
- return G(() => {
136
- N?.(W?.id);
137
- }, [W?.id, N]), G(() => {
138
- if (!h) {
139
- F.current = u;
140
- return;
141
- }
142
- const n = F.current;
143
- F.current = u, u && !n && O.current?.scrollTo({ top: 0 });
144
- }, [u, h]), G(() => {
145
- const n = P.current;
146
- P.current = u, !(!g || f || !y) && u && !n && requestAnimationFrame(() => O.current?.focus?.({ preventScroll: !0 }));
147
- }, [u, g, f]), G(() => {
148
- if (d && k) {
149
- S(0), C(!0);
150
- return;
151
- }
152
- }, [k, d, S]), /* @__PURE__ */ E(
153
- Z,
154
- {
155
- variant: x,
156
- expanded: B,
157
- ref: O,
158
- style: r,
159
- id: i,
160
- role: d ? "listbox" : void 0,
161
- tabIndex: g ? -1 : void 0,
162
- children: [
163
- f && /* @__PURE__ */ o(
164
- xe,
165
- {
166
- ...f,
167
- combobox: d,
168
- listId: i,
169
- "aria-activedescendant": d && R ? W?.id : void 0,
170
- onNavigate: d ? () => C(!0) : void 0,
171
- onChange: (n) => {
172
- C(!1), f.onChange?.(n);
173
- },
174
- onFocus: (n) => {
175
- C(!1), f.onFocus?.(n);
176
- },
177
- onInput: (n) => {
178
- C(!1), f.onInput?.(n);
179
- },
180
- onKeyDown: (n) => {
181
- const I = n.key === "ArrowUp" || n.key === "ArrowDown", $ = n.key.length === 1 || n.key === "Backspace" || n.key === "Delete";
182
- d && !I && $ && C(!1), f.onKeyDown?.(n);
183
- }
184
- }
185
- ),
186
- s.map((n, I) => {
187
- const $ = n?.props || {}, { title: z, hidden: q = !1, divider: X = !0 } = $;
188
- return /* @__PURE__ */ E(Ie, { children: [
189
- (v > 0 || I) && X ? /* @__PURE__ */ o(he, {}) : "",
190
- /* @__PURE__ */ o(me, { hidden: q, children: /* @__PURE__ */ E(Z, { role: "presentation", children: [
191
- z && /* @__PURE__ */ o(ye, { title: z, level: v }),
192
- n?.items.filter((H) => !H.props?.hidden).map((H, e) => {
193
- const { active: t, onMouseEnter: l } = H, { groupId: K, ...c } = H.props || {}, { expanded: L } = c, U = Array.isArray(c?.items) && c.items.length > 0, J = c.role === "checkbox" || c.role === "radio", ee = d && !J ? "option" : c.role;
194
- return /* @__PURE__ */ E(
195
- pe,
196
- {
197
- expanded: L,
198
- onMouseLeave: () => S(-1),
199
- role: d || J ? "presentation" : void 0,
200
- children: [
201
- /* @__PURE__ */ o(
202
- fe,
203
- {
204
- ...c,
205
- size: c?.size || $?.size || p,
206
- color: c?.color || $?.color || _,
207
- variant: c?.variant || $?.variant || x,
208
- active: t,
209
- role: ee,
210
- selected: c.selected,
211
- tabIndex: c?.disabled || g ? -1 : c.tabIndex ?? 0,
212
- onMouseEnter: l,
213
- "aria-haspopup": U ? "menu" : void 0,
214
- "aria-expanded": U ? L : void 0,
215
- "aria-controls": U ? c.id + "-menu" : void 0
216
- }
217
- ),
218
- L && c?.items && /* @__PURE__ */ o(
219
- ge,
220
- {
221
- id: c.id + "-menu",
222
- expanded: L,
223
- level: v + 1,
224
- maxLevels: b,
225
- items: c?.items,
226
- groups: w,
227
- size: p,
228
- color: _,
229
- variant: x
230
- }
231
- )
232
- ]
233
- },
234
- e
235
- );
236
- })
237
- ] }) }, I)
238
- ] }, I);
239
- })
240
- ]
241
- }
242
- );
243
- }, _e = (v) => {
244
- const b = j(null), B = j(null), [M, u] = Q(0), {
245
- search: h,
246
- items: A,
247
- groups: y = {},
248
- size: k,
249
- color: f,
250
- variant: a,
251
- keyboardEvents: w,
252
- scrollRefStyles: p = {},
253
- id: m,
254
- expanded: _,
255
- a11yMode: x = "menu",
256
- open: r,
257
- scrollToTopOnOpen: g = !1,
258
- autoActivateFirstItem: T = !0,
259
- announceNoResults: N = !1,
260
- onActiveItemIdChange: d
261
- } = v, i = x === "combobox", F = i && m ? `${m}-listbox` : m, P = j(r), [R, C] = Q(!1), Y = V(
262
- () => A.map((e, t) => ({
263
- ...e,
264
- id: e.id || `${m}-item-${t}`
265
- })),
266
- [A, m]
267
- ), { menu: O, activeItem: s, setActiveIndex: S, activeIndex: W } = de({
268
- items: Y,
269
- groups: y,
270
- groupByKey: "groupId",
271
- keyboardEvents: w,
272
- autoActivateFirstItem: T,
273
- ref: b
274
- }), { flatMenu: n, virtualizer: I, scrollMaxHeight: $ } = ve({
275
- menu: O,
276
- scrollRef: b
277
- });
278
- ne(() => {
279
- const e = B.current;
280
- if (!e) return;
281
- const t = Math.round(e.offsetTop);
282
- u((l) => l === t ? l : t);
283
- });
284
- const z = V(() => {
285
- const e = s?.id;
286
- if (e)
287
- return n.findIndex((l) => l.type === "item" && l.itemProps?.id === e);
288
- if (W < 0) return -1;
289
- let t = -1;
290
- for (let l = 0; l < n.length; l++)
291
- if (n[l]?.type === "item" && (t += 1, t === W))
292
- return l;
293
- return -1;
294
- }, [s?.id, W, n]), q = j(null);
295
- ne(() => {
296
- const e = q?.current, t = typeof e == "number" ? z <= e : !1;
297
- q.current = z;
298
- const l = t ? z : z + 2;
299
- if (!t) {
300
- const U = I.getOffsetForIndex(l, "auto");
301
- if (!U) return;
302
- const [J, ee] = U;
303
- if (ee === "auto") return;
304
- I.scrollToOffset(J + M + 10, { align: "start" });
305
- return;
306
- }
307
- if (z <= 3) {
308
- I.scrollToOffset(0);
309
- return;
310
- }
311
- const K = I.getOffsetForIndex(z - 1, "auto");
312
- if (!K) return;
313
- const [c, L] = K;
314
- L !== "auto" && I.scrollToOffset(c + M + 10, { align: "start" });
315
- }, [z, M, I, q]);
316
- const X = V(() => {
317
- const e = /* @__PURE__ */ new Map();
318
- let t = 0;
319
- return n.forEach((l, K) => {
320
- l.type === "item" && (t += 1, e.set(K, t));
321
- }), { positions: e, total: t };
322
- }, [n]);
323
- G(() => {
324
- d?.(s?.id);
325
- }, [s?.id, d]), G(() => {
326
- if (i && N) {
327
- S(0), C(!0);
328
- return;
329
- }
330
- }, [N, i, S]), G(() => {
331
- if (!g) {
332
- P.current = r;
333
- return;
334
- }
335
- const e = P.current;
336
- P.current = r, r && !e && b.current?.scrollTo({ top: 0 });
337
- }, [r, g]);
338
- const H = {
339
- position: "relative",
340
- maxHeight: p?.maxHeight || $,
341
- margin: "-0.5rem",
342
- padding: "0.5rem",
343
- minWidth: p?.minWidth ?? "20rem",
344
- overflowY: "auto",
345
- ...p
346
- };
347
- return /* @__PURE__ */ E(
348
- Z,
349
- {
350
- ref: b,
351
- style: H,
352
- variant: a,
353
- color: f,
354
- expanded: _,
355
- id: F,
356
- role: i ? "listbox" : void 0,
357
- children: [
358
- h && /* @__PURE__ */ o(
359
- xe,
360
- {
361
- ...h,
362
- combobox: i,
363
- listId: F,
364
- "aria-activedescendant": i && R ? s?.id : void 0,
365
- onNavigate: i ? () => C(!0) : void 0,
366
- onChange: (e) => {
367
- C(!1), h.onChange?.(e);
368
- },
369
- onFocus: (e) => {
370
- C(!1), h.onFocus?.(e);
371
- },
372
- onInput: (e) => {
373
- C(!1), h.onInput?.(e);
374
- },
375
- onKeyDown: (e) => {
376
- const t = e.key === "ArrowUp" || e.key === "ArrowDown", l = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete";
377
- i && !t && l && C(!1), h.onKeyDown?.(e);
378
- }
379
- }
380
- ),
381
- /* @__PURE__ */ o(
382
- me,
383
- {
384
- ref: B,
385
- style: {
386
- position: "relative",
387
- height: `${I.getTotalSize()}px`,
388
- width: "100%"
389
- },
390
- children: /* @__PURE__ */ o(Z, { style: { width: "100%", minWidth: "100%" }, children: I.getVirtualItems().map((e) => {
391
- const t = n[e.index];
392
- if (!t) return null;
393
- const l = {
394
- position: "absolute",
395
- top: 0,
396
- left: 0,
397
- width: "100%",
398
- transform: `translateY(${e.start}px)`
399
- }, K = {
400
- style: l,
401
- index: e.index,
402
- "data-index": e.index,
403
- ref: I.measureElement
404
- };
405
- switch (t.type) {
406
- case "divider":
407
- return /* @__PURE__ */ o(
408
- he,
409
- {
410
- ...K,
411
- style: { ...l, padding: "0.25rem 0" }
412
- },
413
- e.key
414
- );
415
- case "header":
416
- return /* @__PURE__ */ o(ye, { ...K, title: t.title || "", level: 1 }, e.key);
417
- default: {
418
- const c = t.itemProps?.role === "checkbox" || t.itemProps?.role === "radio", L = i && !c ? "option" : t.itemProps?.role;
419
- return /* @__PURE__ */ o(
420
- pe,
421
- {
422
- ...K,
423
- role: i || c ? "presentation" : "menuitem",
424
- children: /* @__PURE__ */ o(
425
- fe,
426
- {
427
- ...t.itemProps || {},
428
- size: t.itemProps?.size || k,
429
- color: t.itemProps?.color || f,
430
- variant: t.itemProps?.variant || a,
431
- active: t.active,
432
- role: L,
433
- selected: t.itemProps?.selected,
434
- "aria-posinset": i ? X.positions.get(e.index) : void 0,
435
- "aria-setsize": i ? X.total : void 0,
436
- tabIndex: t.itemProps?.disabled || w ? -1 : 0
437
- }
438
- )
439
- },
440
- e.key
441
- );
442
- }
443
- }
444
- }) })
445
- }
446
- )
447
- ]
448
- }
449
- );
450
- }, Me = ({
451
- searchable: v,
452
- search: b,
453
- items: B = [],
454
- groups: M = {},
455
- variant: u = "default",
456
- size: h,
457
- level: A = 0,
458
- maxLevels: y = 3,
459
- virtualized: k = !1,
460
- keyboardEvents: f = !1,
461
- scrollRefStyles: a = {},
462
- onActiveItemIdChange: w,
463
- a11yMode: p = "menu",
464
- open: m,
465
- scrollToTopOnOpen: _,
466
- autoFocusList: x,
467
- id: r
468
- }) => {
469
- const g = be({ ...b, items: B, groups: M }), T = v ? g.search : b, N = v && g.hasQuery && g.resultCount === 0, d = v ? g.items : B, i = v ? { ...M, ...g.groups } : M, F = p !== "combobox";
470
- return k ? /* @__PURE__ */ o(
471
- _e,
472
- {
473
- id: r,
474
- search: T,
475
- announceNoResults: N,
476
- items: d,
477
- groups: i,
478
- variant: u,
479
- size: h,
480
- level: A,
481
- maxLevels: y,
482
- keyboardEvents: f,
483
- scrollRefStyles: a,
484
- onActiveItemIdChange: w,
485
- a11yMode: p,
486
- open: m,
487
- scrollToTopOnOpen: _,
488
- autoActivateFirstItem: F,
489
- autoFocusList: x
490
- }
491
- ) : /* @__PURE__ */ o(
492
- ge,
493
- {
494
- id: r,
495
- search: T,
496
- announceNoResults: N,
497
- items: d,
498
- groups: i,
499
- variant: u,
500
- size: h,
501
- level: A,
502
- maxLevels: y,
503
- keyboardEvents: f,
504
- scrollRefStyles: a,
505
- onActiveItemIdChange: w,
506
- a11yMode: p,
507
- open: m,
508
- scrollToTopOnOpen: _,
509
- autoActivateFirstItem: F,
510
- autoFocusList: x
511
- }
512
- );
513
- }, Ae = "_fieldContainer_1986v_1", De = "_field_1986v_1", Be = "_icon_1986v_15", Ne = "_input_1986v_9", Fe = "_clear_1986v_61", Se = "_clearButton_1986v_74", ze = "_autocomplete_1986v_103", D = {
514
- fieldContainer: Ae,
515
- field: De,
516
- icon: Be,
517
- input: Ne,
518
- clear: Fe,
519
- clearButton: Se,
520
- autocomplete: ze
521
- }, ue = ({
522
- className: v,
523
- collapsible: b,
524
- loading: B,
525
- loadingLabel: M = "Loading ...",
526
- size: u,
527
- color: h = "neutral",
528
- label: A,
529
- value: y,
530
- onClear: k,
531
- clearButtonAltText: f = "Clear search",
532
- menu: a,
533
- minLength: w,
534
- ...p
535
- }) => {
536
- const m = re(), [_, x] = Q(!1), r = p.id || `search-field-${m}`, g = `${r}-listbox`, [T, N] = Q(void 0), d = "searchfield-clear-button-" + re(), i = V(() => !a || !y || typeof w == "number" && typeof y == "string" && y.length < w ? !1 : _, [a, _, w, y]), F = V(() => (a?.items ?? []).map((s) => ({
537
- ...s,
538
- onClick: () => {
539
- s.onClick?.(), x(!1);
540
- }
541
- })), [a]), P = (s) => {
542
- if (s.key === "Enter" && i) {
543
- a?.items?.[0]?.onClick?.(), x(!1);
544
- return;
545
- }
546
- if (s.key === "Escape" && i) {
547
- s.preventDefault(), s.stopPropagation(), x(!1), a?.onClose(), document.getElementById(r)?.focus();
548
- return;
549
- }
550
- p.onKeyDown?.(s), x(!0);
551
- }, R = () => {
552
- x(!0);
553
- }, C = (s) => {
554
- if (!_) return;
555
- const S = s.relatedTarget;
556
- S && s.currentTarget.contains(S) || x(!1);
557
- }, Y = (s) => {
558
- s.preventDefault();
559
- }, O = (s) => {
560
- s.relatedTarget?.id === d && N(void 0), p.onBlur?.(s);
561
- };
562
- return a ? /* @__PURE__ */ E("div", { className: D.fieldContainer, children: [
563
- /* @__PURE__ */ E(
564
- se,
565
- {
566
- size: u,
567
- color: h,
568
- label: A,
569
- className: oe(D.field, v),
570
- onBlurCapture: C,
571
- children: [
572
- /* @__PURE__ */ o(
573
- ie,
574
- {
575
- ...p,
576
- id: r,
577
- type: "search",
578
- value: y,
579
- className: D.input,
580
- "data-collapsible": b,
581
- autoCapitalize: "off",
582
- autoComplete: "off",
583
- minLength: w,
584
- onKeyDown: P,
585
- onBlur: O,
586
- ...a && {
587
- role: "combobox",
588
- "aria-autocomplete": "list",
589
- "aria-expanded": !!i,
590
- "aria-haspopup": "listbox",
591
- "aria-controls": g,
592
- "aria-activedescendant": i ? T : void 0,
593
- onFocus: R
594
- }
595
- }
596
- ),
597
- /* @__PURE__ */ o(ce, { className: D.icon }),
598
- k && !!y && /* @__PURE__ */ o("span", { className: D.clear, children: /* @__PURE__ */ o(
599
- ae,
600
- {
601
- id: d,
602
- "data-testid": "clear-button",
603
- size: "xs",
604
- rounded: !0,
605
- icon: !0,
606
- variant: "tinted",
607
- className: D.clearButton,
608
- onClick: () => {
609
- k?.(), document.getElementById(r)?.focus();
610
- },
611
- "aria-label": f,
612
- "data-action": "clear-input",
613
- children: /* @__PURE__ */ o(le, {})
614
- }
615
- ) })
616
- ]
617
- }
618
- ),
619
- a && i && /* @__PURE__ */ o("div", { className: D.autocomplete, "aria-hidden": !i, onMouseDown: Y, children: /* @__PURE__ */ o(
620
- Me,
621
- {
622
- ...a,
623
- id: g,
624
- items: F,
625
- groups: a?.groups,
626
- keyboardEvents: !0,
627
- a11yMode: "combobox",
628
- open: i,
629
- autoFocusList: !1,
630
- onActiveItemIdChange: N
631
- }
632
- ) })
633
- ] }) : /* @__PURE__ */ E(
634
- se,
635
- {
636
- size: u,
637
- color: h,
638
- label: A,
639
- className: oe(D.field, v),
640
- onBlurCapture: C,
641
- children: [
642
- /* @__PURE__ */ o(
643
- ie,
644
- {
645
- ...p,
646
- id: r,
647
- type: "search",
648
- value: y,
649
- className: D.input,
650
- "data-collapsible": b,
651
- autoCapitalize: "off",
652
- autoComplete: "off",
653
- minLength: w,
654
- onKeyDown: P,
655
- onBlur: O
656
- }
657
- ),
658
- B ? /* @__PURE__ */ o(we, { "aria-hidden": !0, className: D.icon }) : /* @__PURE__ */ o(ce, { "aria-hidden": !0, className: D.icon }),
659
- k && !!y && /* @__PURE__ */ o("span", { className: D.clear, children: /* @__PURE__ */ o(
660
- ae,
661
- {
662
- id: d,
663
- "data-testid": "clear-button",
664
- size: "xs",
665
- rounded: !0,
666
- icon: !0,
667
- variant: "tinted",
668
- className: D.clearButton,
669
- onClick: () => {
670
- k?.(), document.getElementById(r)?.focus();
671
- },
672
- "aria-label": f,
673
- "data-action": "clear-input",
674
- children: /* @__PURE__ */ o(le, {})
675
- }
676
- ) })
677
- ]
678
- }
679
- );
680
- };
681
- export {
682
- Me as M,
683
- ue as S,
684
- _e as V,
685
- ge as a,
686
- xe as b
687
- };
@@ -1,24 +0,0 @@
1
- "use client";
2
- import a, { forwardRef as i } from "react";
3
- import { u as f } from "./useId-BVFxCjkq.js";
4
- var d = function(t, n) {
5
- var l = {};
6
- for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (l[e] = t[e]);
7
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
8
- for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
9
- n.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
10
- return l;
11
- };
12
- const p = i((t, n) => {
13
- var { title: l, titleId: e } = t, r = d(t, ["title", "titleId"]);
14
- let o = f();
15
- return o = l ? e || "title-" + o : void 0, a.createElement(
16
- "svg",
17
- 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: n, "aria-labelledby": o }, r),
18
- l ? a.createElement("title", { id: o }, l) : null,
19
- a.createElement("path", { fill: "currentColor", d: "M6.53 5.47a.75.75 0 0 0-1.06 1.06L10.94 12l-5.47 5.47a.75.75 0 1 0 1.06 1.06L12 13.06l5.47 5.47a.75.75 0 1 0 1.06-1.06L13.06 12l5.47-5.47a.75.75 0 0 0-1.06-1.06L12 10.94z" })
20
- );
21
- });
22
- export {
23
- p as S
24
- };
@@ -1 +0,0 @@
1
- ._byline_fzp7k_1{display:inline-flex;align-items:center;column-gap:.5em}._avatar_fzp7k_7,._avatarGroup_fzp7k_12{font-size:1.25rem;flex-shrink:0}._avatar_fzp7k_7[data-size=md]{font-size:1.5rem;flex-shrink:0}._avatar_fzp7k_7[data-size=lg]{font-size:2.25rem}._label_fzp7k_26{display:inline-flex;flex-wrap:wrap;column-gap:.25em;color:var(--ds-color-text-subtle)}._label_fzp7k_26[data-size=xs],._label_fzp7k_26[data-size=sm]{font-size:14px;line-height:1.125rem;padding:.1875rem 0}._label_fzp7k_26[data-size=md],._label_fzp7k_26[data-size=lg]{font-size:16px;line-height:1.25rem}._label_fzp7k_26>strong{font-weight:500;color:var(--ds-color-text-default)}