@altinn/altinn-components 0.57.3 → 0.58.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.
- package/README.md +33 -0
- package/dist/Section-DvBigBR1.js +2226 -0
- package/dist/assets/BookmarkSettingsItemLabel.css +1 -1
- package/dist/assets/DialogContact.css +1 -0
- package/dist/assets/DialogHeader.css +1 -0
- package/dist/assets/DialogLayout.css +1 -0
- package/dist/assets/DialogSection.css +1 -0
- package/dist/assets/Link.css +1 -0
- package/dist/assets/Section.css +1 -1
- package/dist/assets/SettingsItemBase.css +1 -1
- package/dist/components/AccessAreaListItem/AccessAreaListItem.js +17 -16
- package/dist/components/AccessPackageListItem/AccessPackageListItem.js +9 -8
- package/dist/components/Account/AccountList.js +7 -6
- package/dist/components/Account/AccountListItem.js +8 -7
- package/dist/components/Account/AccountListItemControls.js +11 -10
- package/dist/components/Account/AccountListItemDetails.js +12 -11
- package/dist/components/Account/AccountListVirtual.js +4 -3
- package/dist/components/Account/AccountMenu.js +11 -10
- package/dist/components/Account/AccountNotificationSettings.js +10 -9
- package/dist/components/Account/AccountOrganization.js +15 -14
- package/dist/components/AccountSelector/AccountSelector.js +10 -9
- package/dist/components/ActivityLog/ActivityLog.js +4 -3
- package/dist/components/ActivityLog/ActivityLogItem.js +4 -3
- package/dist/components/ActivityLog/ActivityLogSegment.js +4 -3
- package/dist/components/Alert/Alert.js +8 -7
- package/dist/components/Article/Article.js +4 -3
- package/dist/components/Article/ArticleContact.js +4 -3
- package/dist/components/Article/ArticleHeader.js +4 -3
- package/dist/components/Attachment/AttachmentLink.js +1 -1
- package/dist/components/Banner/Banner.js +6 -5
- package/dist/components/Bookmarks/BookmarkModal.js +7 -6
- package/dist/components/Bookmarks/BookmarkSettingsItem.js +4 -3
- package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +12 -11
- package/dist/components/Bookmarks/BookmarkSettingsList.js +9 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.js +4 -3
- package/dist/components/Bulk/BulkButton.js +11 -11
- package/dist/components/Bulk/BulkHeader.js +8 -7
- package/dist/components/Button/ButtonIcon.js +4 -3
- package/dist/components/Button/ComboButton.js +4 -3
- package/dist/components/Button/FloatingActionButton.js +8 -7
- package/dist/components/Button/IconButton.js +5 -4
- package/dist/components/Byline/Byline.js +3 -2
- package/dist/components/Byline/index.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +28 -24
- package/dist/components/Dashboard/DashboardCard.js +7 -6
- package/dist/components/Dashboard/DashboardHeader.js +9 -8
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/DatepickerHeader.js +4 -3
- package/dist/components/Datepicker/DatepickerTable.js +11 -10
- package/dist/components/Dialog/Dialog.js +25 -31
- package/dist/components/Dialog/DialogActions.js +4 -3
- package/dist/components/Dialog/DialogActivityLog.js +4 -3
- package/dist/components/Dialog/DialogAttachments.js +6 -5
- package/dist/components/Dialog/DialogBody.js +8 -7
- package/dist/components/Dialog/DialogByline.js +3 -2
- package/dist/components/Dialog/DialogContact.js +47 -11
- package/dist/components/Dialog/DialogHeader.js +31 -28
- package/dist/components/Dialog/DialogHistory.js +7 -6
- package/dist/components/Dialog/DialogHistoryItem.js +4 -3
- package/dist/components/Dialog/DialogHistorySegment.js +8 -7
- package/dist/components/Dialog/DialogLayout.js +21 -20
- package/dist/components/Dialog/DialogList.js +3 -2
- package/dist/components/Dialog/DialogListGroup.js +3 -2
- package/dist/components/Dialog/DialogListItem.js +3 -2
- package/dist/components/Dialog/DialogMetadata.js +3 -2
- package/dist/components/Dialog/DialogSection.js +10 -7
- package/dist/components/Dialog/DialogSeenBy.js +4 -3
- package/dist/components/Dialog/DialogSelect.js +10 -9
- package/dist/components/Dialog/DialogStatus.js +4 -3
- package/dist/components/Dialog/DialogTabs.js +4 -3
- package/dist/components/Dialog/SeenByLog.js +4 -3
- package/dist/components/Dialog/SeenByLogButton.js +7 -6
- package/dist/components/Dialog/SeenByLogItem.js +12 -11
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +4 -3
- package/dist/components/Dropdown/DrawerHeader.js +8 -7
- package/dist/components/Dropdown/Dropdown.js +3 -2
- package/dist/components/Dropdown/DropdownBase.js +8 -7
- package/dist/components/Dropdown/FloatingDropdown.js +19 -18
- package/dist/components/Dropdown/index.js +5 -7
- package/dist/components/DsComponents/index.js +21 -20
- package/dist/components/Forms/Checkbox.js +4 -3
- package/dist/components/Forms/CheckboxOptions.js +4 -3
- package/dist/components/Forms/FieldBase.js +3 -2
- package/dist/components/Forms/FieldsetBase.js +4 -3
- package/dist/components/Forms/Radio.js +4 -3
- package/dist/components/Forms/RadioOptions.js +4 -3
- package/dist/components/Forms/SearchField.js +3 -2
- package/dist/components/Forms/SelectField.js +5 -4
- package/dist/components/Forms/Switch.js +6 -5
- package/dist/components/Forms/SwitchOptions.js +4 -3
- package/dist/components/Forms/TextField.js +4 -3
- package/dist/components/Forms/TextFieldDropdown.js +4 -3
- package/dist/components/Forms/TextareaField.js +4 -3
- package/dist/components/Forms/index.js +1 -1
- package/dist/components/GlobalHeader/GlobalAccountButton.js +8 -7
- package/dist/components/GlobalHeader/GlobalHeader.js +10 -9
- package/dist/components/GlobalHeader/GlobalMenuButton.js +4 -3
- package/dist/components/GlobalHeader/HeaderDrawer.js +9 -8
- package/dist/components/GlobalHeader/HeaderDropdown.js +6 -5
- package/dist/components/GlobalHeader/HeaderLogo.js +8 -7
- package/dist/components/GlobalMenu/GlobalMenu.js +10 -9
- package/dist/components/GlobalMenu/LocaleSwitcher.js +13 -12
- package/dist/components/GlobalMenu/LogoutButton.js +4 -3
- package/dist/components/GlobalMenu_old/BackButton.js +4 -3
- package/dist/components/GlobalMenu_old/CurrentAccount.js +4 -3
- package/dist/components/GlobalMenu_old/GlobalMenu.js +10 -9
- package/dist/components/GlobalMenu_old/GlobalMenuButton.js +12 -11
- package/dist/components/GlobalMenu_old/LogoutButton.js +4 -3
- package/dist/components/Header/Header.js +4 -3
- package/dist/components/Header/HeaderBase.js +7 -6
- package/dist/components/Header/HeaderButton.js +18 -17
- package/dist/components/Header/LocaleButton.js +12 -11
- package/dist/components/Header/LocaleSwitcher.js +9 -8
- package/dist/components/Icon/Icon.js +4 -3
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Inbox/InboxPage.js +8 -7
- package/dist/components/InboxSearch/InboxSearch.js +10 -9
- package/dist/components/Item/ItemLabel.js +2 -1
- package/dist/components/Item/ItemMedia.js +3 -2
- package/dist/components/Item/ItemSelect.js +3 -2
- package/dist/components/Item/index.js +1 -1
- package/dist/components/Layout/Layout.js +8 -7
- package/dist/components/List/List.js +3 -2
- package/dist/components/List/ListBase.js +4 -3
- package/dist/components/List/ListItem.js +1 -1
- package/dist/components/List/ListItemHeader.js +3 -2
- package/dist/components/List/ListItemIcon.js +3 -2
- package/dist/components/List/ListItemLabel.js +4 -3
- package/dist/components/List/index.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItem.js +3 -2
- package/dist/components/Menu/MenuItems.js +3 -2
- package/dist/components/Menu/MenuListSearch.js +3 -2
- package/dist/components/Menu/MenuOption.js +1 -1
- package/dist/components/Menu/TabMenu.js +7 -6
- package/dist/components/Menu/VirtualizedMenuItems.js +3 -2
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/useMenuSearch.js +1 -1
- package/dist/components/Metadata/MetaItem.js +3 -2
- package/dist/components/Metadata/MetaItemIcon.js +3 -2
- package/dist/components/Metadata/MetaProgress.js +3 -2
- package/dist/components/Metadata/MetaTimestamp.js +3 -2
- package/dist/components/Metadata/Metadata.js +9 -8
- package/dist/components/Metadata/index.js +1 -1
- package/dist/components/Modal/Modal.js +8 -7
- package/dist/components/Modal/ModalBase.js +25 -24
- package/dist/components/Modal/ModalHeader.js +10 -9
- package/dist/components/Modal/ModalIcon.js +4 -3
- package/dist/components/Notifications/NotificationItem.js +4 -3
- package/dist/components/Notifications/NotificationItemBase.js +4 -3
- package/dist/components/Notifications/NotificationItemControls.js +6 -5
- package/dist/components/Notifications/NotificationItemIcon.js +15 -14
- package/dist/components/Page/AccordionSection.js +4 -3
- package/dist/components/Page/ContactButtons.js +7 -6
- package/dist/components/Page/ContactSection.js +7 -6
- package/dist/components/Page/PageMenu.js +11 -10
- package/dist/components/Page/PageNav.js +7 -6
- package/dist/components/Page/Section.js +3 -2
- package/dist/components/Page/index.js +1 -1
- package/dist/components/ResourceListItem/ResourceListItem.js +8 -7
- package/dist/components/RootProvider/RootProvider.js +4 -3
- package/dist/components/RootProvider/index.js +1 -1
- package/dist/components/Search/SearchItem.js +7 -6
- package/dist/components/Searchbar/Autocomplete.js +9 -8
- package/dist/components/Searchbar/AutocompleteItem.js +6 -5
- package/dist/components/Searchbar/Searchbar.js +4 -3
- package/dist/components/Searchbar/SearchbarField.js +4 -3
- package/dist/components/Settings/SettingsItem.js +75 -69
- package/dist/components/Settings/SettingsItemBase.js +67 -39
- package/dist/components/Settings/SettingsList.js +12 -11
- package/dist/components/Settings/SettingsModal.js +7 -6
- package/dist/components/Settings/SettingsSection.js +10 -9
- package/dist/components/Settings/UsedByLog.js +4 -3
- package/dist/components/Settings/UsedByLogItem.js +10 -9
- package/dist/components/Snackbar/SnackbarItem.js +16 -15
- package/dist/components/Timeline/Timeline.js +4 -3
- package/dist/components/Timeline/TimelineActivity.js +4 -3
- package/dist/components/Timeline/TimelineBase.js +4 -3
- package/dist/components/Timeline/TimelineFooter.js +7 -6
- package/dist/components/Timeline/TimelineHeader.js +4 -3
- package/dist/components/Timeline/TimelineIcon.js +6 -5
- package/dist/components/Timeline/TimelineSection.js +4 -3
- package/dist/components/Timeline/TimelineSegment.js +7 -6
- package/dist/components/Toolbar/DatepickerFilter.js +4 -3
- package/dist/components/Toolbar/SelectDateFilter.js +8 -7
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +11 -10
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +18 -17
- package/dist/components/Toolbar/ToolbarFilterButton.js +4 -3
- package/dist/components/Toolbar/ToolbarFilterMenu.js +11 -10
- package/dist/components/Toolbar/ToolbarMenu.js +3 -2
- package/dist/components/Toolbar/ToolbarSearch.js +3 -2
- package/dist/components/Toolbar/index.js +1 -1
- package/dist/components/Transmission/Transmission.js +9 -8
- package/dist/components/Transmission/TransmissionList.js +6 -5
- package/dist/components/Transmission/TransmissionType.js +4 -3
- package/dist/components/Typography/Heading.js +3 -2
- package/dist/components/Typography/Link.js +11 -0
- package/dist/components/Typography/index.js +4 -2
- package/dist/components/UserListItem/UserListItem.js +9 -8
- package/dist/components/index.js +255 -254
- package/dist/hooks/useAccountSelector.js +18 -17
- package/dist/index.js +246 -245
- package/dist/link-D1SA3LCe.js +10 -0
- package/dist/{textfield-CRXtg-r5.js → textfield-f4Za2qt6.js} +428 -431
- package/dist/types/lib/components/Bulk/Bulk.stories.d.ts +4 -1
- package/dist/types/lib/components/Bulk/BulkButton.d.ts +2 -1
- package/dist/types/lib/components/ContextMenu/ContextMenu.d.ts +3 -2
- package/dist/types/lib/components/Dialog/DialogContact.d.ts +12 -3
- package/dist/types/lib/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/types/lib/components/Dropdown/Dropdown.stories.d.ts +1 -2
- package/dist/types/lib/components/Dropdown/index.d.ts +0 -1
- package/dist/types/lib/components/Forms/SearchField.stories.d.ts +1 -0
- package/dist/types/lib/components/Menu/VirtualizedMenu.stories.d.ts +24 -3
- package/dist/types/lib/components/Settings/SettingsItem.d.ts +1 -1
- package/dist/types/lib/components/Settings/SettingsItemBase.d.ts +16 -10
- package/dist/types/lib/components/Typography/Link.d.ts +11 -0
- package/dist/types/lib/components/Typography/index.d.ts +1 -0
- package/dist/types/lib/stories/Profile.stories.d.ts +1 -0
- package/dist/types/lib/test-utils/screenshot-compare.d.ts +49 -0
- package/package.json +10 -3
- package/dist/Section-xbt3ft20.js +0 -2265
- package/dist/assets/DrawerOrDropdown.css +0 -1
- package/dist/components/Dropdown/DrawerOrDropdown.js +0 -42
- package/dist/types/lib/components/Dropdown/DrawerOrDropdown.d.ts +0 -11
- package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +0 -67
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import
|
|
3
|
+
import le, { forwardRef as A, useState as ye, useRef as ve, useEffect as ce, createContext as De, useContext as oe, useMemo as ze, useLayoutEffect as jn, useReducer as Vr, useId as Ve, isValidElement as $n, memo as Br, useCallback as jr, Children as fn, version as $r } from "react";
|
|
4
4
|
import { jsx as v, jsxs as ie, Fragment as Ut } from "react/jsx-runtime";
|
|
5
|
-
import { c as
|
|
6
|
-
import { S as se, a as Kr } from "./index-D7FJjvrv.js";
|
|
5
|
+
import { c as G } from "./lite-1fxw3LjI.js";
|
|
7
6
|
import * as Kn from "react-dom";
|
|
8
7
|
import { flushSync as Wn } from "react-dom";
|
|
9
|
-
import { S as
|
|
10
|
-
import { V as Xt, u as Gt, F as pt, a as
|
|
8
|
+
import { S as Kr, B as Ye, u as Wr } from "./button-BB5sYVKY.js";
|
|
9
|
+
import { V as Xt, u as Gt, F as pt, a as qr, b as Hr, c as hn } from "./index-z82sbSVU.js";
|
|
11
10
|
import { P as jt } from "./paragraph-BRiIBpbY.js";
|
|
11
|
+
import { S as ue, a as Ur } from "./index-D7FJjvrv.js";
|
|
12
12
|
import { I as ot } from "./input-wBv_FkEV.js";
|
|
13
13
|
import { L as Te } from "./label-xTmTyPhk.js";
|
|
14
|
-
import { f as qn, b as Xr, o as Hn, c as Un, g as
|
|
14
|
+
import { f as qn, b as Xr, o as Hn, c as Un, g as kt, a as Xn, s as Gr } from "./floating-ui.dom-bEgaHJCq.js";
|
|
15
15
|
import { u as Be } from "./use-merge-refs-Cj4kTYVj.js";
|
|
16
16
|
import { T as Yr } from "./textarea-BBstVlPT.js";
|
|
17
17
|
const qe = (e, r) => {
|
|
@@ -33,13 +33,13 @@ const qe = (e, r) => {
|
|
|
33
33
|
focusableValue: null,
|
|
34
34
|
orientation: "horizontal"
|
|
35
35
|
}), Zr = A(({ activeValue: e, asChild: r, orientation: t = "horizontal", onBlur: n, onFocus: o, ...i }, s) => {
|
|
36
|
-
const a = r ?
|
|
36
|
+
const a = r ? ue : "div", l = e ?? null, [c, f] = ye(l), [d, h] = ye(!1), u = ve(/* @__PURE__ */ new Map()), m = ve(null), g = Be([s, m]), C = () => {
|
|
37
37
|
if (!m.current)
|
|
38
38
|
return [];
|
|
39
39
|
const x = Array.from(m.current.querySelectorAll("[data-roving-tabindex-item]"));
|
|
40
40
|
return Array.from(u.current).sort((y, b) => x.indexOf(y[1]) - x.indexOf(b[1])).map(([y, b]) => ({ value: y, element: b }));
|
|
41
41
|
};
|
|
42
|
-
return
|
|
42
|
+
return ce(() => {
|
|
43
43
|
f(l);
|
|
44
44
|
}, [l]), v(Gn.Provider, { value: {
|
|
45
45
|
elements: u,
|
|
@@ -92,7 +92,7 @@ function Pt(e, r) {
|
|
|
92
92
|
return e.at(t === 0 ? -1 : t - 1);
|
|
93
93
|
}
|
|
94
94
|
const Qr = A(({ value: e, asChild: r, ...t }, n) => {
|
|
95
|
-
const o = r ?
|
|
95
|
+
const o = r ? ue : "div", i = e ?? (typeof t.children == "string" ? t.children : ""), { getOrderedItems: s, getRovingProps: a, orientation: l } = Jr(i), c = a({
|
|
96
96
|
onKeyDown: (d) => {
|
|
97
97
|
t?.onKeyDown?.(d);
|
|
98
98
|
const h = s();
|
|
@@ -114,7 +114,7 @@ const Qr = A(({ value: e, asChild: r, ...t }, n) => {
|
|
|
114
114
|
}), eo = (e, r, t) => {
|
|
115
115
|
const n = (t - 1) / 2, o = Math.max(1, Math.min(Math.max(e - Math.floor(n), 1), r - t + 1)), i = Math.min(Math.max(e + Math.ceil(n), t), r), s = Array.from({ length: i + 1 - o }, (a, l) => l + o);
|
|
116
116
|
return t > 4 && o > 1 && s.splice(0, 2, 1, 0), t > 3 && i < r && s.splice(-2, 2, 0, r), s;
|
|
117
|
-
},
|
|
117
|
+
}, Ps = ({ currentPage: e = 1, setCurrentPage: r, onChange: t, totalPages: n = 1, showPages: o = 7 }) => ze(() => {
|
|
118
118
|
const i = e < n, s = e !== 1, a = (l) => (c) => {
|
|
119
119
|
if (l < 1 || l > n)
|
|
120
120
|
return c.preventDefault();
|
|
@@ -161,13 +161,11 @@ const Qr = A(({ value: e, asChild: r, ...t }, n) => {
|
|
|
161
161
|
hasNext: i
|
|
162
162
|
};
|
|
163
163
|
}, [e, n, o]), to = A(function({ className: r, count: t, maxCount: n, variant: o = "base", ...i }, s) {
|
|
164
|
-
return v("span", { className:
|
|
164
|
+
return v("span", { className: G("ds-badge", r), "data-count": t && n && t > n ? `${n}+` : t, "data-variant": o, ref: s, ...i });
|
|
165
165
|
}), no = A(function({ className: r, overlap: t = "rectangle", placement: n = "top-right", ...o }, i) {
|
|
166
|
-
return v("span", { className:
|
|
166
|
+
return v("span", { className: G("ds-badge--position", r), "data-overlap": t, "data-placement": n, ref: i, ...o });
|
|
167
167
|
}), ro = Object.assign(to, { Position: no });
|
|
168
168
|
ro.Position.displayName = "Badge.Position";
|
|
169
|
-
const oo = A(({ asChild: e, className: r, ...t }, n) => v(e ? se : "a", { className: X("ds-link", r), ref: n, ...t }));
|
|
170
|
-
oo.displayName = "Link";
|
|
171
169
|
function Ct() {
|
|
172
170
|
return typeof window < "u";
|
|
173
171
|
}
|
|
@@ -178,7 +176,7 @@ function it(e) {
|
|
|
178
176
|
var r;
|
|
179
177
|
return (e == null || (r = e.ownerDocument) == null ? void 0 : r.defaultView) || window;
|
|
180
178
|
}
|
|
181
|
-
function
|
|
179
|
+
function oo(e) {
|
|
182
180
|
var r;
|
|
183
181
|
return (r = (Yn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : r.documentElement;
|
|
184
182
|
}
|
|
@@ -197,10 +195,10 @@ function $t(e) {
|
|
|
197
195
|
function mn(e) {
|
|
198
196
|
return ["html", "body", "#document"].includes(Et(e));
|
|
199
197
|
}
|
|
200
|
-
function
|
|
198
|
+
function io(e) {
|
|
201
199
|
return it(e).getComputedStyle(e);
|
|
202
200
|
}
|
|
203
|
-
function
|
|
201
|
+
function so(e) {
|
|
204
202
|
if (Et(e) === "html")
|
|
205
203
|
return e;
|
|
206
204
|
const r = (
|
|
@@ -208,7 +206,7 @@ function ao(e) {
|
|
|
208
206
|
e.assignedSlot || // DOM Element detected.
|
|
209
207
|
e.parentNode || // ShadowRoot detected.
|
|
210
208
|
$t(e) && e.host || // Fallback.
|
|
211
|
-
|
|
209
|
+
oo(e)
|
|
212
210
|
);
|
|
213
211
|
return $t(r) ? r.host : r;
|
|
214
212
|
}
|
|
@@ -254,7 +252,7 @@ function Qn(e) {
|
|
|
254
252
|
return e.mozInputSource === 0 && e.isTrusted ? !0 : Kt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
255
253
|
}
|
|
256
254
|
function er(e) {
|
|
257
|
-
return
|
|
255
|
+
return lo() ? !1 : !Kt() && e.width === 0 && e.height === 0 || Kt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
258
256
|
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
259
257
|
}
|
|
260
258
|
function tr() {
|
|
@@ -264,16 +262,16 @@ function Kt() {
|
|
|
264
262
|
const e = /android/i;
|
|
265
263
|
return e.test(Zn()) || e.test(Jn());
|
|
266
264
|
}
|
|
267
|
-
function
|
|
265
|
+
function ao() {
|
|
268
266
|
return Zn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
269
267
|
}
|
|
270
|
-
function
|
|
268
|
+
function lo() {
|
|
271
269
|
return Jn().includes("jsdom/");
|
|
272
270
|
}
|
|
273
|
-
function
|
|
271
|
+
function co(e) {
|
|
274
272
|
return "nativeEvent" in e;
|
|
275
273
|
}
|
|
276
|
-
function
|
|
274
|
+
function uo(e) {
|
|
277
275
|
return e.matches("html,body");
|
|
278
276
|
}
|
|
279
277
|
function be(e) {
|
|
@@ -290,18 +288,18 @@ function Dt(e, r) {
|
|
|
290
288
|
function Le(e) {
|
|
291
289
|
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
292
290
|
}
|
|
293
|
-
const
|
|
294
|
-
function
|
|
295
|
-
return Oe(e) && e.matches(
|
|
291
|
+
const fo = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
292
|
+
function ho(e) {
|
|
293
|
+
return Oe(e) && e.matches(fo);
|
|
296
294
|
}
|
|
297
295
|
function fe(e) {
|
|
298
296
|
e.preventDefault(), e.stopPropagation();
|
|
299
297
|
}
|
|
300
298
|
function nr(e) {
|
|
301
|
-
return e ? e.getAttribute("role") === "combobox" &&
|
|
299
|
+
return e ? e.getAttribute("role") === "combobox" && ho(e) : !1;
|
|
302
300
|
}
|
|
303
301
|
const pn = Math.floor;
|
|
304
|
-
var
|
|
302
|
+
var mo = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], bt = /* @__PURE__ */ mo.join(","), rr = typeof Element > "u", He = rr ? function() {
|
|
305
303
|
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, gt = !rr && Element.prototype.getRootNode ? function(e) {
|
|
306
304
|
var r;
|
|
307
305
|
return e == null || (r = e.getRootNode) === null || r === void 0 ? void 0 : r.call(e);
|
|
@@ -312,15 +310,15 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
312
310
|
t === void 0 && (t = !0);
|
|
313
311
|
var o = r == null || (n = r.getAttribute) === null || n === void 0 ? void 0 : n.call(r, "inert"), i = o === "" || o === "true", s = i || t && r && e(r.parentNode);
|
|
314
312
|
return s;
|
|
315
|
-
},
|
|
313
|
+
}, po = function(r) {
|
|
316
314
|
var t, n = r == null || (t = r.getAttribute) === null || t === void 0 ? void 0 : t.call(r, "contenteditable");
|
|
317
315
|
return n === "" || n === "true";
|
|
318
|
-
},
|
|
316
|
+
}, bo = function(r, t, n) {
|
|
319
317
|
if (vt(r))
|
|
320
318
|
return [];
|
|
321
319
|
var o = Array.prototype.slice.apply(r.querySelectorAll(bt));
|
|
322
320
|
return t && He.call(r, bt) && o.unshift(r), o = o.filter(n), o;
|
|
323
|
-
},
|
|
321
|
+
}, go = function e(r, t, n) {
|
|
324
322
|
for (var o = [], i = Array.from(r); i.length; ) {
|
|
325
323
|
var s = i.shift();
|
|
326
324
|
if (!vt(s, !1))
|
|
@@ -351,26 +349,26 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
351
349
|
}, ir = function(r) {
|
|
352
350
|
if (!r)
|
|
353
351
|
throw new Error("No node provided");
|
|
354
|
-
return r.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(r.tagName) ||
|
|
355
|
-
},
|
|
352
|
+
return r.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(r.tagName) || po(r)) && !or(r) ? 0 : r.tabIndex;
|
|
353
|
+
}, vo = function(r, t) {
|
|
356
354
|
var n = ir(r);
|
|
357
355
|
return n < 0 && t && !or(r) ? 0 : n;
|
|
358
|
-
},
|
|
356
|
+
}, yo = function(r, t) {
|
|
359
357
|
return r.tabIndex === t.tabIndex ? r.documentOrder - t.documentOrder : r.tabIndex - t.tabIndex;
|
|
360
358
|
}, sr = function(r) {
|
|
361
359
|
return r.tagName === "INPUT";
|
|
362
|
-
},
|
|
360
|
+
}, xo = function(r) {
|
|
363
361
|
return sr(r) && r.type === "hidden";
|
|
364
|
-
},
|
|
362
|
+
}, wo = function(r) {
|
|
365
363
|
var t = r.tagName === "DETAILS" && Array.prototype.slice.apply(r.children).some(function(n) {
|
|
366
364
|
return n.tagName === "SUMMARY";
|
|
367
365
|
});
|
|
368
366
|
return t;
|
|
369
|
-
},
|
|
367
|
+
}, Co = function(r, t) {
|
|
370
368
|
for (var n = 0; n < r.length; n++)
|
|
371
369
|
if (r[n].checked && r[n].form === t)
|
|
372
370
|
return r[n];
|
|
373
|
-
},
|
|
371
|
+
}, Eo = function(r) {
|
|
374
372
|
if (!r.name)
|
|
375
373
|
return !0;
|
|
376
374
|
var t = r.form || gt(r), n = function(a) {
|
|
@@ -384,13 +382,13 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
384
382
|
} catch (s) {
|
|
385
383
|
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
|
|
386
384
|
}
|
|
387
|
-
var i =
|
|
385
|
+
var i = Co(o, r.form);
|
|
388
386
|
return !i || i === r;
|
|
389
|
-
},
|
|
387
|
+
}, Io = function(r) {
|
|
390
388
|
return sr(r) && r.type === "radio";
|
|
389
|
+
}, Ro = function(r) {
|
|
390
|
+
return Io(r) && !Eo(r);
|
|
391
391
|
}, Oo = function(r) {
|
|
392
|
-
return Ro(r) && !Io(r);
|
|
393
|
-
}, So = function(r) {
|
|
394
392
|
var t, n = r && gt(r), o = (t = n) === null || t === void 0 ? void 0 : t.host, i = !1;
|
|
395
393
|
if (n && n !== r) {
|
|
396
394
|
var s, a, l;
|
|
@@ -403,7 +401,7 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
403
401
|
}, bn = function(r) {
|
|
404
402
|
var t = r.getBoundingClientRect(), n = t.width, o = t.height;
|
|
405
403
|
return n === 0 && o === 0;
|
|
406
|
-
},
|
|
404
|
+
}, So = function(r, t) {
|
|
407
405
|
var n = t.displayCheck, o = t.getShadowRoot;
|
|
408
406
|
if (getComputedStyle(r).visibility === "hidden")
|
|
409
407
|
return !0;
|
|
@@ -420,14 +418,14 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
420
418
|
}
|
|
421
419
|
r = a;
|
|
422
420
|
}
|
|
423
|
-
if (
|
|
421
|
+
if (Oo(r))
|
|
424
422
|
return !r.getClientRects().length;
|
|
425
423
|
if (n !== "legacy-full")
|
|
426
424
|
return !0;
|
|
427
425
|
} else if (n === "non-zero-area")
|
|
428
426
|
return bn(r);
|
|
429
427
|
return !1;
|
|
430
|
-
},
|
|
428
|
+
}, To = function(r) {
|
|
431
429
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(r.tagName))
|
|
432
430
|
for (var t = r.parentElement; t; ) {
|
|
433
431
|
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
@@ -445,17 +443,17 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
445
443
|
return !(t.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
446
444
|
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
447
445
|
// note related to `candidateSelectors`)
|
|
448
|
-
vt(t) ||
|
|
449
|
-
|
|
446
|
+
vt(t) || xo(t) || So(t, r) || // For a details element with a summary, the summary element gets the focus
|
|
447
|
+
wo(t) || To(t));
|
|
450
448
|
}, Wt = function(r, t) {
|
|
451
|
-
return !(
|
|
452
|
-
},
|
|
449
|
+
return !(Ro(t) || ir(t) < 0 || !Mo(r, t));
|
|
450
|
+
}, ko = function(r) {
|
|
453
451
|
var t = parseInt(r.getAttribute("tabindex"), 10);
|
|
454
452
|
return !!(isNaN(t) || t >= 0);
|
|
455
|
-
},
|
|
453
|
+
}, No = function e(r) {
|
|
456
454
|
var t = [], n = [];
|
|
457
455
|
return r.forEach(function(o, i) {
|
|
458
|
-
var s = !!o.scopeParent, a = s ? o.scopeParent : o, l =
|
|
456
|
+
var s = !!o.scopeParent, a = s ? o.scopeParent : o, l = vo(a, s), c = s ? e(o.candidates) : a;
|
|
459
457
|
l === 0 ? s ? t.push.apply(t, c) : t.push(a) : n.push({
|
|
460
458
|
documentOrder: i,
|
|
461
459
|
tabIndex: l,
|
|
@@ -463,23 +461,23 @@ var po = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
463
461
|
isScope: s,
|
|
464
462
|
content: c
|
|
465
463
|
});
|
|
466
|
-
}), n.sort(
|
|
464
|
+
}), n.sort(yo).reduce(function(o, i) {
|
|
467
465
|
return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
|
|
468
466
|
}, []).concat(t);
|
|
469
467
|
}, nt = function(r, t) {
|
|
470
468
|
t = t || {};
|
|
471
469
|
var n;
|
|
472
|
-
return t.getShadowRoot ? n =
|
|
470
|
+
return t.getShadowRoot ? n = go([r], t.includeContainer, {
|
|
473
471
|
filter: Wt.bind(null, t),
|
|
474
472
|
flatten: !1,
|
|
475
473
|
getShadowRoot: t.getShadowRoot,
|
|
476
|
-
shadowRootFilter:
|
|
477
|
-
}) : n =
|
|
478
|
-
},
|
|
474
|
+
shadowRootFilter: ko
|
|
475
|
+
}) : n = bo(r, t.includeContainer, Wt.bind(null, t)), No(n);
|
|
476
|
+
}, Po = function(r, t) {
|
|
479
477
|
if (t = t || {}, !r)
|
|
480
478
|
throw new Error("No node provided");
|
|
481
479
|
return He.call(r, bt) === !1 ? !1 : Wt(t, r);
|
|
482
|
-
}, ht = typeof document < "u" ? jn :
|
|
480
|
+
}, ht = typeof document < "u" ? jn : ce;
|
|
483
481
|
function yt(e, r) {
|
|
484
482
|
if (e === r)
|
|
485
483
|
return !0;
|
|
@@ -523,7 +521,7 @@ function At(e) {
|
|
|
523
521
|
r.current = e;
|
|
524
522
|
}), r;
|
|
525
523
|
}
|
|
526
|
-
function
|
|
524
|
+
function Do(e) {
|
|
527
525
|
e === void 0 && (e = {});
|
|
528
526
|
const {
|
|
529
527
|
placement: r = "bottom",
|
|
@@ -546,19 +544,19 @@ function Ao(e) {
|
|
|
546
544
|
isPositioned: !1
|
|
547
545
|
}), [h, u] = p.useState(n);
|
|
548
546
|
yt(h, n) || u(n);
|
|
549
|
-
const [m, g] = p.useState(null), [C, x] = p.useState(null), y = p.useCallback((
|
|
550
|
-
|
|
551
|
-
}, []), b = p.useCallback((
|
|
552
|
-
|
|
553
|
-
}, []), w = i || m, _ = s || C,
|
|
554
|
-
if (!
|
|
547
|
+
const [m, g] = p.useState(null), [C, x] = p.useState(null), y = p.useCallback((M) => {
|
|
548
|
+
M !== k.current && (k.current = M, g(M));
|
|
549
|
+
}, []), b = p.useCallback((M) => {
|
|
550
|
+
M !== j.current && (j.current = M, x(M));
|
|
551
|
+
}, []), w = i || m, _ = s || C, k = p.useRef(null), j = p.useRef(null), $ = p.useRef(f), Z = l != null, X = At(l), q = At(o), S = At(c), N = p.useCallback(() => {
|
|
552
|
+
if (!k.current || !j.current)
|
|
555
553
|
return;
|
|
556
|
-
const
|
|
554
|
+
const M = {
|
|
557
555
|
placement: r,
|
|
558
556
|
strategy: t,
|
|
559
557
|
middleware: h
|
|
560
558
|
};
|
|
561
|
-
q.current && (
|
|
559
|
+
q.current && (M.platform = q.current), Un(k.current, j.current, M).then((R) => {
|
|
562
560
|
const U = {
|
|
563
561
|
...R,
|
|
564
562
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -573,8 +571,8 @@ function Ao(e) {
|
|
|
573
571
|
});
|
|
574
572
|
}, [h, r, t, q, S]);
|
|
575
573
|
ht(() => {
|
|
576
|
-
c === !1 && $.current.isPositioned && ($.current.isPositioned = !1, d((
|
|
577
|
-
...
|
|
574
|
+
c === !1 && $.current.isPositioned && ($.current.isPositioned = !1, d((M) => ({
|
|
575
|
+
...M,
|
|
578
576
|
isPositioned: !1
|
|
579
577
|
})));
|
|
580
578
|
}, [c]);
|
|
@@ -582,14 +580,14 @@ function Ao(e) {
|
|
|
582
580
|
ht(() => (P.current = !0, () => {
|
|
583
581
|
P.current = !1;
|
|
584
582
|
}), []), ht(() => {
|
|
585
|
-
if (w && (
|
|
586
|
-
if (
|
|
587
|
-
return
|
|
583
|
+
if (w && (k.current = w), _ && (j.current = _), w && _) {
|
|
584
|
+
if (X.current)
|
|
585
|
+
return X.current(w, _, N);
|
|
588
586
|
N();
|
|
589
587
|
}
|
|
590
|
-
}, [w, _, N,
|
|
588
|
+
}, [w, _, N, X, Z]);
|
|
591
589
|
const E = p.useMemo(() => ({
|
|
592
|
-
reference:
|
|
590
|
+
reference: k,
|
|
593
591
|
floating: j,
|
|
594
592
|
setReference: y,
|
|
595
593
|
setFloating: b
|
|
@@ -597,16 +595,16 @@ function Ao(e) {
|
|
|
597
595
|
reference: w,
|
|
598
596
|
floating: _
|
|
599
597
|
}), [w, _]), B = p.useMemo(() => {
|
|
600
|
-
const
|
|
598
|
+
const M = {
|
|
601
599
|
position: t,
|
|
602
600
|
left: 0,
|
|
603
601
|
top: 0
|
|
604
602
|
};
|
|
605
603
|
if (!D.floating)
|
|
606
|
-
return
|
|
604
|
+
return M;
|
|
607
605
|
const R = gn(D.floating, f.x), U = gn(D.floating, f.y);
|
|
608
606
|
return a ? {
|
|
609
|
-
...
|
|
607
|
+
...M,
|
|
610
608
|
transform: "translate(" + R + "px, " + U + "px)",
|
|
611
609
|
...ar(D.floating) >= 1.5 && {
|
|
612
610
|
willChange: "transform"
|
|
@@ -625,13 +623,13 @@ function Ao(e) {
|
|
|
625
623
|
floatingStyles: B
|
|
626
624
|
}), [f, N, E, D, B]);
|
|
627
625
|
}
|
|
628
|
-
const
|
|
626
|
+
const Ao = (e, r) => ({
|
|
629
627
|
...Hn(e),
|
|
630
628
|
options: [e, r]
|
|
631
|
-
}),
|
|
629
|
+
}), _o = (e, r) => ({
|
|
632
630
|
...qn(e),
|
|
633
631
|
options: [e, r]
|
|
634
|
-
}),
|
|
632
|
+
}), Fo = (e, r) => ({
|
|
635
633
|
...Xr(e),
|
|
636
634
|
options: [e, r]
|
|
637
635
|
});
|
|
@@ -644,13 +642,13 @@ function Yt(e) {
|
|
|
644
642
|
}
|
|
645
643
|
const lr = {
|
|
646
644
|
...p
|
|
647
|
-
},
|
|
645
|
+
}, Lo = lr.useInsertionEffect, zo = Lo || ((e) => e());
|
|
648
646
|
function Ce(e) {
|
|
649
647
|
const r = p.useRef(() => {
|
|
650
648
|
if (process.env.NODE_ENV !== "production")
|
|
651
649
|
throw new Error("Cannot call an event handler while rendering.");
|
|
652
650
|
});
|
|
653
|
-
return
|
|
651
|
+
return zo(() => {
|
|
654
652
|
r.current = e;
|
|
655
653
|
}), p.useCallback(function() {
|
|
656
654
|
for (var t = arguments.length, n = new Array(t), o = 0; o < t; o++)
|
|
@@ -666,18 +664,18 @@ function et(e, r) {
|
|
|
666
664
|
return r < 0 || r >= e.current.length;
|
|
667
665
|
}
|
|
668
666
|
function _t(e, r) {
|
|
669
|
-
return
|
|
667
|
+
return ae(e, {
|
|
670
668
|
disabledIndices: r
|
|
671
669
|
});
|
|
672
670
|
}
|
|
673
671
|
function vn(e, r) {
|
|
674
|
-
return
|
|
672
|
+
return ae(e, {
|
|
675
673
|
decrement: !0,
|
|
676
674
|
startingIndex: e.current.length,
|
|
677
675
|
disabledIndices: r
|
|
678
676
|
});
|
|
679
677
|
}
|
|
680
|
-
function
|
|
678
|
+
function ae(e, r) {
|
|
681
679
|
let {
|
|
682
680
|
startingIndex: t = -1,
|
|
683
681
|
decrement: n = !1,
|
|
@@ -691,7 +689,7 @@ function le(e, r) {
|
|
|
691
689
|
while (a >= 0 && a <= s.length - 1 && mt(s, a, o));
|
|
692
690
|
return a;
|
|
693
691
|
}
|
|
694
|
-
function
|
|
692
|
+
function Vo(e, r) {
|
|
695
693
|
let {
|
|
696
694
|
event: t,
|
|
697
695
|
orientation: n,
|
|
@@ -706,7 +704,7 @@ function Bo(e, r) {
|
|
|
706
704
|
if (t.key === Zt) {
|
|
707
705
|
if (f && fe(t), c === -1)
|
|
708
706
|
d = l;
|
|
709
|
-
else if (d =
|
|
707
|
+
else if (d = ae(e, {
|
|
710
708
|
startingIndex: d,
|
|
711
709
|
amount: i,
|
|
712
710
|
decrement: !0,
|
|
@@ -717,47 +715,47 @@ function Bo(e, r) {
|
|
|
717
715
|
}
|
|
718
716
|
et(e, d) && (d = c);
|
|
719
717
|
}
|
|
720
|
-
if (t.key === st && (f && fe(t), c === -1 ? d = a : (d =
|
|
718
|
+
if (t.key === st && (f && fe(t), c === -1 ? d = a : (d = ae(e, {
|
|
721
719
|
startingIndex: c,
|
|
722
720
|
amount: i,
|
|
723
721
|
disabledIndices: s
|
|
724
|
-
}), o && c + i > l && (d =
|
|
722
|
+
}), o && c + i > l && (d = ae(e, {
|
|
725
723
|
startingIndex: c % i - i,
|
|
726
724
|
amount: i,
|
|
727
725
|
disabledIndices: s
|
|
728
726
|
}))), et(e, d) && (d = c)), n === "both") {
|
|
729
727
|
const h = pn(c / i);
|
|
730
|
-
t.key === Ze && (f && fe(t), c % i !== i - 1 ? (d =
|
|
728
|
+
t.key === Ze && (f && fe(t), c % i !== i - 1 ? (d = ae(e, {
|
|
731
729
|
startingIndex: c,
|
|
732
730
|
disabledIndices: s
|
|
733
|
-
}), o && ut(d, i, h) && (d =
|
|
731
|
+
}), o && ut(d, i, h) && (d = ae(e, {
|
|
734
732
|
startingIndex: c - c % i - 1,
|
|
735
733
|
disabledIndices: s
|
|
736
|
-
}))) : o && (d =
|
|
734
|
+
}))) : o && (d = ae(e, {
|
|
737
735
|
startingIndex: c - c % i - 1,
|
|
738
736
|
disabledIndices: s
|
|
739
|
-
})), ut(d, i, h) && (d = c)), t.key === Ue && (f && fe(t), c % i !== 0 ? (d =
|
|
737
|
+
})), ut(d, i, h) && (d = c)), t.key === Ue && (f && fe(t), c % i !== 0 ? (d = ae(e, {
|
|
740
738
|
startingIndex: c,
|
|
741
739
|
decrement: !0,
|
|
742
740
|
disabledIndices: s
|
|
743
|
-
}), o && ut(d, i, h) && (d =
|
|
741
|
+
}), o && ut(d, i, h) && (d = ae(e, {
|
|
744
742
|
startingIndex: c + (i - c % i),
|
|
745
743
|
decrement: !0,
|
|
746
744
|
disabledIndices: s
|
|
747
|
-
}))) : o && (d =
|
|
745
|
+
}))) : o && (d = ae(e, {
|
|
748
746
|
startingIndex: c + (i - c % i),
|
|
749
747
|
decrement: !0,
|
|
750
748
|
disabledIndices: s
|
|
751
749
|
})), ut(d, i, h) && (d = c));
|
|
752
750
|
const u = pn(l / i) === h;
|
|
753
|
-
et(e, d) && (o && u ? d = t.key === Ue ? l :
|
|
751
|
+
et(e, d) && (o && u ? d = t.key === Ue ? l : ae(e, {
|
|
754
752
|
startingIndex: c - c % i - 1,
|
|
755
753
|
disabledIndices: s
|
|
756
754
|
}) : d = c);
|
|
757
755
|
}
|
|
758
756
|
return d;
|
|
759
757
|
}
|
|
760
|
-
function
|
|
758
|
+
function Bo(e, r, t) {
|
|
761
759
|
const n = [];
|
|
762
760
|
let o = 0;
|
|
763
761
|
return e.forEach((i, s) => {
|
|
@@ -779,7 +777,7 @@ function jo(e, r, t) {
|
|
|
779
777
|
}
|
|
780
778
|
}), [...n];
|
|
781
779
|
}
|
|
782
|
-
function
|
|
780
|
+
function jo(e, r, t, n, o) {
|
|
783
781
|
if (e === -1) return -1;
|
|
784
782
|
const i = t.indexOf(e), s = r[e];
|
|
785
783
|
switch (o) {
|
|
@@ -793,7 +791,7 @@ function $o(e, r, t, n, o) {
|
|
|
793
791
|
return t.lastIndexOf(e);
|
|
794
792
|
}
|
|
795
793
|
}
|
|
796
|
-
function
|
|
794
|
+
function $o(e, r) {
|
|
797
795
|
return r.flatMap((t, n) => e.includes(t) ? [n] : []);
|
|
798
796
|
}
|
|
799
797
|
function mt(e, r, t) {
|
|
@@ -816,7 +814,7 @@ function Ne(e, r) {
|
|
|
816
814
|
});
|
|
817
815
|
o ? i() : yn = requestAnimationFrame(i);
|
|
818
816
|
}
|
|
819
|
-
var Q = typeof document < "u" ? jn :
|
|
817
|
+
var Q = typeof document < "u" ? jn : ce;
|
|
820
818
|
function xt() {
|
|
821
819
|
return xt = Object.assign ? Object.assign.bind() : function(e) {
|
|
822
820
|
for (var r = 1; r < arguments.length; r++) {
|
|
@@ -827,13 +825,13 @@ function xt() {
|
|
|
827
825
|
return e;
|
|
828
826
|
}, xt.apply(this, arguments);
|
|
829
827
|
}
|
|
830
|
-
let xn = !1,
|
|
828
|
+
let xn = !1, Ko = 0;
|
|
831
829
|
const wn = () => (
|
|
832
830
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
833
831
|
// on <React 18
|
|
834
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
832
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Ko++
|
|
835
833
|
);
|
|
836
|
-
function
|
|
834
|
+
function Wo() {
|
|
837
835
|
const [e, r] = p.useState(() => xn ? wn() : void 0);
|
|
838
836
|
return Q(() => {
|
|
839
837
|
e == null && r(wn());
|
|
@@ -841,7 +839,7 @@ function qo() {
|
|
|
841
839
|
xn = !0;
|
|
842
840
|
}, []), e;
|
|
843
841
|
}
|
|
844
|
-
const
|
|
842
|
+
const qo = lr.useId, Jt = qo || Wo;
|
|
845
843
|
let rt;
|
|
846
844
|
process.env.NODE_ENV !== "production" && (rt = /* @__PURE__ */ new Set());
|
|
847
845
|
function Ft() {
|
|
@@ -853,7 +851,7 @@ function Ft() {
|
|
|
853
851
|
(i = rt) == null || i.add(o), console.warn(o);
|
|
854
852
|
}
|
|
855
853
|
}
|
|
856
|
-
function
|
|
854
|
+
function Ho() {
|
|
857
855
|
for (var e, r = arguments.length, t = new Array(r), n = 0; n < r; n++)
|
|
858
856
|
t[n] = arguments[n];
|
|
859
857
|
const o = "Floating UI: " + t.join(" ");
|
|
@@ -862,7 +860,7 @@ function Uo() {
|
|
|
862
860
|
(i = rt) == null || i.add(o), console.error(o);
|
|
863
861
|
}
|
|
864
862
|
}
|
|
865
|
-
function
|
|
863
|
+
function Uo() {
|
|
866
864
|
const e = /* @__PURE__ */ new Map();
|
|
867
865
|
return {
|
|
868
866
|
emit(r, t) {
|
|
@@ -878,10 +876,10 @@ function Xo() {
|
|
|
878
876
|
}
|
|
879
877
|
};
|
|
880
878
|
}
|
|
881
|
-
const
|
|
879
|
+
const Xo = /* @__PURE__ */ p.createContext(null), Go = /* @__PURE__ */ p.createContext(null), Qt = () => {
|
|
882
880
|
var e;
|
|
883
|
-
return ((e = p.useContext(
|
|
884
|
-
}, It = () => p.useContext(
|
|
881
|
+
return ((e = p.useContext(Xo)) == null ? void 0 : e.id) || null;
|
|
882
|
+
}, It = () => p.useContext(Go);
|
|
885
883
|
function Xe(e) {
|
|
886
884
|
return "data-floating-ui-" + e;
|
|
887
885
|
}
|
|
@@ -891,7 +889,7 @@ function Pe(e) {
|
|
|
891
889
|
r.current = e;
|
|
892
890
|
}), r;
|
|
893
891
|
}
|
|
894
|
-
function
|
|
892
|
+
function Yo(e, r) {
|
|
895
893
|
var t;
|
|
896
894
|
let n = [], o = (t = e.find((i) => i.id === r)) == null ? void 0 : t.parentId;
|
|
897
895
|
for (; o; ) {
|
|
@@ -915,7 +913,7 @@ function We(e, r) {
|
|
|
915
913
|
}), t = t.concat(n);
|
|
916
914
|
return t;
|
|
917
915
|
}
|
|
918
|
-
function
|
|
916
|
+
function Zo(e, r) {
|
|
919
917
|
let t, n = -1;
|
|
920
918
|
function o(i, s) {
|
|
921
919
|
s > n && (t = i, n = s), We(e, i).forEach((l) => {
|
|
@@ -925,14 +923,14 @@ function Jo(e, r) {
|
|
|
925
923
|
return o(r, 0), e.find((i) => i.id === t);
|
|
926
924
|
}
|
|
927
925
|
let $e = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakSet(), ft = {}, Lt = 0;
|
|
928
|
-
const
|
|
926
|
+
const Jo = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, cr = (e) => e && (e.host || cr(e.parentNode)), Qo = (e, r) => r.map((t) => {
|
|
929
927
|
if (e.contains(t))
|
|
930
928
|
return t;
|
|
931
929
|
const n = cr(t);
|
|
932
930
|
return e.contains(n) ? n : null;
|
|
933
931
|
}).filter((t) => t != null);
|
|
934
|
-
function
|
|
935
|
-
const o = "data-floating-ui-inert", i = n ? "inert" : t ? "aria-hidden" : null, s =
|
|
932
|
+
function ei(e, r, t, n) {
|
|
933
|
+
const o = "data-floating-ui-inert", i = n ? "inert" : t ? "aria-hidden" : null, s = Qo(r, e), a = /* @__PURE__ */ new Set(), l = new Set(s), c = [];
|
|
936
934
|
ft[o] || (ft[o] = /* @__PURE__ */ new WeakMap());
|
|
937
935
|
const f = ft[o];
|
|
938
936
|
s.forEach(d), h(r), a.clear();
|
|
@@ -960,7 +958,7 @@ function ti(e, r, t, n) {
|
|
|
960
958
|
function Cn(e, r, t) {
|
|
961
959
|
r === void 0 && (r = !1), t === void 0 && (t = !1);
|
|
962
960
|
const n = be(e[0]).body;
|
|
963
|
-
return
|
|
961
|
+
return ei(e.concat(Array.from(n.querySelectorAll("[aria-live]"))), n, r, t);
|
|
964
962
|
}
|
|
965
963
|
const Ge = () => ({
|
|
966
964
|
getShadowRoot: !0,
|
|
@@ -987,7 +985,7 @@ function tt(e, r) {
|
|
|
987
985
|
const t = r || e.currentTarget, n = e.relatedTarget;
|
|
988
986
|
return !n || !de(t, n);
|
|
989
987
|
}
|
|
990
|
-
function
|
|
988
|
+
function ti(e) {
|
|
991
989
|
nt(e, Ge()).forEach((t) => {
|
|
992
990
|
t.dataset.tabindex = t.getAttribute("tabindex") || "", t.setAttribute("tabindex", "-1");
|
|
993
991
|
});
|
|
@@ -998,7 +996,7 @@ function En(e) {
|
|
|
998
996
|
delete t.dataset.tabindex, n ? t.setAttribute("tabindex", n) : t.removeAttribute("tabindex");
|
|
999
997
|
});
|
|
1000
998
|
}
|
|
1001
|
-
function
|
|
999
|
+
function ni(e, r, t) {
|
|
1002
1000
|
const n = e.indexOf(r);
|
|
1003
1001
|
function o(s) {
|
|
1004
1002
|
const a = Xe("focus-guard");
|
|
@@ -1023,9 +1021,9 @@ const en = {
|
|
|
1023
1021
|
top: 0,
|
|
1024
1022
|
left: 0
|
|
1025
1023
|
};
|
|
1026
|
-
let
|
|
1024
|
+
let ri;
|
|
1027
1025
|
function In(e) {
|
|
1028
|
-
e.key === "Tab" && (e.target, clearTimeout(
|
|
1026
|
+
e.key === "Tab" && (e.target, clearTimeout(ri));
|
|
1029
1027
|
}
|
|
1030
1028
|
const wt = /* @__PURE__ */ p.forwardRef(function(r, t) {
|
|
1031
1029
|
const [n, o] = p.useState();
|
|
@@ -1043,7 +1041,7 @@ const wt = /* @__PURE__ */ p.forwardRef(function(r, t) {
|
|
|
1043
1041
|
};
|
|
1044
1042
|
return /* @__PURE__ */ p.createElement("span", xt({}, r, i));
|
|
1045
1043
|
}), hr = /* @__PURE__ */ p.createContext(null), Rn = /* @__PURE__ */ Xe("portal");
|
|
1046
|
-
function
|
|
1044
|
+
function oi(e) {
|
|
1047
1045
|
e === void 0 && (e = {});
|
|
1048
1046
|
const {
|
|
1049
1047
|
id: r,
|
|
@@ -1069,13 +1067,13 @@ function ii(e) {
|
|
|
1069
1067
|
f.id = n, f.setAttribute(Rn, ""), l = c || l, l.appendChild(f), a.current = f, s(f);
|
|
1070
1068
|
}, [r, t, n, o]), i;
|
|
1071
1069
|
}
|
|
1072
|
-
function
|
|
1070
|
+
function ii(e) {
|
|
1073
1071
|
const {
|
|
1074
1072
|
children: r,
|
|
1075
1073
|
id: t,
|
|
1076
1074
|
root: n = null,
|
|
1077
1075
|
preserveTabOrder: o = !0
|
|
1078
|
-
} = e, i =
|
|
1076
|
+
} = e, i = oi({
|
|
1079
1077
|
id: t,
|
|
1080
1078
|
root: n
|
|
1081
1079
|
}), [s, a] = p.useState(null), l = p.useRef(null), c = p.useRef(null), f = p.useRef(null), d = p.useRef(null), h = s?.modal, u = s?.open, m = (
|
|
@@ -1089,7 +1087,7 @@ function si(e) {
|
|
|
1089
1087
|
if (!i || !o || h)
|
|
1090
1088
|
return;
|
|
1091
1089
|
function g(C) {
|
|
1092
|
-
i && tt(C) && (C.type === "focusin" ? En :
|
|
1090
|
+
i && tt(C) && (C.type === "focusin" ? En : ti)(i);
|
|
1093
1091
|
}
|
|
1094
1092
|
return i.addEventListener("focusin", g, !0), i.addEventListener("focusout", g, !0), () => {
|
|
1095
1093
|
i.removeEventListener("focusin", g, !0), i.removeEventListener("focusout", g, !0);
|
|
@@ -1145,7 +1143,7 @@ function zt(e) {
|
|
|
1145
1143
|
Fe = Fe.filter((t) => t.isConnected);
|
|
1146
1144
|
let r = e;
|
|
1147
1145
|
if (!(!r || Et(r) === "body")) {
|
|
1148
|
-
if (!
|
|
1146
|
+
if (!Po(r, Ge())) {
|
|
1149
1147
|
const t = nt(r, Ge())[0];
|
|
1150
1148
|
t && (r = t);
|
|
1151
1149
|
}
|
|
@@ -1155,7 +1153,7 @@ function zt(e) {
|
|
|
1155
1153
|
function Sn() {
|
|
1156
1154
|
return Fe.slice().reverse().find((e) => e.isConnected);
|
|
1157
1155
|
}
|
|
1158
|
-
const
|
|
1156
|
+
const si = /* @__PURE__ */ p.forwardRef(function(r, t) {
|
|
1159
1157
|
return /* @__PURE__ */ p.createElement("button", xt({}, r, {
|
|
1160
1158
|
type: "button",
|
|
1161
1159
|
ref: t,
|
|
@@ -1163,7 +1161,7 @@ const ai = /* @__PURE__ */ p.forwardRef(function(r, t) {
|
|
|
1163
1161
|
style: en
|
|
1164
1162
|
}));
|
|
1165
1163
|
});
|
|
1166
|
-
function
|
|
1164
|
+
function ai(e) {
|
|
1167
1165
|
const {
|
|
1168
1166
|
context: r,
|
|
1169
1167
|
children: t,
|
|
@@ -1188,7 +1186,7 @@ function li(e) {
|
|
|
1188
1186
|
domReference: b,
|
|
1189
1187
|
floating: w
|
|
1190
1188
|
}
|
|
1191
|
-
} = r, _ = typeof s == "number" && s < 0,
|
|
1189
|
+
} = r, _ = typeof s == "number" && s < 0, k = nr(b) && _, j = Jo() ? i : !0, $ = Pe(o), Z = Pe(s), X = Pe(a), q = It(), S = mr(), N = p.useRef(null), P = p.useRef(null), E = p.useRef(!1), D = p.useRef(!1), B = p.useRef(-1), M = S != null, R = pr(w), U = Ce(function(z) {
|
|
1192
1190
|
return z === void 0 && (z = R), z ? nt(z, Ge()) : [];
|
|
1193
1191
|
}), te = Ce((z) => {
|
|
1194
1192
|
const T = U(z);
|
|
@@ -1200,7 +1198,7 @@ function li(e) {
|
|
|
1200
1198
|
if (n || !c) return;
|
|
1201
1199
|
function z(O) {
|
|
1202
1200
|
if (O.key === "Tab") {
|
|
1203
|
-
de(R, Se(be(R))) && U().length === 0 && !
|
|
1201
|
+
de(R, Se(be(R))) && U().length === 0 && !k && fe(O);
|
|
1204
1202
|
const F = te(), H = Le(O);
|
|
1205
1203
|
$.current[0] === "reference" && H === b && (fe(O), O.shiftKey ? Ne(F[F.length - 1]) : Ne(F[1])), $.current[1] === "floating" && H === R && O.shiftKey && (fe(O), Ne(F[0]));
|
|
1206
1204
|
}
|
|
@@ -1209,7 +1207,7 @@ function li(e) {
|
|
|
1209
1207
|
return T.addEventListener("keydown", z), () => {
|
|
1210
1208
|
T.removeEventListener("keydown", z);
|
|
1211
1209
|
};
|
|
1212
|
-
}, [n, b, R, c, $,
|
|
1210
|
+
}, [n, b, R, c, $, k, U, te]), p.useEffect(() => {
|
|
1213
1211
|
if (n || !w) return;
|
|
1214
1212
|
function z(T) {
|
|
1215
1213
|
const O = Le(T), H = U().indexOf(O);
|
|
@@ -1231,7 +1229,7 @@ function li(e) {
|
|
|
1231
1229
|
const H = !(de(b, F) || de(w, F) || de(F, w) || de(S?.portalNode, F) || F != null && F.hasAttribute(Xe("focus-guard")) || q && (We(q.nodesRef.current, m).find((ee) => {
|
|
1232
1230
|
var ne, Y;
|
|
1233
1231
|
return de((ne = ee.context) == null ? void 0 : ne.elements.floating, F) || de((Y = ee.context) == null ? void 0 : Y.elements.domReference, F);
|
|
1234
|
-
}) ||
|
|
1232
|
+
}) || Yo(q.nodesRef.current, m).find((ee) => {
|
|
1235
1233
|
var ne, Y;
|
|
1236
1234
|
return ((ne = ee.context) == null ? void 0 : ne.elements.floating) === F || ((Y = ee.context) == null ? void 0 : Y.elements.domReference) === F;
|
|
1237
1235
|
})));
|
|
@@ -1240,7 +1238,7 @@ function li(e) {
|
|
|
1240
1238
|
const ee = B.current, ne = U(), Y = ne[ee] || ne[ne.length - 1] || R;
|
|
1241
1239
|
Oe(Y) && Y.focus();
|
|
1242
1240
|
}
|
|
1243
|
-
(
|
|
1241
|
+
(k || !c) && F && H && !D.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
1244
1242
|
F !== Sn() && (E.current = !0, g(!1, O, "focus-out"));
|
|
1245
1243
|
});
|
|
1246
1244
|
}
|
|
@@ -1248,17 +1246,17 @@ function li(e) {
|
|
|
1248
1246
|
return b.addEventListener("focusout", T), b.addEventListener("pointerdown", z), w.addEventListener("focusout", T), () => {
|
|
1249
1247
|
b.removeEventListener("focusout", T), b.removeEventListener("pointerdown", z), w.removeEventListener("focusout", T);
|
|
1250
1248
|
};
|
|
1251
|
-
}, [n, b, w, R, c, m, q, S, g, d, l, U,
|
|
1249
|
+
}, [n, b, w, R, c, m, q, S, g, d, l, U, k]), p.useEffect(() => {
|
|
1252
1250
|
var z;
|
|
1253
1251
|
if (n) return;
|
|
1254
1252
|
const T = Array.from((S == null || (z = S.portalNode) == null ? void 0 : z.querySelectorAll("[" + Xe("portal") + "]")) || []);
|
|
1255
1253
|
if (w) {
|
|
1256
|
-
const O = [w, ...T, N.current, P.current, $.current.includes("reference") ||
|
|
1254
|
+
const O = [w, ...T, N.current, P.current, $.current.includes("reference") || k ? b : null].filter((H) => H != null), F = c || k ? Cn(O, j, !j) : Cn(O);
|
|
1257
1255
|
return () => {
|
|
1258
1256
|
F();
|
|
1259
1257
|
};
|
|
1260
1258
|
}
|
|
1261
|
-
}, [n, b, w, c, $, S,
|
|
1259
|
+
}, [n, b, w, c, $, S, k, j]), Q(() => {
|
|
1262
1260
|
if (n || !Oe(R)) return;
|
|
1263
1261
|
const z = be(R), T = Se(z);
|
|
1264
1262
|
queueMicrotask(() => {
|
|
@@ -1293,8 +1291,8 @@ function li(e) {
|
|
|
1293
1291
|
const J = ee || O, Re = nt(be(J).body, Ge());
|
|
1294
1292
|
queueMicrotask(() => {
|
|
1295
1293
|
let me = Sn();
|
|
1296
|
-
!me && Oe(J) && w && (me =
|
|
1297
|
-
|
|
1294
|
+
!me && Oe(J) && w && (me = ni(Re, J, w)), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1295
|
+
X.current && !E.current && Oe(me) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
1298
1296
|
// since it likely entered a different element which should be
|
|
1299
1297
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
1300
1298
|
(!(me !== Y && Y !== T.body) || Ie) && me.focus({
|
|
@@ -1302,7 +1300,7 @@ function li(e) {
|
|
|
1302
1300
|
});
|
|
1303
1301
|
});
|
|
1304
1302
|
};
|
|
1305
|
-
}, [n, w, R,
|
|
1303
|
+
}, [n, w, R, X, x, u, C, q, m]), Q(() => {
|
|
1306
1304
|
if (!n && S)
|
|
1307
1305
|
return S.setFocusManagerState({
|
|
1308
1306
|
modal: c,
|
|
@@ -1330,12 +1328,12 @@ function li(e) {
|
|
|
1330
1328
|
};
|
|
1331
1329
|
}, [n, w, R, u, $, U, _]);
|
|
1332
1330
|
function xe(z) {
|
|
1333
|
-
return n || !f || !c ? null : /* @__PURE__ */ p.createElement(
|
|
1331
|
+
return n || !f || !c ? null : /* @__PURE__ */ p.createElement(si, {
|
|
1334
1332
|
ref: z === "start" ? N : P,
|
|
1335
1333
|
onClick: (T) => g(!1, T.nativeEvent)
|
|
1336
1334
|
}, typeof f == "string" ? f : "Dismiss");
|
|
1337
1335
|
}
|
|
1338
|
-
const he = !n && j && (c ? !
|
|
1336
|
+
const he = !n && j && (c ? !k : !0) && (M || c);
|
|
1339
1337
|
return /* @__PURE__ */ p.createElement(p.Fragment, null, he && /* @__PURE__ */ p.createElement(wt, {
|
|
1340
1338
|
"data-type": "inside",
|
|
1341
1339
|
ref: S?.beforeInsideRef,
|
|
@@ -1352,7 +1350,7 @@ function li(e) {
|
|
|
1352
1350
|
(T = S.beforeOutsideRef.current) == null || T.focus();
|
|
1353
1351
|
}
|
|
1354
1352
|
}
|
|
1355
|
-
}), !
|
|
1353
|
+
}), !k && xe("start"), t, xe("end"), he && /* @__PURE__ */ p.createElement(wt, {
|
|
1356
1354
|
"data-type": "inside",
|
|
1357
1355
|
ref: S?.afterInsideRef,
|
|
1358
1356
|
onFocus: (z) => {
|
|
@@ -1369,11 +1367,11 @@ function li(e) {
|
|
|
1369
1367
|
}
|
|
1370
1368
|
}));
|
|
1371
1369
|
}
|
|
1372
|
-
const
|
|
1370
|
+
const li = {
|
|
1373
1371
|
pointerdown: "onPointerDown",
|
|
1374
1372
|
mousedown: "onMouseDown",
|
|
1375
1373
|
click: "onClick"
|
|
1376
|
-
},
|
|
1374
|
+
}, ci = {
|
|
1377
1375
|
pointerdown: "onPointerDownCapture",
|
|
1378
1376
|
mousedown: "onMouseDownCapture",
|
|
1379
1377
|
click: "onClickCapture"
|
|
@@ -1384,7 +1382,7 @@ const ci = {
|
|
|
1384
1382
|
outsidePress: typeof e == "boolean" ? e : (t = e?.outsidePress) != null ? t : !0
|
|
1385
1383
|
};
|
|
1386
1384
|
};
|
|
1387
|
-
function
|
|
1385
|
+
function ui(e, r) {
|
|
1388
1386
|
r === void 0 && (r = {});
|
|
1389
1387
|
const {
|
|
1390
1388
|
open: t,
|
|
@@ -1405,7 +1403,7 @@ function di(e, r) {
|
|
|
1405
1403
|
escapeKey: w,
|
|
1406
1404
|
outsidePress: _
|
|
1407
1405
|
} = Tn(u), {
|
|
1408
|
-
escapeKey:
|
|
1406
|
+
escapeKey: k,
|
|
1409
1407
|
outsidePress: j
|
|
1410
1408
|
} = Tn(m), $ = Ce((P) => {
|
|
1411
1409
|
var E;
|
|
@@ -1413,17 +1411,17 @@ function di(e, r) {
|
|
|
1413
1411
|
return;
|
|
1414
1412
|
const D = (E = i.current.floatingContext) == null ? void 0 : E.nodeId, B = g ? We(g.nodesRef.current, D) : [];
|
|
1415
1413
|
if (!w && (P.stopPropagation(), B.length > 0)) {
|
|
1416
|
-
let
|
|
1414
|
+
let M = !0;
|
|
1417
1415
|
if (B.forEach((R) => {
|
|
1418
1416
|
var U;
|
|
1419
1417
|
if ((U = R.context) != null && U.open && !R.context.dataRef.current.__escapeKeyBubbles) {
|
|
1420
|
-
|
|
1418
|
+
M = !1;
|
|
1421
1419
|
return;
|
|
1422
1420
|
}
|
|
1423
|
-
}), !
|
|
1421
|
+
}), !M)
|
|
1424
1422
|
return;
|
|
1425
1423
|
}
|
|
1426
|
-
n(!1,
|
|
1424
|
+
n(!1, co(P) ? P.nativeEvent : P, "escape-key");
|
|
1427
1425
|
}), Z = Ce((P) => {
|
|
1428
1426
|
var E;
|
|
1429
1427
|
const D = () => {
|
|
@@ -1431,30 +1429,30 @@ function di(e, r) {
|
|
|
1431
1429
|
$(P), (B = Le(P)) == null || B.removeEventListener("keydown", D);
|
|
1432
1430
|
};
|
|
1433
1431
|
(E = Le(P)) == null || E.addEventListener("keydown", D);
|
|
1434
|
-
}),
|
|
1432
|
+
}), X = Ce((P) => {
|
|
1435
1433
|
var E;
|
|
1436
1434
|
const D = y.current;
|
|
1437
1435
|
y.current = !1;
|
|
1438
1436
|
const B = b.current;
|
|
1439
1437
|
if (b.current = !1, c === "click" && B || D || typeof x == "function" && !x(P))
|
|
1440
1438
|
return;
|
|
1441
|
-
const
|
|
1442
|
-
let te = ge(
|
|
1439
|
+
const M = Le(P), R = "[" + Xe("inert") + "]", U = be(o.floating).querySelectorAll(R);
|
|
1440
|
+
let te = ge(M) ? M : null;
|
|
1443
1441
|
for (; te && !mn(te); ) {
|
|
1444
|
-
const T =
|
|
1442
|
+
const T = so(te);
|
|
1445
1443
|
if (mn(T) || !ge(T))
|
|
1446
1444
|
break;
|
|
1447
1445
|
te = T;
|
|
1448
1446
|
}
|
|
1449
|
-
if (U.length && ge(
|
|
1450
|
-
!de(
|
|
1447
|
+
if (U.length && ge(M) && !uo(M) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
1448
|
+
!de(M, o.floating) && // If the target root element contains none of the markers, then the
|
|
1451
1449
|
// element was injected after the floating element rendered.
|
|
1452
1450
|
Array.from(U).every((T) => !de(te, T)))
|
|
1453
1451
|
return;
|
|
1454
|
-
if (Oe(
|
|
1455
|
-
const T =
|
|
1456
|
-
let F = O && P.offsetX >
|
|
1457
|
-
if (O &&
|
|
1452
|
+
if (Oe(M) && N) {
|
|
1453
|
+
const T = M.clientWidth > 0 && M.scrollWidth > M.clientWidth, O = M.clientHeight > 0 && M.scrollHeight > M.clientHeight;
|
|
1454
|
+
let F = O && P.offsetX > M.clientWidth;
|
|
1455
|
+
if (O && io(M).direction === "rtl" && (F = P.offsetX <= M.offsetWidth - M.clientWidth), F || T && P.offsetY > M.clientHeight)
|
|
1458
1456
|
return;
|
|
1459
1457
|
}
|
|
1460
1458
|
const xe = (E = i.current.floatingContext) == null ? void 0 : E.nodeId, he = g && We(g.nodesRef.current, xe).some((T) => {
|
|
@@ -1480,7 +1478,7 @@ function di(e, r) {
|
|
|
1480
1478
|
var E;
|
|
1481
1479
|
const D = () => {
|
|
1482
1480
|
var B;
|
|
1483
|
-
|
|
1481
|
+
X(P), (B = Le(P)) == null || B.removeEventListener(c, D);
|
|
1484
1482
|
};
|
|
1485
1483
|
(E = Le(P)) == null || E.addEventListener(c, D);
|
|
1486
1484
|
});
|
|
@@ -1492,26 +1490,26 @@ function di(e, r) {
|
|
|
1492
1490
|
n(!1, B, "ancestor-scroll");
|
|
1493
1491
|
}
|
|
1494
1492
|
const E = be(o.floating);
|
|
1495
|
-
a && E.addEventListener("keydown",
|
|
1493
|
+
a && E.addEventListener("keydown", k ? Z : $, k), x && E.addEventListener(c, j ? q : X, j);
|
|
1496
1494
|
let D = [];
|
|
1497
|
-
return h && (ge(o.domReference) && (D =
|
|
1498
|
-
var
|
|
1499
|
-
return B !== ((
|
|
1495
|
+
return h && (ge(o.domReference) && (D = kt(o.domReference)), ge(o.floating) && (D = D.concat(kt(o.floating))), !ge(o.reference) && o.reference && o.reference.contextElement && (D = D.concat(kt(o.reference.contextElement)))), D = D.filter((B) => {
|
|
1496
|
+
var M;
|
|
1497
|
+
return B !== ((M = E.defaultView) == null ? void 0 : M.visualViewport);
|
|
1500
1498
|
}), D.forEach((B) => {
|
|
1501
1499
|
B.addEventListener("scroll", P, {
|
|
1502
1500
|
passive: !0
|
|
1503
1501
|
});
|
|
1504
1502
|
}), () => {
|
|
1505
|
-
a && E.removeEventListener("keydown",
|
|
1503
|
+
a && E.removeEventListener("keydown", k ? Z : $, k), x && E.removeEventListener(c, j ? q : X, j), D.forEach((B) => {
|
|
1506
1504
|
B.removeEventListener("scroll", P);
|
|
1507
1505
|
});
|
|
1508
1506
|
};
|
|
1509
|
-
}, [i, o, a, x, c, t, n, h, s, w, _, $,
|
|
1507
|
+
}, [i, o, a, x, c, t, n, h, s, w, _, $, k, Z, X, j, q]), p.useEffect(() => {
|
|
1510
1508
|
y.current = !1;
|
|
1511
1509
|
}, [x, c]);
|
|
1512
1510
|
const S = p.useMemo(() => ({
|
|
1513
1511
|
onKeyDown: $,
|
|
1514
|
-
[
|
|
1512
|
+
[li[d]]: (P) => {
|
|
1515
1513
|
f && n(!1, P.nativeEvent, "reference-press");
|
|
1516
1514
|
}
|
|
1517
1515
|
}), [$, n, f, d]), N = p.useMemo(() => ({
|
|
@@ -1522,7 +1520,7 @@ function di(e, r) {
|
|
|
1522
1520
|
onMouseUp() {
|
|
1523
1521
|
b.current = !0;
|
|
1524
1522
|
},
|
|
1525
|
-
[
|
|
1523
|
+
[ci[c]]: () => {
|
|
1526
1524
|
y.current = !0;
|
|
1527
1525
|
}
|
|
1528
1526
|
}), [$, c]);
|
|
@@ -1531,15 +1529,15 @@ function di(e, r) {
|
|
|
1531
1529
|
floating: N
|
|
1532
1530
|
} : {}, [s, S, N]);
|
|
1533
1531
|
}
|
|
1534
|
-
function
|
|
1532
|
+
function di(e) {
|
|
1535
1533
|
const {
|
|
1536
1534
|
open: r = !1,
|
|
1537
1535
|
onOpenChange: t,
|
|
1538
1536
|
elements: n
|
|
1539
|
-
} = e, o = Jt(), i = p.useRef({}), [s] = p.useState(() =>
|
|
1537
|
+
} = e, o = Jt(), i = p.useRef({}), [s] = p.useState(() => Uo()), a = Qt() != null;
|
|
1540
1538
|
if (process.env.NODE_ENV !== "production") {
|
|
1541
1539
|
const u = n.reference;
|
|
1542
|
-
u && !ge(u) &&
|
|
1540
|
+
u && !ge(u) && Ho("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1543
1541
|
}
|
|
1544
1542
|
const [l, c] = p.useState(n.reference), f = Ce((u, m, g) => {
|
|
1545
1543
|
i.current.openEvent = u ? m : void 0, s.emit("openchange", {
|
|
@@ -1565,11 +1563,11 @@ function fi(e) {
|
|
|
1565
1563
|
refs: d
|
|
1566
1564
|
}), [r, f, h, s, o, d]);
|
|
1567
1565
|
}
|
|
1568
|
-
function
|
|
1566
|
+
function fi(e) {
|
|
1569
1567
|
e === void 0 && (e = {});
|
|
1570
1568
|
const {
|
|
1571
1569
|
nodeId: r
|
|
1572
|
-
} = e, t =
|
|
1570
|
+
} = e, t = di({
|
|
1573
1571
|
...e,
|
|
1574
1572
|
elements: {
|
|
1575
1573
|
reference: null,
|
|
@@ -1580,7 +1578,7 @@ function hi(e) {
|
|
|
1580
1578
|
Q(() => {
|
|
1581
1579
|
f && (d.current = f);
|
|
1582
1580
|
}, [f]);
|
|
1583
|
-
const u =
|
|
1581
|
+
const u = Do({
|
|
1584
1582
|
...e,
|
|
1585
1583
|
elements: {
|
|
1586
1584
|
...o,
|
|
@@ -1625,14 +1623,14 @@ function hi(e) {
|
|
|
1625
1623
|
elements: x
|
|
1626
1624
|
}), [u, C, x, y]);
|
|
1627
1625
|
}
|
|
1628
|
-
const
|
|
1626
|
+
const Mn = "active", kn = "selected";
|
|
1629
1627
|
function Vt(e, r, t) {
|
|
1630
1628
|
const n = /* @__PURE__ */ new Map(), o = t === "item";
|
|
1631
1629
|
let i = e;
|
|
1632
1630
|
if (o && e) {
|
|
1633
1631
|
const {
|
|
1634
|
-
[
|
|
1635
|
-
[
|
|
1632
|
+
[Mn]: s,
|
|
1633
|
+
[kn]: a,
|
|
1636
1634
|
...l
|
|
1637
1635
|
} = e;
|
|
1638
1636
|
i = l;
|
|
@@ -1648,7 +1646,7 @@ function Vt(e, r, t) {
|
|
|
1648
1646
|
return typeof a == "function" ? e ? a(e) : null : a;
|
|
1649
1647
|
}).concat(e).reduce((s, a) => (a && Object.entries(a).forEach((l) => {
|
|
1650
1648
|
let [c, f] = l;
|
|
1651
|
-
if (!(o && [
|
|
1649
|
+
if (!(o && [Mn, kn].includes(c)))
|
|
1652
1650
|
if (c.indexOf("on") === 0) {
|
|
1653
1651
|
if (n.has(c) || n.set(c, []), typeof f == "function") {
|
|
1654
1652
|
var d;
|
|
@@ -1663,7 +1661,7 @@ function Vt(e, r, t) {
|
|
|
1663
1661
|
}), s), {})
|
|
1664
1662
|
};
|
|
1665
1663
|
}
|
|
1666
|
-
function
|
|
1664
|
+
function hi(e) {
|
|
1667
1665
|
e === void 0 && (e = []);
|
|
1668
1666
|
const r = e.map((a) => a?.reference), t = e.map((a) => a?.floating), n = e.map((a) => a?.item), o = p.useCallback(
|
|
1669
1667
|
(a) => Vt(a, e, "reference"),
|
|
@@ -1701,13 +1699,13 @@ function Pn(e, r) {
|
|
|
1701
1699
|
function Bt(e, r, t) {
|
|
1702
1700
|
return Rt(r, e === st, t ? e === Ue : e === Ze) || e === "Enter" || e === " " || e === "";
|
|
1703
1701
|
}
|
|
1704
|
-
function
|
|
1702
|
+
function mi(e, r, t) {
|
|
1705
1703
|
return Rt(r, t ? e === Ue : e === Ze, e === st);
|
|
1706
1704
|
}
|
|
1707
1705
|
function Dn(e, r, t) {
|
|
1708
1706
|
return Rt(r, t ? e === Ze : e === Ue, e === Zt);
|
|
1709
1707
|
}
|
|
1710
|
-
function
|
|
1708
|
+
function pi(e, r) {
|
|
1711
1709
|
const {
|
|
1712
1710
|
open: t,
|
|
1713
1711
|
onOpenChange: n,
|
|
@@ -1731,15 +1729,15 @@ function bi(e, r) {
|
|
|
1731
1729
|
orientation: b = "vertical",
|
|
1732
1730
|
cols: w = 1,
|
|
1733
1731
|
scrollItemIntoView: _ = !0,
|
|
1734
|
-
virtualItemRef:
|
|
1732
|
+
virtualItemRef: k,
|
|
1735
1733
|
itemSizes: j,
|
|
1736
1734
|
dense: $ = !1
|
|
1737
1735
|
} = r;
|
|
1738
1736
|
process.env.NODE_ENV !== "production" && (f && (d || Ft("`useListNavigation` looping must be enabled to allow escaping."), m || Ft("`useListNavigation` must be virtual to allow escaping.")), b === "vertical" && w > 1 && Ft("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
1739
|
-
const Z = pr(o.floating),
|
|
1737
|
+
const Z = pr(o.floating), X = Pe(Z), q = Qt(), S = It(), N = Ce(a), P = p.useRef(g), E = p.useRef(c ?? -1), D = p.useRef(null), B = p.useRef(!0), M = p.useRef(N), R = p.useRef(!!o.floating), U = p.useRef(t), te = p.useRef(!1), xe = p.useRef(!1), he = Pe(y), z = Pe(t), T = Pe(_), O = Pe(c), [F, H] = p.useState(), [ee, ne] = p.useState(), Y = Ce(function(L, V, I) {
|
|
1740
1738
|
I === void 0 && (I = !1);
|
|
1741
1739
|
function W(K) {
|
|
1742
|
-
m ? (H(K.id), S?.events.emit("virtualfocus", K),
|
|
1740
|
+
m ? (H(K.id), S?.events.emit("virtualfocus", K), k && (k.current = K)) : Ne(K, {
|
|
1743
1741
|
preventScroll: !0,
|
|
1744
1742
|
// Mac Safari does not move the virtual cursor unless the focus call
|
|
1745
1743
|
// is sync. However, for the very first focus call, we need to wait
|
|
@@ -1749,14 +1747,14 @@ function bi(e, r) {
|
|
|
1749
1747
|
// subsequent calls. `preventScroll` is supported in modern Safari,
|
|
1750
1748
|
// so we can use that instead.
|
|
1751
1749
|
// iOS Safari must be async or the first item will not be focused.
|
|
1752
|
-
sync:
|
|
1750
|
+
sync: ao() && tr() ? Nn || te.current : !1
|
|
1753
1751
|
});
|
|
1754
1752
|
}
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
const K = L.current[V.current] ||
|
|
1753
|
+
const se = L.current[V.current];
|
|
1754
|
+
se && W(se), requestAnimationFrame(() => {
|
|
1755
|
+
const K = L.current[V.current] || se;
|
|
1758
1756
|
if (!K) return;
|
|
1759
|
-
|
|
1757
|
+
se || W(K);
|
|
1760
1758
|
const re = T.current;
|
|
1761
1759
|
re && Ee && (I || !B.current) && (K.scrollIntoView == null || K.scrollIntoView(typeof re == "boolean" ? {
|
|
1762
1760
|
block: "nearest",
|
|
@@ -1771,7 +1769,7 @@ function bi(e, r) {
|
|
|
1771
1769
|
}
|
|
1772
1770
|
});
|
|
1773
1771
|
}, []), Q(() => {
|
|
1774
|
-
l && (t && o.floating ? P.current && c != null && (xe.current = !0, E.current = c, N(c)) : R.current && (E.current = -1,
|
|
1772
|
+
l && (t && o.floating ? P.current && c != null && (xe.current = !0, E.current = c, N(c)) : R.current && (E.current = -1, M.current(null)));
|
|
1775
1773
|
}, [l, t, o.floating, c, N]), Q(() => {
|
|
1776
1774
|
if (l && t && o.floating)
|
|
1777
1775
|
if (s == null) {
|
|
@@ -1789,20 +1787,20 @@ function bi(e, r) {
|
|
|
1789
1787
|
var L;
|
|
1790
1788
|
if (!l || o.floating || !S || m || !R.current)
|
|
1791
1789
|
return;
|
|
1792
|
-
const V = S.nodesRef.current, I = (L = V.find((K) => K.id === q)) == null || (L = L.context) == null ? void 0 : L.elements.floating, W = Se(be(o.floating)),
|
|
1793
|
-
I && !
|
|
1790
|
+
const V = S.nodesRef.current, I = (L = V.find((K) => K.id === q)) == null || (L = L.context) == null ? void 0 : L.elements.floating, W = Se(be(o.floating)), se = V.some((K) => K.context && de(K.context.elements.floating, W));
|
|
1791
|
+
I && !se && B.current && I.focus({
|
|
1794
1792
|
preventScroll: !0
|
|
1795
1793
|
});
|
|
1796
1794
|
}, [l, o.floating, S, q, m]), Q(() => {
|
|
1797
1795
|
if (!l || !S || !m || q) return;
|
|
1798
1796
|
function L(V) {
|
|
1799
|
-
ne(V.id),
|
|
1797
|
+
ne(V.id), k && (k.current = V);
|
|
1800
1798
|
}
|
|
1801
1799
|
return S.events.on("virtualfocus", L), () => {
|
|
1802
1800
|
S.events.off("virtualfocus", L);
|
|
1803
1801
|
};
|
|
1804
|
-
}, [l, S, m, q,
|
|
1805
|
-
|
|
1802
|
+
}, [l, S, m, q, k]), Q(() => {
|
|
1803
|
+
M.current = N, R.current = !!o.floating;
|
|
1806
1804
|
}), Q(() => {
|
|
1807
1805
|
t || (D.current = null);
|
|
1808
1806
|
}, [t]), Q(() => {
|
|
@@ -1841,14 +1839,14 @@ function bi(e, r) {
|
|
|
1841
1839
|
let {
|
|
1842
1840
|
pointerType: W
|
|
1843
1841
|
} = I;
|
|
1844
|
-
!B.current || W === "touch" || (E.current = -1, Y(i, E), N(null), m || Ne(
|
|
1842
|
+
!B.current || W === "touch" || (E.current = -1, Y(i, E), N(null), m || Ne(X.current, {
|
|
1845
1843
|
preventScroll: !0
|
|
1846
1844
|
}));
|
|
1847
1845
|
}
|
|
1848
1846
|
}
|
|
1849
1847
|
};
|
|
1850
|
-
}, [t,
|
|
1851
|
-
if (B.current = !1, te.current = !0, !z.current && L.currentTarget ===
|
|
1848
|
+
}, [t, X, Y, C, i, N, m]), J = Ce((L) => {
|
|
1849
|
+
if (B.current = !1, te.current = !0, !z.current && L.currentTarget === X.current)
|
|
1852
1850
|
return;
|
|
1853
1851
|
if (h && Dn(L.key, b, u)) {
|
|
1854
1852
|
fe(L), n(!1, L.nativeEvent, "list-navigation"), Oe(o.domReference) && !m && o.domReference.focus();
|
|
@@ -1856,12 +1854,12 @@ function bi(e, r) {
|
|
|
1856
1854
|
}
|
|
1857
1855
|
const V = E.current, I = _t(i, y), W = vn(i, y);
|
|
1858
1856
|
if (L.key === "Home" && (fe(L), E.current = I, N(E.current)), L.key === "End" && (fe(L), E.current = W, N(E.current)), w > 1) {
|
|
1859
|
-
const
|
|
1857
|
+
const se = j || Array.from({
|
|
1860
1858
|
length: i.current.length
|
|
1861
1859
|
}, () => ({
|
|
1862
1860
|
width: 1,
|
|
1863
1861
|
height: 1
|
|
1864
|
-
})), K =
|
|
1862
|
+
})), K = Bo(se, w, $), re = K.findIndex((we) => we != null && !mt(i.current, we, y)), je = K.reduce((we, Me, lt) => Me != null && !mt(i.current, Me, y) ? lt : we, -1), Je = K[Vo({
|
|
1865
1863
|
current: K.map((we) => we != null ? i.current[we] : null)
|
|
1866
1864
|
}, {
|
|
1867
1865
|
event: L,
|
|
@@ -1870,12 +1868,12 @@ function bi(e, r) {
|
|
|
1870
1868
|
cols: w,
|
|
1871
1869
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
1872
1870
|
// don't end up in them
|
|
1873
|
-
disabledIndices:
|
|
1871
|
+
disabledIndices: $o([...y || i.current.map((we, Me) => mt(i.current, Me) ? Me : void 0), void 0], K),
|
|
1874
1872
|
minIndex: re,
|
|
1875
1873
|
maxIndex: je,
|
|
1876
|
-
prevIndex:
|
|
1874
|
+
prevIndex: jo(
|
|
1877
1875
|
E.current > W ? I : E.current,
|
|
1878
|
-
|
|
1876
|
+
se,
|
|
1879
1877
|
K,
|
|
1880
1878
|
w,
|
|
1881
1879
|
// use a corner matching the edge closest to the direction
|
|
@@ -1893,17 +1891,17 @@ function bi(e, r) {
|
|
|
1893
1891
|
E.current = Bt(L.key, b, u) ? I : W, N(E.current);
|
|
1894
1892
|
return;
|
|
1895
1893
|
}
|
|
1896
|
-
Bt(L.key, b, u) ? d ? E.current = V >= W ? f && V !== i.current.length ? -1 : I :
|
|
1894
|
+
Bt(L.key, b, u) ? d ? E.current = V >= W ? f && V !== i.current.length ? -1 : I : ae(i, {
|
|
1897
1895
|
startingIndex: V,
|
|
1898
1896
|
disabledIndices: y
|
|
1899
|
-
}) : E.current = Math.min(W,
|
|
1897
|
+
}) : E.current = Math.min(W, ae(i, {
|
|
1900
1898
|
startingIndex: V,
|
|
1901
1899
|
disabledIndices: y
|
|
1902
|
-
})) : d ? E.current = V <= I ? f && V !== -1 ? i.current.length : W :
|
|
1900
|
+
})) : d ? E.current = V <= I ? f && V !== -1 ? i.current.length : W : ae(i, {
|
|
1903
1901
|
startingIndex: V,
|
|
1904
1902
|
decrement: !0,
|
|
1905
1903
|
disabledIndices: y
|
|
1906
|
-
}) : E.current = Math.max(I,
|
|
1904
|
+
}) : E.current = Math.max(I, ae(i, {
|
|
1907
1905
|
startingIndex: V,
|
|
1908
1906
|
decrement: !0,
|
|
1909
1907
|
disabledIndices: y
|
|
@@ -1929,22 +1927,22 @@ function bi(e, r) {
|
|
|
1929
1927
|
...Re,
|
|
1930
1928
|
onKeyDown(I) {
|
|
1931
1929
|
B.current = !1;
|
|
1932
|
-
const W = I.key.indexOf("Arrow") === 0,
|
|
1930
|
+
const W = I.key.indexOf("Arrow") === 0, se = mi(I.key, b, u), K = Dn(I.key, b, u), re = Pn(I.key, b), je = (h ? se : re) || I.key === "Enter" || I.key.trim() === "";
|
|
1933
1931
|
if (m && t) {
|
|
1934
|
-
const lt = S?.nodesRef.current.find((ct) => ct.parentId == null),
|
|
1935
|
-
if (W &&
|
|
1932
|
+
const lt = S?.nodesRef.current.find((ct) => ct.parentId == null), ke = S && lt ? Zo(S.nodesRef.current, lt.id) : null;
|
|
1933
|
+
if (W && ke && k) {
|
|
1936
1934
|
const ct = new KeyboardEvent("keydown", {
|
|
1937
1935
|
key: I.key,
|
|
1938
1936
|
bubbles: !0
|
|
1939
1937
|
});
|
|
1940
|
-
if (
|
|
1938
|
+
if (se || K) {
|
|
1941
1939
|
var Je, we;
|
|
1942
|
-
const zr = ((Je =
|
|
1940
|
+
const zr = ((Je = ke.context) == null ? void 0 : Je.elements.domReference) === I.currentTarget, un = K && !zr ? (we = ke.context) == null ? void 0 : we.elements.domReference : se ? i.current.find((dn) => dn?.id === F) : null;
|
|
1943
1941
|
un && (fe(I), un.dispatchEvent(ct), ne(void 0));
|
|
1944
1942
|
}
|
|
1945
|
-
if (re &&
|
|
1946
|
-
var
|
|
1947
|
-
fe(I), (
|
|
1943
|
+
if (re && ke.context && ke.context.open && ke.parentId && I.currentTarget !== ke.context.elements.domReference) {
|
|
1944
|
+
var Me;
|
|
1945
|
+
fe(I), (Me = ke.context.elements.domReference) == null || Me.dispatchEvent(ct);
|
|
1948
1946
|
return;
|
|
1949
1947
|
}
|
|
1950
1948
|
}
|
|
@@ -1952,7 +1950,7 @@ function bi(e, r) {
|
|
|
1952
1950
|
}
|
|
1953
1951
|
if (!(!t && !x && W)) {
|
|
1954
1952
|
if (je && (D.current = h && re ? null : I.key), h) {
|
|
1955
|
-
|
|
1953
|
+
se && (fe(I), t ? (E.current = _t(i, he.current), N(E.current)) : n(!0, I.nativeEvent, "list-navigation"));
|
|
1956
1954
|
return;
|
|
1957
1955
|
}
|
|
1958
1956
|
re && (c != null && (E.current = c), fe(I), !t && x ? n(!0, I.nativeEvent, "list-navigation") : J(I), t && N(E.current));
|
|
@@ -1965,15 +1963,15 @@ function bi(e, r) {
|
|
|
1965
1963
|
onMouseDown: L,
|
|
1966
1964
|
onClick: L
|
|
1967
1965
|
};
|
|
1968
|
-
}, [F, Re, J, he, g, i, h, N, n, t, x, b, u, c, S, m,
|
|
1966
|
+
}, [F, Re, J, he, g, i, h, N, n, t, x, b, u, c, S, m, k]);
|
|
1969
1967
|
return p.useMemo(() => l ? {
|
|
1970
1968
|
reference: _e,
|
|
1971
1969
|
floating: me,
|
|
1972
1970
|
item: Ee
|
|
1973
1971
|
} : {}, [l, _e, me, Ee]);
|
|
1974
1972
|
}
|
|
1975
|
-
const
|
|
1976
|
-
function
|
|
1973
|
+
const bi = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
1974
|
+
function gi(e, r) {
|
|
1977
1975
|
var t;
|
|
1978
1976
|
r === void 0 && (r = {});
|
|
1979
1977
|
const {
|
|
@@ -1982,7 +1980,7 @@ function vi(e, r) {
|
|
|
1982
1980
|
} = e, {
|
|
1983
1981
|
enabled: i = !0,
|
|
1984
1982
|
role: s = "dialog"
|
|
1985
|
-
} = r, a = (t =
|
|
1983
|
+
} = r, a = (t = bi.get(s)) != null ? t : s, l = Jt(), f = Qt() != null, d = p.useMemo(() => a === "tooltip" || s === "label" ? {
|
|
1986
1984
|
["aria-" + (s === "label" ? "labelledby" : "describedby")]: n ? o : void 0
|
|
1987
1985
|
} : {
|
|
1988
1986
|
"aria-expanded": n ? "true" : "false",
|
|
@@ -2089,7 +2087,7 @@ function An(e, r) {
|
|
|
2089
2087
|
throw new Error("Unexpected undefined");
|
|
2090
2088
|
return e;
|
|
2091
2089
|
}
|
|
2092
|
-
const
|
|
2090
|
+
const vi = (e, r) => Math.abs(e - r) < 1.01, yi = (e, r, t) => {
|
|
2093
2091
|
let n;
|
|
2094
2092
|
return function(...o) {
|
|
2095
2093
|
e.clearTimeout(n), n = e.setTimeout(() => r.apply(this, o), t);
|
|
@@ -2097,12 +2095,12 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2097
2095
|
}, _n = (e) => {
|
|
2098
2096
|
const { offsetWidth: r, offsetHeight: t } = e;
|
|
2099
2097
|
return { width: r, height: t };
|
|
2100
|
-
},
|
|
2098
|
+
}, xi = (e) => e, wi = (e) => {
|
|
2101
2099
|
const r = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
2102
2100
|
for (let o = r; o <= t; o++)
|
|
2103
2101
|
n.push(o);
|
|
2104
2102
|
return n;
|
|
2105
|
-
},
|
|
2103
|
+
}, Ci = (e, r) => {
|
|
2106
2104
|
const t = e.scrollElement;
|
|
2107
2105
|
if (!t)
|
|
2108
2106
|
return;
|
|
@@ -2135,7 +2133,7 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2135
2133
|
};
|
|
2136
2134
|
}, Fn = {
|
|
2137
2135
|
passive: !0
|
|
2138
|
-
}, Ln = typeof window > "u" ? !0 : "onscrollend" in window,
|
|
2136
|
+
}, Ln = typeof window > "u" ? !0 : "onscrollend" in window, Ei = (e, r) => {
|
|
2139
2137
|
const t = e.scrollElement;
|
|
2140
2138
|
if (!t)
|
|
2141
2139
|
return;
|
|
@@ -2144,7 +2142,7 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2144
2142
|
return;
|
|
2145
2143
|
let o = 0;
|
|
2146
2144
|
const i = e.options.useScrollendEvent && Ln ? () => {
|
|
2147
|
-
} :
|
|
2145
|
+
} : yi(
|
|
2148
2146
|
n,
|
|
2149
2147
|
() => {
|
|
2150
2148
|
r(o, !1);
|
|
@@ -2159,7 +2157,7 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2159
2157
|
return c && t.addEventListener("scrollend", l, Fn), () => {
|
|
2160
2158
|
t.removeEventListener("scroll", a), c && t.removeEventListener("scrollend", l);
|
|
2161
2159
|
};
|
|
2162
|
-
},
|
|
2160
|
+
}, Ii = (e, r, t) => {
|
|
2163
2161
|
if (r?.borderBoxSize) {
|
|
2164
2162
|
const n = r.borderBoxSize[0];
|
|
2165
2163
|
if (n)
|
|
@@ -2168,7 +2166,7 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2168
2166
|
);
|
|
2169
2167
|
}
|
|
2170
2168
|
return e[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
2171
|
-
},
|
|
2169
|
+
}, Ri = (e, {
|
|
2172
2170
|
adjustments: r = 0,
|
|
2173
2171
|
behavior: t
|
|
2174
2172
|
}, n) => {
|
|
@@ -2179,7 +2177,7 @@ const yi = (e, r) => Math.abs(e - r) < 1.01, xi = (e, r, t) => {
|
|
|
2179
2177
|
behavior: t
|
|
2180
2178
|
});
|
|
2181
2179
|
};
|
|
2182
|
-
class
|
|
2180
|
+
class Oi {
|
|
2183
2181
|
constructor(r) {
|
|
2184
2182
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
2185
2183
|
let t = null;
|
|
@@ -2217,11 +2215,11 @@ class Si {
|
|
|
2217
2215
|
scrollPaddingStart: 0,
|
|
2218
2216
|
scrollPaddingEnd: 0,
|
|
2219
2217
|
horizontal: !1,
|
|
2220
|
-
getItemKey:
|
|
2221
|
-
rangeExtractor:
|
|
2218
|
+
getItemKey: xi,
|
|
2219
|
+
rangeExtractor: wi,
|
|
2222
2220
|
onChange: () => {
|
|
2223
2221
|
},
|
|
2224
|
-
measureElement:
|
|
2222
|
+
measureElement: Ii,
|
|
2225
2223
|
initialRect: { width: 0, height: 0 },
|
|
2226
2224
|
scrollMargin: 0,
|
|
2227
2225
|
gap: 0,
|
|
@@ -2370,7 +2368,7 @@ class Si {
|
|
|
2370
2368
|
this.getScrollOffset(),
|
|
2371
2369
|
this.options.lanes
|
|
2372
2370
|
],
|
|
2373
|
-
(t, n, o, i) => this.range = t.length > 0 && n > 0 ?
|
|
2371
|
+
(t, n, o, i) => this.range = t.length > 0 && n > 0 ? Si({
|
|
2374
2372
|
measurements: t,
|
|
2375
2373
|
outerSize: n,
|
|
2376
2374
|
scrollOffset: o,
|
|
@@ -2517,7 +2515,7 @@ class Si {
|
|
|
2517
2515
|
console.warn("Failed to get offset for index:", t);
|
|
2518
2516
|
return;
|
|
2519
2517
|
}
|
|
2520
|
-
|
|
2518
|
+
vi(g[0], m) || l(h);
|
|
2521
2519
|
};
|
|
2522
2520
|
this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(u) : u();
|
|
2523
2521
|
});
|
|
@@ -2577,7 +2575,7 @@ const br = (e, r, t, n) => {
|
|
|
2577
2575
|
}
|
|
2578
2576
|
return e > 0 ? e - 1 : 0;
|
|
2579
2577
|
};
|
|
2580
|
-
function
|
|
2578
|
+
function Si({
|
|
2581
2579
|
measurements: e,
|
|
2582
2580
|
outerSize: r,
|
|
2583
2581
|
scrollOffset: t,
|
|
@@ -2614,7 +2612,7 @@ function Ti({
|
|
|
2614
2612
|
return { startIndex: s, endIndex: a };
|
|
2615
2613
|
}
|
|
2616
2614
|
const zn = typeof document < "u" ? p.useLayoutEffect : p.useEffect;
|
|
2617
|
-
function
|
|
2615
|
+
function Ti({
|
|
2618
2616
|
useFlushSync: e = !0,
|
|
2619
2617
|
...r
|
|
2620
2618
|
}) {
|
|
@@ -2625,27 +2623,27 @@ function ki({
|
|
|
2625
2623
|
e && s ? Wn(t) : t(), (a = r.onChange) == null || a.call(r, i, s);
|
|
2626
2624
|
}
|
|
2627
2625
|
}, [o] = p.useState(
|
|
2628
|
-
() => new
|
|
2626
|
+
() => new Oi(n)
|
|
2629
2627
|
);
|
|
2630
2628
|
return o.setOptions(n), zn(() => o._didMount(), []), zn(() => o._willUpdate()), o;
|
|
2631
2629
|
}
|
|
2632
2630
|
function Mi(e) {
|
|
2633
|
-
return
|
|
2634
|
-
observeElementRect:
|
|
2635
|
-
observeElementOffset:
|
|
2636
|
-
scrollToFn:
|
|
2631
|
+
return Ti({
|
|
2632
|
+
observeElementRect: Ci,
|
|
2633
|
+
observeElementOffset: Ei,
|
|
2634
|
+
scrollToFn: Ri,
|
|
2637
2635
|
...e
|
|
2638
2636
|
});
|
|
2639
2637
|
}
|
|
2640
2638
|
const Ae = De(void 0), gr = De({
|
|
2641
2639
|
activeIndex: 0
|
|
2642
|
-
}),
|
|
2640
|
+
}), ki = (e, r) => r.type === "SET_ACTIVE_INDEX" ? {
|
|
2643
2641
|
...e,
|
|
2644
2642
|
activeIndex: r.payload
|
|
2645
2643
|
} : e, vr = De(() => {
|
|
2646
2644
|
throw new Error("ComboboxIdDispatch must be used within a provider");
|
|
2647
|
-
}),
|
|
2648
|
-
const [r, t] = Vr(
|
|
2645
|
+
}), Ni = ({ children: e }) => {
|
|
2646
|
+
const [r, t] = Vr(ki, {
|
|
2649
2647
|
activeIndex: 0
|
|
2650
2648
|
});
|
|
2651
2649
|
return v(gr.Provider, { value: r, children: v(vr.Provider, { value: t, children: e }) });
|
|
@@ -2659,7 +2657,7 @@ function Ot() {
|
|
|
2659
2657
|
const yr = A(({ asChild: e, interactive: r, id: t, className: n, ...o }, i) => {
|
|
2660
2658
|
if (r && !t)
|
|
2661
2659
|
throw new Error("If ComboboxCustom is interactive, it must have an id");
|
|
2662
|
-
const s = e ?
|
|
2660
|
+
const s = e ? ue : "div", a = Ve(), { activeIndex: l } = Ot(), c = oe(Ae);
|
|
2663
2661
|
if (!c)
|
|
2664
2662
|
throw new Error("ComboboxCustom must be used within a Combobox");
|
|
2665
2663
|
const { customIds: f, setListRef: d, getItemProps: h, size: u } = c, m = ze(() => t && f.indexOf(t) || 0, [t, f]), g = Yt([
|
|
@@ -2668,22 +2666,22 @@ const yr = A(({ asChild: e, interactive: r, id: t, className: n, ...o }, i) => {
|
|
|
2668
2666
|
},
|
|
2669
2667
|
i
|
|
2670
2668
|
]);
|
|
2671
|
-
return v(Te, { "data-size": u, asChild: !0, children: v(s, { ref: g, tabIndex: -1, className:
|
|
2669
|
+
return v(Te, { "data-size": u, asChild: !0, children: v(s, { ref: g, tabIndex: -1, className: G("ds-combobox__custom", n), id: t || a, role: "option", "aria-selected": l === m, "data-active": l === m, ...qe(["interactive"], o), ...qe(["onClick", "onPointerLeave"], h()) }) });
|
|
2672
2670
|
}), xr = ({ size: e, error: r, formFieldProps: t }) => v("div", { className: "ds-combobox__error-message", id: t.errorId, "aria-live": "polite", "aria-relevant": "additions removals", children: r && v(Xt, { "data-size": e, children: r }) });
|
|
2673
2671
|
xr.displayName = "ComboboxError";
|
|
2674
2672
|
let Vn = 0;
|
|
2675
|
-
function
|
|
2673
|
+
function Pi(e) {
|
|
2676
2674
|
const [r, t] = ye(e), n = e || r;
|
|
2677
|
-
return
|
|
2675
|
+
return ce(() => {
|
|
2678
2676
|
r == null && (Vn += 1, t(`aksel-icon-${Vn}`));
|
|
2679
2677
|
}, [r]), n;
|
|
2680
2678
|
}
|
|
2681
|
-
const Bn =
|
|
2679
|
+
const Bn = le.useId;
|
|
2682
2680
|
function at(e) {
|
|
2683
2681
|
var r;
|
|
2684
|
-
return Bn !== void 0 ? Bn().replace(/(:)/g, "") : (r =
|
|
2682
|
+
return Bn !== void 0 ? Bn().replace(/(:)/g, "") : (r = Pi(e)) !== null && r !== void 0 ? r : "";
|
|
2685
2683
|
}
|
|
2686
|
-
var
|
|
2684
|
+
var Di = function(e, r) {
|
|
2687
2685
|
var t = {};
|
|
2688
2686
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
2689
2687
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2691,17 +2689,17 @@ var Ai = function(e, r) {
|
|
|
2691
2689
|
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
|
|
2692
2690
|
return t;
|
|
2693
2691
|
};
|
|
2694
|
-
const
|
|
2695
|
-
var { title: t, titleId: n } = e, o =
|
|
2692
|
+
const Ai = A((e, r) => {
|
|
2693
|
+
var { title: t, titleId: n } = e, o = Di(e, ["title", "titleId"]);
|
|
2696
2694
|
let i = at();
|
|
2697
|
-
return i = t ? n || "title-" + i : void 0,
|
|
2695
|
+
return i = t ? n || "title-" + i : void 0, le.createElement(
|
|
2698
2696
|
"svg",
|
|
2699
2697
|
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: r, "aria-labelledby": i }, o),
|
|
2700
|
-
t ?
|
|
2701
|
-
|
|
2698
|
+
t ? le.createElement("title", { id: i }, t) : null,
|
|
2699
|
+
le.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
|
|
2702
2700
|
);
|
|
2703
2701
|
});
|
|
2704
|
-
var
|
|
2702
|
+
var _i = function(e, r) {
|
|
2705
2703
|
var t = {};
|
|
2706
2704
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
2707
2705
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2709,17 +2707,17 @@ var Fi = function(e, r) {
|
|
|
2709
2707
|
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
|
|
2710
2708
|
return t;
|
|
2711
2709
|
};
|
|
2712
|
-
const
|
|
2713
|
-
var { title: t, titleId: n } = e, o =
|
|
2710
|
+
const Fi = A((e, r) => {
|
|
2711
|
+
var { title: t, titleId: n } = e, o = _i(e, ["title", "titleId"]);
|
|
2714
2712
|
let i = at();
|
|
2715
|
-
return i = t ? n || "title-" + i : void 0,
|
|
2713
|
+
return i = t ? n || "title-" + i : void 0, le.createElement(
|
|
2716
2714
|
"svg",
|
|
2717
2715
|
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: r, "aria-labelledby": i }, o),
|
|
2718
|
-
t ?
|
|
2719
|
-
|
|
2716
|
+
t ? le.createElement("title", { id: i }, t) : null,
|
|
2717
|
+
le.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M5.97 9.47a.75.75 0 0 1 1.06 0L12 14.44l4.97-4.97a.75.75 0 1 1 1.06 1.06l-5.5 5.5a.75.75 0 0 1-1.06 0l-5.5-5.5a.75.75 0 0 1 0-1.06", clipRule: "evenodd" })
|
|
2720
2718
|
);
|
|
2721
2719
|
});
|
|
2722
|
-
var
|
|
2720
|
+
var Li = function(e, r) {
|
|
2723
2721
|
var t = {};
|
|
2724
2722
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
2725
2723
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2727,17 +2725,17 @@ var zi = function(e, r) {
|
|
|
2727
2725
|
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
|
|
2728
2726
|
return t;
|
|
2729
2727
|
};
|
|
2730
|
-
const
|
|
2731
|
-
var { title: t, titleId: n } = e, o =
|
|
2728
|
+
const zi = A((e, r) => {
|
|
2729
|
+
var { title: t, titleId: n } = e, o = Li(e, ["title", "titleId"]);
|
|
2732
2730
|
let i = at();
|
|
2733
|
-
return i = t ? n || "title-" + i : void 0,
|
|
2731
|
+
return i = t ? n || "title-" + i : void 0, le.createElement(
|
|
2734
2732
|
"svg",
|
|
2735
2733
|
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: r, "aria-labelledby": i }, o),
|
|
2736
|
-
t ?
|
|
2737
|
-
|
|
2734
|
+
t ? le.createElement("title", { id: i }, t) : null,
|
|
2735
|
+
le.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.47 7.97a.75.75 0 0 1 1.06 0l5.5 5.5a.75.75 0 1 1-1.06 1.06L12 9.56l-4.97 4.97a.75.75 0 0 1-1.06-1.06z", clipRule: "evenodd" })
|
|
2738
2736
|
);
|
|
2739
2737
|
});
|
|
2740
|
-
var
|
|
2738
|
+
var Vi = function(e, r) {
|
|
2741
2739
|
var t = {};
|
|
2742
2740
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
2743
2741
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2745,17 +2743,17 @@ var Bi = function(e, r) {
|
|
|
2745
2743
|
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
|
|
2746
2744
|
return t;
|
|
2747
2745
|
};
|
|
2748
|
-
const
|
|
2749
|
-
var { title: t, titleId: n } = e, o =
|
|
2746
|
+
const Bi = A((e, r) => {
|
|
2747
|
+
var { title: t, titleId: n } = e, o = Vi(e, ["title", "titleId"]);
|
|
2750
2748
|
let i = at();
|
|
2751
|
-
return i = t ? n || "title-" + i : void 0,
|
|
2749
|
+
return i = t ? n || "title-" + i : void 0, le.createElement(
|
|
2752
2750
|
"svg",
|
|
2753
2751
|
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: r, "aria-labelledby": i }, o),
|
|
2754
|
-
t ?
|
|
2755
|
-
|
|
2752
|
+
t ? le.createElement("title", { id: i }, t) : null,
|
|
2753
|
+
le.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 2.25A4.75 4.75 0 0 0 7.25 7v2.25H7A1.75 1.75 0 0 0 5.25 11v9c0 .414.336.75.75.75h12a.75.75 0 0 0 .75-.75v-9A1.75 1.75 0 0 0 17 9.25h-.25V7A4.75 4.75 0 0 0 12 2.25m3.25 7V7a3.25 3.25 0 0 0-6.5 0v2.25zM12 13a1.5 1.5 0 0 0-.75 2.8V17a.75.75 0 0 0 1.5 0v-1.2A1.5 1.5 0 0 0 12 13", clipRule: "evenodd" })
|
|
2756
2754
|
);
|
|
2757
2755
|
});
|
|
2758
|
-
var
|
|
2756
|
+
var ji = function(e, r) {
|
|
2759
2757
|
var t = {};
|
|
2760
2758
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
2761
2759
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2763,21 +2761,21 @@ var $i = function(e, r) {
|
|
|
2763
2761
|
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
|
|
2764
2762
|
return t;
|
|
2765
2763
|
};
|
|
2766
|
-
const
|
|
2767
|
-
var { title: t, titleId: n } = e, o =
|
|
2764
|
+
const $i = A((e, r) => {
|
|
2765
|
+
var { title: t, titleId: n } = e, o = ji(e, ["title", "titleId"]);
|
|
2768
2766
|
let i = at();
|
|
2769
|
-
return i = t ? n || "title-" + i : void 0,
|
|
2767
|
+
return i = t ? n || "title-" + i : void 0, le.createElement(
|
|
2770
2768
|
"svg",
|
|
2771
2769
|
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: r, "aria-labelledby": i }, o),
|
|
2772
|
-
t ?
|
|
2773
|
-
|
|
2770
|
+
t ? le.createElement("title", { id: i }, t) : null,
|
|
2771
|
+
le.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" })
|
|
2774
2772
|
);
|
|
2775
2773
|
});
|
|
2776
|
-
function
|
|
2774
|
+
function Ki(e) {
|
|
2777
2775
|
return $n(e) && e.type === yr;
|
|
2778
2776
|
}
|
|
2779
|
-
function
|
|
2780
|
-
return
|
|
2777
|
+
function Wi(e) {
|
|
2778
|
+
return Ki(e) && e.props.interactive === !0;
|
|
2781
2779
|
}
|
|
2782
2780
|
const wr = "internal-option-", pe = (e) => wr + e, Ht = (e) => e.slice(wr.length), Qe = (e, r) => {
|
|
2783
2781
|
const t = e.value;
|
|
@@ -2785,18 +2783,18 @@ const wr = "internal-option-", pe = (e) => wr + e, Ht = (e) => e.slice(wr.length
|
|
|
2785
2783
|
const n = e._valueTracker;
|
|
2786
2784
|
typeof n < "u" && n.setValue(t), e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2787
2785
|
}, Cr = A(function({ asChild: r, className: t, ...n }, o) {
|
|
2788
|
-
return v(r ?
|
|
2786
|
+
return v(r ? ue : "button", { className: G("ds-chip", t), type: r ? void 0 : "button", ref: o, ...n });
|
|
2789
2787
|
}), Er = A(function(r, t) {
|
|
2790
2788
|
return v(Cr, { "data-removable": !0, ref: t, ...r });
|
|
2791
2789
|
}), Ir = A(function({ asChild: r, children: t, className: n, "data-size": o, "data-color": i, ...s }, a) {
|
|
2792
2790
|
const l = s.type ?? "checkbox";
|
|
2793
|
-
return ie(r ?
|
|
2794
|
-
}),
|
|
2791
|
+
return ie(r ? ue : "label", { className: G("ds-chip", n), "data-size": o, "data-color": i, ref: a, children: [v(ot, { ...s, type: l }), v(Ur, { children: t })] });
|
|
2792
|
+
}), qi = A(function(r, t) {
|
|
2795
2793
|
return v(Ir, { ref: t, type: "radio", ...r });
|
|
2796
2794
|
}), St = {
|
|
2797
2795
|
Button: Cr,
|
|
2798
2796
|
Checkbox: Ir,
|
|
2799
|
-
Radio:
|
|
2797
|
+
Radio: qi,
|
|
2800
2798
|
Removable: Er
|
|
2801
2799
|
};
|
|
2802
2800
|
St.Button.displayName = "Chip.Button";
|
|
@@ -2826,11 +2824,11 @@ const Or = A((e, r) => {
|
|
|
2826
2824
|
if (!t)
|
|
2827
2825
|
throw new Error("ComboboxContext is missing");
|
|
2828
2826
|
const { readOnly: n, disabled: o, clearButtonLabel: i, handleSelectOption: s } = t;
|
|
2829
|
-
return v("button", { ...e, ref: r, disabled: o, className:
|
|
2827
|
+
return v("button", { ...e, ref: r, disabled: o, className: G("ds-combobox__clear-button", "ds-focus"), onClick: () => {
|
|
2830
2828
|
n || o || s({ option: null, clear: !0 });
|
|
2831
2829
|
}, onKeyDown: (a) => {
|
|
2832
2830
|
n || o || a.key === "Enter" && (a.stopPropagation(), s({ option: null, clear: !0 }));
|
|
2833
|
-
}, type: "button", "aria-label": i, children: v(
|
|
2831
|
+
}, type: "button", "aria-label": i, children: v($i, { fontSize: "1.5em", title: "Clear selection" }) });
|
|
2834
2832
|
});
|
|
2835
2833
|
Or.displayName = "ComboboxClearButton";
|
|
2836
2834
|
const Sr = ({ hideClearButton: e, listId: r, error: t, hideChips: n, handleKeyDown: o, ...i }) => {
|
|
@@ -2839,7 +2837,7 @@ const Sr = ({ hideClearButton: e, listId: r, error: t, hideChips: n, handleKeyDo
|
|
|
2839
2837
|
throw new Error("ComboboxContext is missing");
|
|
2840
2838
|
const c = (E) => {
|
|
2841
2839
|
a?.({ type: "SET_ACTIVE_INDEX", payload: E });
|
|
2842
|
-
}, { forwareddRef: f, readOnly: d, disabled: h, open: u, inputRef: m, refs: g, inputValue: C, multiple: x, selectedOptions: y, formFieldProps: b, htmlSize: w, options: _, setOpen:
|
|
2840
|
+
}, { forwareddRef: f, readOnly: d, disabled: h, open: u, inputRef: m, refs: g, inputValue: C, multiple: x, selectedOptions: y, formFieldProps: b, htmlSize: w, options: _, setOpen: k, getReferenceProps: j, setInputValue: $, handleSelectOption: Z, size: X } = s, q = Yt([f, m]), S = (E) => {
|
|
2843
2841
|
const D = E.target.value;
|
|
2844
2842
|
$(D), c(0);
|
|
2845
2843
|
for (const B of Object.values(_))
|
|
@@ -2856,7 +2854,7 @@ const Sr = ({ hideClearButton: e, listId: r, error: t, hideChips: n, handleKeyDo
|
|
|
2856
2854
|
"aria-haspopup": null,
|
|
2857
2855
|
/* If we click the wrapper, toggle open, set index to first option, and focus the input */
|
|
2858
2856
|
onClick(E) {
|
|
2859
|
-
h || d || l.current?.contains(E.target) || (
|
|
2857
|
+
h || d || l.current?.contains(E.target) || (k(!u), c(0), m.current?.focus());
|
|
2860
2858
|
},
|
|
2861
2859
|
/* Handles list navigation */
|
|
2862
2860
|
onKeyDown: o,
|
|
@@ -2865,24 +2863,24 @@ const Sr = ({ hideClearButton: e, listId: r, error: t, hideChips: n, handleKeyDo
|
|
|
2865
2863
|
E.key === "Enter" && E.preventDefault();
|
|
2866
2864
|
}
|
|
2867
2865
|
});
|
|
2868
|
-
return v(jt, { "data-size":
|
|
2869
|
-
S(E), !u &&
|
|
2870
|
-
} }) })] }), N && v(Or, { ref: l }), v("div", { className: "ds-combobox__arrow", children: u ? v(
|
|
2866
|
+
return v(jt, { "data-size": X, asChild: !0, children: ie("div", { ...P, "aria-disabled": h ? "true" : void 0, className: G("ds-textfield__input", "ds-combobox__input__wrapper", d && "ds-combobox--readonly", t && "ds-combobox--error"), children: [ie("div", { className: "ds-combobox__chip-and-input", children: [x && !n && v(Rr, {}), v(jt, { "data-size": X, asChild: !0, children: v("input", { ref: q, "aria-activedescendant": P["aria-activedescendant"], readOnly: d, "aria-autocomplete": "list", role: "combobox", "aria-expanded": u, "aria-controls": u ? r : void 0, autoComplete: "off", size: w, value: C, ...qe(["style", "className"], i), ...b.inputProps, className: "ds-combobox__input", onChange: (E) => {
|
|
2867
|
+
S(E), !u && k(!0), i.onChange?.(E);
|
|
2868
|
+
} }) })] }), N && v(Or, { ref: l }), v("div", { className: "ds-combobox__arrow", children: u ? v(zi, { title: "arrow up", fontSize: "1.5em" }) : v(Fi, { title: "arrow down", fontSize: "1.5em" }) })] }) });
|
|
2871
2869
|
};
|
|
2872
2870
|
Sr.displayName = "ComboboxInput";
|
|
2873
|
-
const Tr = ({ label: e, description: r, hideLabel: t, size: n, readOnly: o, formFieldProps: i }) => ie(Ut, { children: [e && ie(Te, { "data-size": n, htmlFor: i.inputProps.id, className:
|
|
2871
|
+
const Tr = ({ label: e, description: r, hideLabel: t, size: n, readOnly: o, formFieldProps: i }) => ie(Ut, { children: [e && ie(Te, { "data-size": n, htmlFor: i.inputProps.id, className: G("ds-combobox__label", t && "ds-sr-only"), children: [o && v(Bi, { "aria-hidden": !0, className: "ds-combobox__readonly__icon" }), e] }), r && v(jt, { asChild: !0, "data-size": n, children: v("div", { id: i.descriptionId, className: G("ds-combobox__description", t && "ds-sr-only"), children: r }) })] });
|
|
2874
2872
|
Tr.displayName = "ComboboxLabel";
|
|
2875
|
-
const
|
|
2873
|
+
const Mr = ({ selectedOptions: e, multiple: r, name: t }) => {
|
|
2876
2874
|
const n = Object.keys(e).map((o) => Ht(o));
|
|
2877
2875
|
return v("select", { name: t, multiple: r, style: { display: "none" }, value: r ? n : n[0], onChange: () => {
|
|
2878
2876
|
}, children: n.map((o) => v("option", { value: o }, o)) });
|
|
2879
2877
|
};
|
|
2880
|
-
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
const Nr = ({ multiple: e, selected: r }) => v("div", { className:
|
|
2878
|
+
Mr.displayName = "ComboboxNative";
|
|
2879
|
+
const kr = A(({ children: e, className: r, ...t }, n) => v("span", { className: G("ds-combobox__option__description", r), ref: n, ...t, children: e }));
|
|
2880
|
+
kr.displayName = "ComboboxOptionDescription";
|
|
2881
|
+
const Nr = ({ multiple: e, selected: r }) => v("div", { className: G(e && "ds-combobox__option__icon-wrapper", r && "ds-combobox__option__icon-wrapper--selected"), children: r && v(Ai, { className: "ds-combobox__option__icon-wrapper__icon", "aria-hidden": !0 }) });
|
|
2884
2882
|
Nr.displayName = "SelectedIcon";
|
|
2885
|
-
const
|
|
2883
|
+
const Hi = ({ id: e, ref: r, value: t }) => {
|
|
2886
2884
|
const n = Ve(), o = e || n, i = oe(Ae), { activeIndex: s } = Ot(), a = tn();
|
|
2887
2885
|
if (!i)
|
|
2888
2886
|
throw new Error("ComboboxOption must be used within a Combobox");
|
|
@@ -2895,7 +2893,7 @@ const Ui = ({ id: e, ref: r, value: t }) => {
|
|
|
2895
2893
|
if (u === -1)
|
|
2896
2894
|
throw new Error("Internal error: ComboboxOption did not find index");
|
|
2897
2895
|
const g = l[pe(t)], C = s === u;
|
|
2898
|
-
|
|
2896
|
+
ce(() => {
|
|
2899
2897
|
C && a?.({ type: "SET_ACTIVE_INDEX", payload: u });
|
|
2900
2898
|
}, [n, e, a, C, u]);
|
|
2901
2899
|
const x = Gt(() => c(t), 50);
|
|
@@ -2907,7 +2905,7 @@ const Ui = ({ id: e, ref: r, value: t }) => {
|
|
|
2907
2905
|
onOptionClick: x
|
|
2908
2906
|
};
|
|
2909
2907
|
}, nn = Br(A(({ value: e, description: r, children: t, className: n, ...o }, i) => {
|
|
2910
|
-
const s = Ve(), { id: a, ref: l, selected: c, active: f, onOptionClick: d } =
|
|
2908
|
+
const s = Ve(), { id: a, ref: l, selected: c, active: f, onOptionClick: d } = Hi({
|
|
2911
2909
|
id: o.id,
|
|
2912
2910
|
ref: i,
|
|
2913
2911
|
value: e
|
|
@@ -2917,18 +2915,18 @@ const Ui = ({ id: e, ref: r, value: t }) => {
|
|
|
2917
2915
|
const { size: u, multiple: m, getItemProps: g } = h, C = g();
|
|
2918
2916
|
return v(Te, { "data-size": "md", asChild: !0, children: ie("button", { ref: l, id: a, role: "option", type: "button", "aria-selected": !!c, "aria-labelledby": s, tabIndex: -1, onClick: (x) => {
|
|
2919
2917
|
d(), o.onClick?.(x);
|
|
2920
|
-
}, className:
|
|
2918
|
+
}, className: G("ds-combobox__option", f && "ds-combobox__option--active", m && "ds-combobox__option--multiple", n), ...qe(["displayValue"], o), ...qe(["onClick", "onPointerLeave"], C), children: [v(Te, { asChild: !0, "data-size": u, children: v("span", { children: v(Nr, { multiple: m, selected: !!c }) }) }), ie(Te, { className: "ds-combobox__option__label", "data-size": u, id: s, children: [t, r && v(kr, { children: r })] })] }) });
|
|
2921
2919
|
}));
|
|
2922
2920
|
nn.displayName = "ComboboxOption";
|
|
2923
|
-
function
|
|
2921
|
+
function Ui(e) {
|
|
2924
2922
|
return $n(e) && e.type === nn;
|
|
2925
2923
|
}
|
|
2926
|
-
const
|
|
2927
|
-
function
|
|
2924
|
+
const Xi = (e) => !!e;
|
|
2925
|
+
function Gi({ children: e, inputValue: r, multiple: t, filter: n = (i, s) => s.label.toLowerCase().startsWith(i.toLowerCase()), initialValue: o }) {
|
|
2928
2926
|
const i = jr(n, [n]), { optionsChildren: s, customIds: a, restChildren: l, interactiveChildren: c } = ze(() => fn.toArray(e).reduce((y, b) => {
|
|
2929
|
-
if (
|
|
2927
|
+
if (Ui(b))
|
|
2930
2928
|
y.optionsChildren.push(b);
|
|
2931
|
-
else if (y.restChildren.push(b),
|
|
2929
|
+
else if (y.restChildren.push(b), Wi(b)) {
|
|
2932
2930
|
const w = b;
|
|
2933
2931
|
if (y.interactiveChildren.push(w), !w.props.id)
|
|
2934
2932
|
throw new Error("If ComboboxCustom is interactive, it must have an id");
|
|
@@ -2947,9 +2945,9 @@ function Yi({ children: e, inputValue: r, multiple: t, filter: n = (i, s) => s.l
|
|
|
2947
2945
|
let w = b.displayValue || "";
|
|
2948
2946
|
if (!b.displayValue) {
|
|
2949
2947
|
let _ = "";
|
|
2950
|
-
fn.forEach(b.children, (
|
|
2951
|
-
if (typeof
|
|
2952
|
-
_ +=
|
|
2948
|
+
fn.forEach(b.children, (k) => {
|
|
2949
|
+
if (typeof k == "string")
|
|
2950
|
+
_ += k;
|
|
2953
2951
|
else
|
|
2954
2952
|
throw new Error("If ComboboxOption is not a string, it must have a displayValue prop");
|
|
2955
2953
|
}), w = _;
|
|
@@ -2963,7 +2961,7 @@ function Yi({ children: e, inputValue: r, multiple: t, filter: n = (i, s) => s.l
|
|
|
2963
2961
|
}), x;
|
|
2964
2962
|
}, [s]), d = ze(() => (o?.map((C) => pe(C)) || []).reduce((C, x) => {
|
|
2965
2963
|
const y = f[x];
|
|
2966
|
-
return
|
|
2964
|
+
return Xi(y) && (C[x] = y), C;
|
|
2967
2965
|
}, {}), [o, f]), [h, u] = ye(d), { filteredOptions: m, filteredOptionsChildren: g } = ze(() => {
|
|
2968
2966
|
const C = [], x = Object.keys(f).map((y, b) => !t && Object.keys(h).length === 1 || t && h[y] || i(r, f[y]) ? (C.push(y), s[b]) : null).filter((y) => y);
|
|
2969
2967
|
return { filteredOptions: C, filteredOptionsChildren: x };
|
|
@@ -2986,7 +2984,7 @@ function Yi({ children: e, inputValue: r, multiple: t, filter: n = (i, s) => s.l
|
|
|
2986
2984
|
setSelectedOptions: u
|
|
2987
2985
|
};
|
|
2988
2986
|
}
|
|
2989
|
-
const
|
|
2987
|
+
const Yi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions: n, inputValue: o, selectedOptions: i, multiple: s, open: a, options: l, setOpen: c, handleSelectOption: f }) => {
|
|
2990
2988
|
const { activeIndex: d } = Ot();
|
|
2991
2989
|
return Gt((m) => {
|
|
2992
2990
|
if (!(e || r) && m)
|
|
@@ -3034,8 +3032,8 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3034
3032
|
break;
|
|
3035
3033
|
}
|
|
3036
3034
|
}, 20);
|
|
3037
|
-
},
|
|
3038
|
-
const [r, t] = ye(!1), { activeIndex: n } = Ot(), o = tn(), { refs: i, floatingStyles: s, context: a } =
|
|
3035
|
+
}, Zi = ({ listRef: e }) => {
|
|
3036
|
+
const [r, t] = ye(!1), { activeIndex: n } = Ot(), o = tn(), { refs: i, floatingStyles: s, context: a } = fi({
|
|
3039
3037
|
open: r,
|
|
3040
3038
|
onOpenChange: (m) => {
|
|
3041
3039
|
m || o?.({ type: "SET_ACTIVE_INDEX", payload: 0 }), Wn(() => {
|
|
@@ -3048,8 +3046,8 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3048
3046
|
g.scrollTop = 0;
|
|
3049
3047
|
}),
|
|
3050
3048
|
middleware: [
|
|
3051
|
-
|
|
3052
|
-
|
|
3049
|
+
_o({ padding: 10 }),
|
|
3050
|
+
Fo({
|
|
3053
3051
|
apply({ rects: m, elements: g }) {
|
|
3054
3052
|
requestAnimationFrame(() => {
|
|
3055
3053
|
Object.assign(g.floating.style, {
|
|
@@ -3059,9 +3057,9 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3059
3057
|
});
|
|
3060
3058
|
}
|
|
3061
3059
|
}),
|
|
3062
|
-
|
|
3060
|
+
Ao(10)
|
|
3063
3061
|
]
|
|
3064
|
-
}), l =
|
|
3062
|
+
}), l = gi(a, { role: "listbox" }), c = ui(a), f = pi(a, {
|
|
3065
3063
|
listRef: e,
|
|
3066
3064
|
activeIndex: n,
|
|
3067
3065
|
virtual: !0,
|
|
@@ -3071,7 +3069,7 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3071
3069
|
onNavigate: (m) => {
|
|
3072
3070
|
o?.({ type: "SET_ACTIVE_INDEX", payload: m || 0 });
|
|
3073
3071
|
}
|
|
3074
|
-
}), { getReferenceProps: d, getFloatingProps: h, getItemProps: u } =
|
|
3072
|
+
}), { getReferenceProps: d, getFloatingProps: h, getItemProps: u } = hi([l, c, f]);
|
|
3075
3073
|
return {
|
|
3076
3074
|
open: r,
|
|
3077
3075
|
setOpen: t,
|
|
@@ -3083,8 +3081,8 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3083
3081
|
getFloatingProps: h,
|
|
3084
3082
|
getItemProps: u
|
|
3085
3083
|
};
|
|
3086
|
-
},
|
|
3087
|
-
const t = oe(
|
|
3084
|
+
}, Ji = De(null), Qi = (e, r) => {
|
|
3085
|
+
const t = oe(Ji), n = Ve(), o = e.id ?? `${r}-${n}`, i = e.errorId ?? `${r}-error-${n}`, s = `${r}-description-${n}`, a = e.size ?? t?.size ?? "md", l = t?.disabled || e?.disabled, c = !l && !!(e.error || t?.error);
|
|
3088
3086
|
return {
|
|
3089
3087
|
hasError: c,
|
|
3090
3088
|
errorId: i,
|
|
@@ -3094,23 +3092,23 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3094
3092
|
id: o,
|
|
3095
3093
|
disabled: l,
|
|
3096
3094
|
"aria-invalid": c ? !0 : void 0,
|
|
3097
|
-
"aria-describedby":
|
|
3095
|
+
"aria-describedby": G(e["aria-describedby"], !!e?.description && typeof e?.description == "string" && s, c && !t?.error && i, c && !!t?.error && t?.errorId) || void 0
|
|
3098
3096
|
}
|
|
3099
3097
|
};
|
|
3100
|
-
},
|
|
3098
|
+
}, es = A(({ value: e, initialValue: r = [], onValueChange: t, label: n, hideLabel: o = !1, description: i, multiple: s = !1, disabled: a = !1, readOnly: l = !1, hideChips: c = !1, clearButtonLabel: f = "Fjern alt", hideClearButton: d = !1, error: h, errorId: u, id: m, name: g, portal: C = !0, htmlSize: x = 0, virtual: y = !1, children: b, style: w, size: _ = "md", loading: k, loadingLabel: j = "Laster...", filter: $, chipSrLabel: Z = (N) => "Slett " + N.label, className: X, ...q }, S) => {
|
|
3101
3099
|
const N = ve(null), P = ve(null), E = ve([]), [D, B] = ye(q.inputValue || "");
|
|
3102
|
-
|
|
3100
|
+
ce(() => {
|
|
3103
3101
|
typeof q.inputValue == "string" && B(q.inputValue);
|
|
3104
3102
|
}, [q.inputValue]);
|
|
3105
|
-
const { selectedOptions:
|
|
3103
|
+
const { selectedOptions: M, options: R, restChildren: U, interactiveChildren: te, customIds: xe, filteredOptionsChildren: he, filteredOptions: z, setSelectedOptions: T } = Gi({
|
|
3106
3104
|
children: b,
|
|
3107
3105
|
inputValue: D,
|
|
3108
3106
|
filter: $,
|
|
3109
3107
|
multiple: s,
|
|
3110
3108
|
initialValue: r
|
|
3111
|
-
}), { open: O, setOpen: F, refs: H, floatingStyles: ee, context: ne, getReferenceProps: Y, getFloatingProps: Ie, getItemProps: Ee } =
|
|
3109
|
+
}), { open: O, setOpen: F, refs: H, floatingStyles: ee, context: ne, getReferenceProps: Y, getFloatingProps: Ie, getItemProps: Ee } = Zi({
|
|
3112
3110
|
listRef: E
|
|
3113
|
-
}), J =
|
|
3111
|
+
}), J = Qi({
|
|
3114
3112
|
disabled: a,
|
|
3115
3113
|
error: h,
|
|
3116
3114
|
errorId: u,
|
|
@@ -3118,31 +3116,31 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3118
3116
|
description: i,
|
|
3119
3117
|
id: m
|
|
3120
3118
|
}, "combobox");
|
|
3121
|
-
|
|
3119
|
+
ce(() => {
|
|
3122
3120
|
if (e && e.length > 0 && !s) {
|
|
3123
3121
|
const V = R[pe(e[0])];
|
|
3124
3122
|
N.current && Qe(N.current, V?.label || "");
|
|
3125
3123
|
}
|
|
3126
|
-
}, [s, e, R]),
|
|
3124
|
+
}, [s, e, R]), ce(() => {
|
|
3127
3125
|
if (e && Object.keys(R).length >= 0) {
|
|
3128
3126
|
const V = e.map((I) => R[pe(I)]);
|
|
3129
3127
|
T(V.reduce((I, W) => (I[pe(W.value)] = W, I), {}));
|
|
3130
3128
|
}
|
|
3131
3129
|
}, [s, e, R, T]);
|
|
3132
3130
|
const me = Gt((V) => {
|
|
3133
|
-
const { option: I, clear: W, remove:
|
|
3131
|
+
const { option: I, clear: W, remove: se } = V;
|
|
3134
3132
|
if (W) {
|
|
3135
3133
|
T({}), N.current && Qe(N.current, ""), t?.([]);
|
|
3136
3134
|
return;
|
|
3137
3135
|
}
|
|
3138
3136
|
if (!I)
|
|
3139
3137
|
return;
|
|
3140
|
-
if (
|
|
3141
|
-
const re = { ...
|
|
3138
|
+
if (se) {
|
|
3139
|
+
const re = { ...M };
|
|
3142
3140
|
delete re[pe(I.value)], T(re), t?.(Object.keys(re).map((je) => Ht(je)));
|
|
3143
3141
|
return;
|
|
3144
3142
|
}
|
|
3145
|
-
const K = { ...
|
|
3143
|
+
const K = { ...M };
|
|
3146
3144
|
if (s)
|
|
3147
3145
|
K[pe(I.value)] ? delete K[pe(I.value)] : K[pe(I.value)] = I, N.current && Qe(N.current, ""), N.current?.focus();
|
|
3148
3146
|
else {
|
|
@@ -3153,9 +3151,9 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3153
3151
|
}, 0);
|
|
3154
3152
|
}
|
|
3155
3153
|
T(K), t?.(Object.keys(K).map((re) => Ht(re))), !s && F(!1), H.domReference.current?.focus();
|
|
3156
|
-
}, 50), _e =
|
|
3154
|
+
}, 50), _e = Yi({
|
|
3157
3155
|
filteredOptions: z,
|
|
3158
|
-
selectedOptions:
|
|
3156
|
+
selectedOptions: M,
|
|
3159
3157
|
readOnly: J.readOnly || !1,
|
|
3160
3158
|
disabled: a,
|
|
3161
3159
|
multiple: s,
|
|
@@ -3175,7 +3173,7 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3175
3173
|
return ie(Ae.Provider, { value: {
|
|
3176
3174
|
size: _,
|
|
3177
3175
|
options: R,
|
|
3178
|
-
selectedOptions:
|
|
3176
|
+
selectedOptions: M,
|
|
3179
3177
|
multiple: s,
|
|
3180
3178
|
disabled: a,
|
|
3181
3179
|
readOnly: l,
|
|
@@ -3206,12 +3204,12 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3206
3204
|
setListRef: (V, I) => {
|
|
3207
3205
|
E.current[V] = I;
|
|
3208
3206
|
}
|
|
3209
|
-
}, children: [ie("div", { className:
|
|
3207
|
+
}, children: [ie("div", { className: G("ds-combobox", `ds-combobox--${_}`, a && "ds-combobox__disabled", X), style: w, ref: P, children: [g && v(Mr, { name: g, selectedOptions: M, multiple: s }), v(Tr, { label: n, description: i, size: _, readOnly: l, hideLabel: o, formFieldProps: J }), v(Sr, { ...qe(["inputValue"], q), hideClearButton: d, listId: ne.floatingId || "", error: h, hideChips: c, handleKeyDown: _e, "aria-busy": k }), v(xr, { size: _, error: h, formFieldProps: J })] }), O && v(ii, { root: C ? null : P, children: v(ai, { context: ne, initialFocus: -1, visuallyHiddenDismiss: !0, children: ie("div", { "aria-labelledby": J.inputProps.id, "aria-autocomplete": "list", tabIndex: -1, ...Ie({
|
|
3210
3208
|
ref: H.setFloating,
|
|
3211
3209
|
style: {
|
|
3212
3210
|
...ee
|
|
3213
3211
|
}
|
|
3214
|
-
}), className:
|
|
3212
|
+
}), className: G("ds-combobox__options-wrapper", `ds-combobox--${_}`), children: [y && v("div", { style: {
|
|
3215
3213
|
height: `${L.getTotalSize()}px`,
|
|
3216
3214
|
width: "100%",
|
|
3217
3215
|
position: "relative"
|
|
@@ -3221,15 +3219,15 @@ const Zi = ({ readOnly: e, disabled: r, interactiveChildren: t, filteredOptions:
|
|
|
3221
3219
|
left: 0,
|
|
3222
3220
|
width: "100%",
|
|
3223
3221
|
transform: `translateY(${V.start}px)`
|
|
3224
|
-
}, children: he[V.index] }, V.index)) }),
|
|
3225
|
-
}), Pr = A((e, r) => v(
|
|
3222
|
+
}, children: he[V.index] }, V.index)) }), k ? ie(yr, { className: "ds-combobox__loading", children: [v(Kr, { "aria-label": "Laster", "data-size": "sm" }), j] }) : ie(Ut, { children: [U, !y && he] })] }) }) })] });
|
|
3223
|
+
}), Pr = A((e, r) => v(Ni, { children: v(es, { ...e, ref: r }) }));
|
|
3226
3224
|
Pr.displayName = "Combobox";
|
|
3227
3225
|
const Dr = A(({ children: e, className: r, ...t }, n) => {
|
|
3228
3226
|
const o = oe(Ae);
|
|
3229
3227
|
if (!o)
|
|
3230
3228
|
throw new Error("ComboboxEmpty must be used within a Combobox");
|
|
3231
3229
|
const { filteredOptions: i, size: s } = o;
|
|
3232
|
-
return i.length === 0 && v(Te, { "data-size": s, asChild: !0, children: v("div", { ref: n, className:
|
|
3230
|
+
return i.length === 0 && v(Te, { "data-size": s, asChild: !0, children: v("div", { ref: n, className: G("ds-combobox__empty", r), ...t, children: e }) });
|
|
3233
3231
|
});
|
|
3234
3232
|
Dr.displayName = "ComboboxEmpty";
|
|
3235
3233
|
const Tt = Pr;
|
|
@@ -3237,7 +3235,7 @@ Tt.Option = nn;
|
|
|
3237
3235
|
Tt.Empty = Dr;
|
|
3238
3236
|
Tt.Option.displayName = "Combobox.Option";
|
|
3239
3237
|
Tt.Empty.displayName = "Combobox.Empty";
|
|
3240
|
-
const
|
|
3238
|
+
const Ds = A(function({ "data-size": r, className: t, style: n, children: o, label: i, description: s, error: a, ...l }, c) {
|
|
3241
3239
|
return ie(pt, { "data-size": r, className: t, style: n, children: [v(ot, { type: "checkbox", ref: c, ...l }), !!i && v(Te, { weight: "regular", children: i }), !!s && v("div", { "data-field": "description", children: s }), !!a && v(Xt, { children: a })] });
|
|
3242
3240
|
}), rn = De({
|
|
3243
3241
|
current: null
|
|
@@ -3246,21 +3244,21 @@ const As = A(function({ "data-size": r, className: t, style: n, children: o, lab
|
|
|
3246
3244
|
return v(rn.Provider, { value: r, children: e });
|
|
3247
3245
|
};
|
|
3248
3246
|
Ar.displayName = "DialogTriggerContext";
|
|
3249
|
-
const
|
|
3250
|
-
const h = oe(rn), u = ve(null), m = r ?
|
|
3251
|
-
return
|
|
3247
|
+
const ts = A(function({ asChild: r, children: t, className: n, placement: o = "center", closeButton: i = "Lukk dialogvindu", closedby: s = "closerequest", modal: a = !0, onClose: l, open: c, ...f }, d) {
|
|
3248
|
+
const h = oe(rn), u = ve(null), m = r ? ue : "dialog", g = Be([h, d, u]), C = a ? "showModal" : "show";
|
|
3249
|
+
return ce(() => u.current?.[c ? C : "close"](), [c]), ce(() => {
|
|
3252
3250
|
const x = u.current, y = (w) => {
|
|
3253
3251
|
if (w.defaultPrevented)
|
|
3254
3252
|
return;
|
|
3255
|
-
const { clientY: _, clientX:
|
|
3253
|
+
const { clientY: _, clientX: k, target: j } = w;
|
|
3256
3254
|
if (j instanceof Element && w.type === "click" && j.closest('[data-command="close"]'))
|
|
3257
3255
|
return x?.close();
|
|
3258
3256
|
if (!(x && "closedBy" in x)) {
|
|
3259
3257
|
if (w instanceof KeyboardEvent)
|
|
3260
3258
|
return s === "none" && w.key === "Escape" && w.preventDefault();
|
|
3261
3259
|
if (!window.getSelection()?.toString() && x && j === x && s === "any") {
|
|
3262
|
-
const { top: $, left: Z, right:
|
|
3263
|
-
$ <= _ && _ <= q && Z <=
|
|
3260
|
+
const { top: $, left: Z, right: X, bottom: q } = x.getBoundingClientRect();
|
|
3261
|
+
$ <= _ && _ <= q && Z <= k && k <= X || x?.close();
|
|
3264
3262
|
}
|
|
3265
3263
|
}
|
|
3266
3264
|
}, b = () => {
|
|
@@ -3270,21 +3268,21 @@ const ns = A(function({ asChild: r, children: t, className: n, placement: o = "c
|
|
|
3270
3268
|
return x?.addEventListener("animationend", b), x?.addEventListener("click", y), x?.addEventListener("keydown", y), () => {
|
|
3271
3269
|
x?.removeEventListener("animationend", b), x?.removeEventListener("click", y), x?.removeEventListener("keydown", y);
|
|
3272
3270
|
};
|
|
3273
|
-
}, [s]),
|
|
3271
|
+
}, [s]), ce(() => {
|
|
3274
3272
|
const x = (b) => l?.(b), y = u.current;
|
|
3275
3273
|
return y?.addEventListener("close", x), () => y?.removeEventListener("close", x);
|
|
3276
|
-
}, [l]), ie(m, { className:
|
|
3277
|
-
}),
|
|
3278
|
-
return v(r ?
|
|
3279
|
-
}),
|
|
3274
|
+
}, [l]), ie(m, { className: G("ds-dialog", n), ref: g, "data-placement": o, "data-modal": a, closedby: s, ...f, children: [i !== !1 && v(Ye, { "aria-label": i, "data-color": "neutral", icon: !0, variant: "tertiary", "data-command": "close" }), t] });
|
|
3275
|
+
}), ns = A(function({ asChild: r, className: t, ...n }, o) {
|
|
3276
|
+
return v(r ? ue : "div", { className: G("ds-dialog__block", t), ref: o, ...n });
|
|
3277
|
+
}), rs = A(function({ asChild: r, ...t }, n) {
|
|
3280
3278
|
const o = oe(rn);
|
|
3281
|
-
return v(r ?
|
|
3279
|
+
return v(r ? ue : Ye, { "aria-haspopup": "dialog", onClick: () => {
|
|
3282
3280
|
o.current?.getAttribute("data-modal") === "true" ? o.current?.showModal() : o.current?.show();
|
|
3283
3281
|
}, ref: n, ...t });
|
|
3284
|
-
}), on = Object.assign(
|
|
3285
|
-
Block:
|
|
3282
|
+
}), on = Object.assign(ts, {
|
|
3283
|
+
Block: ns,
|
|
3286
3284
|
TriggerContext: Ar,
|
|
3287
|
-
Trigger:
|
|
3285
|
+
Trigger: rs
|
|
3288
3286
|
});
|
|
3289
3287
|
on.Block.displayName = "Dialog.Block";
|
|
3290
3288
|
on.TriggerContext.displayName = "Dialog.TriggerContext";
|
|
@@ -3294,19 +3292,19 @@ const _r = ({ children: e }) => {
|
|
|
3294
3292
|
return v(sn.Provider, { value: { popoverId: t, setPopoverId: n }, children: e });
|
|
3295
3293
|
};
|
|
3296
3294
|
_r.displayName = "PopoverTriggerContext";
|
|
3297
|
-
const sn = De({}),
|
|
3298
|
-
const h = c ?
|
|
3299
|
-
return
|
|
3295
|
+
const sn = De({}), os = A(function({ id: r, className: t, onClose: n, onOpen: o, open: i, variant: s = "default", placement: a = "top", autoPlacement: l = !0, asChild: c = !1, ...f }, d) {
|
|
3296
|
+
const h = c ? ue : "div", u = ve(null), m = Be([u, d]), { popoverId: g, setPopoverId: C } = oe(sn), [x, y] = ye(!1), b = i ?? x;
|
|
3297
|
+
return ce(() => {
|
|
3300
3298
|
const w = u.current, _ = (j) => {
|
|
3301
|
-
const $ = j.target, Z = $?.closest?.(`[popovertarget="${w?.id}"]`),
|
|
3302
|
-
Z && j.preventDefault(), b && (Z ||
|
|
3303
|
-
},
|
|
3299
|
+
const $ = j.target, Z = $?.closest?.(`[popovertarget="${w?.id}"]`), X = !Z && !w?.contains($);
|
|
3300
|
+
Z && j.preventDefault(), b && (Z || X) ? (y(!1), n?.()) : !b && Z && (y(!0), o?.());
|
|
3301
|
+
}, k = (j) => {
|
|
3304
3302
|
j.key !== "Escape" || !b || (j.preventDefault(), y(!1), n?.());
|
|
3305
3303
|
};
|
|
3306
|
-
return w?.togglePopover?.(b), document.addEventListener("click", _, !0), document.addEventListener("keydown",
|
|
3307
|
-
document.removeEventListener("click", _, !0), document.removeEventListener("keydown",
|
|
3304
|
+
return w?.togglePopover?.(b), document.addEventListener("click", _, !0), document.addEventListener("keydown", k), () => {
|
|
3305
|
+
document.removeEventListener("click", _, !0), document.removeEventListener("keydown", k);
|
|
3308
3306
|
};
|
|
3309
|
-
}, [b]),
|
|
3307
|
+
}, [b]), ce(() => {
|
|
3310
3308
|
const w = u.current, _ = document.querySelector(`[popovertarget="${w?.id}"]`);
|
|
3311
3309
|
if (w && _ && b)
|
|
3312
3310
|
return Xn(_, w, () => {
|
|
@@ -3314,21 +3312,21 @@ const sn = De({}), is = A(function({ id: r, className: t, onClose: n, onOpen: o,
|
|
|
3314
3312
|
placement: a,
|
|
3315
3313
|
strategy: "fixed",
|
|
3316
3314
|
middleware: [
|
|
3317
|
-
Hn((
|
|
3318
|
-
const j = getComputedStyle(
|
|
3315
|
+
Hn((k) => {
|
|
3316
|
+
const j = getComputedStyle(k.elements.floating, "::before");
|
|
3319
3317
|
return parseFloat(j.height);
|
|
3320
3318
|
}),
|
|
3321
3319
|
...l ? [qn({ fallbackAxisSideDirection: "start" }), Gr()] : [],
|
|
3322
|
-
|
|
3320
|
+
is
|
|
3323
3321
|
]
|
|
3324
|
-
}).then(({ x:
|
|
3325
|
-
w.style.translate = `${Math.round(
|
|
3322
|
+
}).then(({ x: k, y: j }) => {
|
|
3323
|
+
w.style.translate = `${Math.round(k)}px ${Math.round(j)}px`;
|
|
3326
3324
|
});
|
|
3327
3325
|
});
|
|
3328
|
-
}, [b, a, r, l]),
|
|
3326
|
+
}, [b, a, r, l]), ce(() => {
|
|
3329
3327
|
r && C?.(r);
|
|
3330
|
-
}, [r]), v(h, { className:
|
|
3331
|
-
}),
|
|
3328
|
+
}, [r]), v(h, { className: G("ds-popover", t), id: r || g, popover: "manual", "data-variant": s, ref: m, ...f });
|
|
3329
|
+
}), is = {
|
|
3332
3330
|
name: "ArrowPseudoElement",
|
|
3333
3331
|
fn(e) {
|
|
3334
3332
|
const { elements: r, rects: t, placement: n } = e;
|
|
@@ -3349,49 +3347,49 @@ const sn = De({}), is = A(function({ id: r, className: t, onClose: n, onOpen: o,
|
|
|
3349
3347
|
}
|
|
3350
3348
|
return r.floating.setAttribute("data-placement", n.split("-")[0]), r.floating.style.setProperty("--ds-popover-arrow-x", o), r.floating.style.setProperty("--ds-popover-arrow-y", i), e;
|
|
3351
3349
|
}
|
|
3352
|
-
},
|
|
3353
|
-
const { popoverId: s } = oe(sn), a = n ?
|
|
3350
|
+
}, ss = A(function({ id: r, inline: t, asChild: n, ...o }, i) {
|
|
3351
|
+
const { popoverId: s } = oe(sn), a = n ? ue : t ? "button" : Ye, l = Object.assign({
|
|
3354
3352
|
[$r.startsWith("19") ? "popoverTarget" : "popovertarget"]: s,
|
|
3355
3353
|
...t ? {
|
|
3356
3354
|
"data-popover": "inline"
|
|
3357
3355
|
} : {}
|
|
3358
3356
|
}, o);
|
|
3359
3357
|
return v(a, { ref: i, ...l });
|
|
3360
|
-
}),
|
|
3361
|
-
return v(r ?
|
|
3362
|
-
}), Fr = (e, { asChild: r, className: t, ...n }, o) => v(r ?
|
|
3358
|
+
}), As = A(function({ asChild: r, ...t }, n) {
|
|
3359
|
+
return v(r ? ue : "li", { ...t, ref: n });
|
|
3360
|
+
}), Fr = (e, { asChild: r, className: t, ...n }, o) => v(r ? ue : e, { className: G("ds-list", t), ref: o, ...n }), _s = A(function(r, t) {
|
|
3363
3361
|
return Fr("ul", r, t);
|
|
3364
3362
|
});
|
|
3365
3363
|
A(function(r, t) {
|
|
3366
3364
|
return Fr("ol", r, t);
|
|
3367
3365
|
});
|
|
3368
|
-
const
|
|
3369
|
-
return v(t ?
|
|
3370
|
-
}),
|
|
3366
|
+
const as = A(function({ "aria-label": r = "Sidenavigering", asChild: t, className: n, ...o }, i) {
|
|
3367
|
+
return v(t ? ue : "nav", { "aria-label": r, className: G("ds-pagination", n), ref: i, ...o });
|
|
3368
|
+
}), ls = A(function(r, t) {
|
|
3371
3369
|
return v(Ye, { ref: t, ...r });
|
|
3372
|
-
}),
|
|
3373
|
-
return v(r ?
|
|
3374
|
-
}),
|
|
3375
|
-
return v(r ?
|
|
3376
|
-
}), an = Object.assign(
|
|
3377
|
-
List:
|
|
3378
|
-
Item:
|
|
3379
|
-
Button:
|
|
3370
|
+
}), cs = A(function({ asChild: r, className: t, ...n }, o) {
|
|
3371
|
+
return v(r ? ue : "li", { ref: o, ...n });
|
|
3372
|
+
}), us = A(function({ asChild: r, ...t }, n) {
|
|
3373
|
+
return v(r ? ue : "ul", { ref: n, ...t });
|
|
3374
|
+
}), an = Object.assign(as, {
|
|
3375
|
+
List: us,
|
|
3376
|
+
Item: cs,
|
|
3377
|
+
Button: ls
|
|
3380
3378
|
});
|
|
3381
3379
|
an.List.displayName = "Pagination.List";
|
|
3382
3380
|
an.Item.displayName = "Pagination.Item";
|
|
3383
3381
|
an.Button.displayName = "Pagination.Button";
|
|
3384
|
-
const Lr = Object.assign(
|
|
3382
|
+
const Lr = Object.assign(os, {
|
|
3385
3383
|
TriggerContext: _r,
|
|
3386
|
-
Trigger:
|
|
3384
|
+
Trigger: ss
|
|
3387
3385
|
});
|
|
3388
3386
|
Lr.TriggerContext.displayName = "Popover.TriggerContext";
|
|
3389
3387
|
Lr.Trigger.displayName = "Popover.Trigger";
|
|
3390
|
-
const
|
|
3391
|
-
return v("div", { ref: n, className:
|
|
3392
|
-
}),
|
|
3388
|
+
const ds = A(function({ className: r, ...t }, n) {
|
|
3389
|
+
return v("div", { ref: n, className: G("ds-search", r), ...t });
|
|
3390
|
+
}), fs = A(function({ children: r = "Søk", ...t }, n) {
|
|
3393
3391
|
return v(Ye, { ref: n, type: "submit", ...t, children: r });
|
|
3394
|
-
}),
|
|
3392
|
+
}), hs = A(function({ "aria-label": r = "Tøm", onClick: t, ...n }, o) {
|
|
3395
3393
|
return v(Ye, { ref: o, variant: "tertiary", type: "reset", "aria-label": r, onClick: (s) => {
|
|
3396
3394
|
const a = s.target;
|
|
3397
3395
|
let l = null;
|
|
@@ -3401,7 +3399,7 @@ const fs = A(function({ className: r, ...t }, n) {
|
|
|
3401
3399
|
throw new Error("Input is not an input element");
|
|
3402
3400
|
s.preventDefault(), Qe(l, ""), l.focus(), t?.(s);
|
|
3403
3401
|
}, icon: !0, ...n });
|
|
3404
|
-
}),
|
|
3402
|
+
}), ms = A(function({ ...r }, t) {
|
|
3405
3403
|
return v(ot, {
|
|
3406
3404
|
ref: t,
|
|
3407
3405
|
type: "search",
|
|
@@ -3409,79 +3407,78 @@ const fs = A(function({ className: r, ...t }, n) {
|
|
|
3409
3407
|
placeholder: "",
|
|
3410
3408
|
...r
|
|
3411
3409
|
});
|
|
3412
|
-
}), ln = Object.assign(
|
|
3413
|
-
Clear:
|
|
3414
|
-
Button:
|
|
3415
|
-
Input:
|
|
3410
|
+
}), ln = Object.assign(ds, {
|
|
3411
|
+
Clear: hs,
|
|
3412
|
+
Button: fs,
|
|
3413
|
+
Input: ms
|
|
3416
3414
|
});
|
|
3417
3415
|
ln.Clear.displayName = "Search.Clear";
|
|
3418
3416
|
ln.Button.displayName = "Search.Button";
|
|
3419
3417
|
ln.Input.displayName = "Search.Input";
|
|
3420
|
-
const
|
|
3421
|
-
const c = r ?
|
|
3422
|
-
return v(c, { "aria-hidden": "true", className:
|
|
3423
|
-
}),
|
|
3418
|
+
const Fs = A(function({ asChild: r, className: t, height: n, style: o, variant: i = "rectangle", width: s, ...a }, l) {
|
|
3419
|
+
const c = r ? ue : "span", f = i === "text", d = Wr("ds-skeleton-opacity-fade"), h = Be([d, l]);
|
|
3420
|
+
return v(c, { "aria-hidden": "true", className: G("ds-skeleton", t), "data-text": f ? "-".repeat(Number(s) || 1) : void 0, "data-variant": i, ref: h, style: f ? o : { width: s, height: n, ...o }, ...a });
|
|
3421
|
+
}), Ls = A(function({ "data-size": r, children: t, className: n, description: o, label: i, position: s, style: a, ...l }, c) {
|
|
3424
3422
|
return ie(pt, { className: n, "data-position": s, "data-size": r, style: a, children: [v(ot, { type: "checkbox", role: "switch", ref: c, ...l }), !!i && v(Te, { weight: "regular", children: i }), !!o && v("div", { "data-field": "description", children: o })] });
|
|
3425
|
-
}),
|
|
3423
|
+
}), Mt = De({}), ps = A(function({ value: r, defaultValue: t, className: n, onChange: o, ...i }, s) {
|
|
3426
3424
|
const a = ve(null), l = r !== void 0, [c, f] = ye(t), [d, h] = ye(/* @__PURE__ */ new Map());
|
|
3427
3425
|
let u = o;
|
|
3428
3426
|
return l || (u = (m) => {
|
|
3429
3427
|
f(m), o?.(m);
|
|
3430
|
-
}, r = c), v(
|
|
3428
|
+
}, r = c), v(Mt.Provider, { value: {
|
|
3431
3429
|
value: r,
|
|
3432
3430
|
defaultValue: t,
|
|
3433
3431
|
onChange: u,
|
|
3434
3432
|
tablistRef: a,
|
|
3435
3433
|
panelButtonMap: d,
|
|
3436
3434
|
setPanelButtonMap: h
|
|
3437
|
-
}, children: v("div", { className:
|
|
3438
|
-
}),
|
|
3439
|
-
const { value: o, tablistRef: i } = oe(
|
|
3435
|
+
}, children: v("div", { className: G("ds-tabs", n), ref: s, ...i }) });
|
|
3436
|
+
}), bs = A(function({ children: r, ...t }, n) {
|
|
3437
|
+
const { value: o, tablistRef: i } = oe(Mt), s = Be([n, i]);
|
|
3440
3438
|
return v(Zr, { role: "tablist", activeValue: o, orientation: "ambiguous", ref: s, ...t, children: r });
|
|
3441
|
-
}),
|
|
3442
|
-
const { value: s, tablistRef: a, setPanelButtonMap: l } = oe(
|
|
3443
|
-
return
|
|
3439
|
+
}), gs = A(function({ children: r, value: t, id: n, ...o }, i) {
|
|
3440
|
+
const { value: s, tablistRef: a, setPanelButtonMap: l } = oe(Mt), c = t === s, f = Ve(), d = n ?? `tabpanel-${f}`, [h, u] = ye(!1), [m, g] = ye(void 0), C = ve(null), x = Be([i, C]);
|
|
3441
|
+
return ce(() => {
|
|
3444
3442
|
if (!C.current)
|
|
3445
3443
|
return;
|
|
3446
3444
|
const y = C.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
3447
3445
|
u(y.length > 0);
|
|
3448
|
-
}, [r]),
|
|
3446
|
+
}, [r]), ce(() => {
|
|
3449
3447
|
if (!a)
|
|
3450
3448
|
return;
|
|
3451
3449
|
const y = a.current?.querySelector(`[role="tab"][data-value="${t}"]`);
|
|
3452
3450
|
g(y ? y.id : void 0), y && l?.((b) => new Map(b).set(y.id, d));
|
|
3453
3451
|
}, [a]), v("div", { ref: x, id: d, role: "tabpanel", tabIndex: h ? void 0 : 0, "aria-labelledby": m, hidden: !c, ...o, children: r });
|
|
3454
|
-
}),
|
|
3455
|
-
const s = oe(
|
|
3452
|
+
}), vs = A(function({ value: r, id: t, onClick: n, ...o }, i) {
|
|
3453
|
+
const s = oe(Mt), a = Ve(), l = t ?? `tab-${a}`;
|
|
3456
3454
|
return v(Qr, { value: r, ...o, asChild: !0, children: v("button", { ref: i, id: l, "aria-selected": s.value === r, "data-value": r, role: "tab", type: "button", onClick: (c) => {
|
|
3457
3455
|
s.onChange?.(r), n?.(c);
|
|
3458
3456
|
}, "aria-controls": s.panelButtonMap?.get(l), ...o }) });
|
|
3459
|
-
}), cn = Object.assign(
|
|
3460
|
-
List:
|
|
3461
|
-
Tab:
|
|
3462
|
-
Panel:
|
|
3457
|
+
}), cn = Object.assign(ps, {
|
|
3458
|
+
List: bs,
|
|
3459
|
+
Tab: vs,
|
|
3460
|
+
Panel: gs
|
|
3463
3461
|
});
|
|
3464
3462
|
cn.Tab.displayName = "Tabs.Tab";
|
|
3465
3463
|
cn.List.displayName = "Tabs.List";
|
|
3466
3464
|
cn.Panel.displayName = "Tabs.Panel";
|
|
3467
|
-
const
|
|
3468
|
-
return ie(pt, { className: f, "data-size": a, style: c, children: [!!r && v(Te, { children: r }), !!t && v(
|
|
3465
|
+
const zs = A(function({ label: r, description: t, error: n, multiline: o, prefix: i, suffix: s, "data-size": a, counter: l, style: c, className: f, ...d }, h) {
|
|
3466
|
+
return ie(pt, { className: f, "data-size": a, style: c, children: [!!r && v(Te, { children: r }), !!t && v(qr, { children: t }), ie(Hr, { children: [i === void 0 || v(hn, { children: i }), o === !0 ? v(Yr, { ref: h, "aria-invalid": !!n || void 0, ...d }) : v(ot, { ref: h, "aria-invalid": !!n || void 0, ...d }), s === void 0 || v(hn, { children: s })] }), !!l && v(pt.Counter, { ...typeof l == "number" ? { limit: l } : l }), !!n && v(Xt, { children: n })] });
|
|
3469
3467
|
});
|
|
3470
3468
|
export {
|
|
3471
3469
|
ro as B,
|
|
3472
|
-
|
|
3470
|
+
Ds as C,
|
|
3473
3471
|
on as D,
|
|
3474
|
-
|
|
3472
|
+
As as L,
|
|
3475
3473
|
an as P,
|
|
3476
|
-
|
|
3477
|
-
|
|
3474
|
+
Ls as S,
|
|
3475
|
+
zs as T,
|
|
3478
3476
|
St as a,
|
|
3479
3477
|
Tt as b,
|
|
3480
3478
|
_s as c,
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
Ds as u
|
|
3479
|
+
Lr as d,
|
|
3480
|
+
ln as e,
|
|
3481
|
+
Fs as f,
|
|
3482
|
+
cn as g,
|
|
3483
|
+
Ps as u
|
|
3487
3484
|
};
|