@altinn/altinn-components 0.63.4 → 0.63.6
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/dist/{ToolbarSearch-CDOcKzpM.js → ToolbarSearch-75dn6Vnh.js} +208 -207
- package/dist/assets/ToolbarSearch.css +1 -1
- package/dist/components/AccessAreaListItem/AccessAreaListItem.js +4 -3
- package/dist/components/AccessPackageListItem/AccessPackageListItem.js +10 -9
- package/dist/components/Account/AccountList.js +8 -7
- package/dist/components/Account/AccountListItem.js +8 -7
- package/dist/components/Account/AccountListItemControls.js +4 -3
- package/dist/components/Account/AccountListItemDetails.js +4 -3
- package/dist/components/Account/AccountListVirtual.js +4 -3
- package/dist/components/Account/AccountMenu.js +8 -7
- package/dist/components/Account/AccountNotificationSettings.js +8 -7
- package/dist/components/Account/AccountOrganization.js +4 -3
- package/dist/components/AccountSelector/AccountSelector.js +18 -19
- 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/Badge/Badge.js +3 -2
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Banner/Banner.js +4 -3
- package/dist/components/Bookmarks/BookmarkModal.js +7 -6
- package/dist/components/Bookmarks/BookmarkSettingsItem.js +4 -3
- package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +7 -6
- package/dist/components/Bookmarks/BookmarkSettingsList.js +8 -7
- package/dist/components/Breadcrumbs/Breadcrumbs.js +4 -3
- package/dist/components/Bulk/BulkHeader.js +8 -7
- package/dist/components/Button/Button.js +4 -4
- package/dist/components/Button/ButtonIcon.js +4 -3
- package/dist/components/Button/ComboButton.js +4 -3
- package/dist/components/Button/FloatingActionButton.js +4 -3
- package/dist/components/Button/IconButton.js +7 -6
- package/dist/components/Byline/Byline.js +3 -2
- package/dist/components/Byline/index.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +17 -16
- package/dist/components/Dashboard/DashboardCard.js +22 -40
- package/dist/components/Dashboard/DashboardHeader.js +8 -7
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/DatepickerHeader.js +7 -6
- package/dist/components/Datepicker/DatepickerTable.js +11 -10
- package/dist/components/Dialog/Dialog.js +4 -3
- package/dist/components/Dialog/DialogActions.js +4 -3
- package/dist/components/Dialog/DialogActivityLog.js +4 -3
- package/dist/components/Dialog/DialogAttachments.js +5 -4
- package/dist/components/Dialog/DialogBody.js +4 -3
- package/dist/components/Dialog/DialogByline.js +3 -2
- package/dist/components/Dialog/DialogContact.js +4 -3
- package/dist/components/Dialog/DialogHeader.js +8 -7
- package/dist/components/Dialog/DialogHistory.js +8 -7
- package/dist/components/Dialog/DialogHistoryItem.js +4 -3
- package/dist/components/Dialog/DialogHistorySegment.js +4 -3
- package/dist/components/Dialog/DialogLayout.js +7 -6
- package/dist/components/Dialog/DialogList.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 +6 -5
- package/dist/components/Dialog/DialogSeenBy.js +19 -18
- 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 +10 -9
- package/dist/components/Dialog/SeenByLogButton.js +4 -3
- package/dist/components/Dialog/SeenByLogItem.js +8 -7
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +4 -3
- package/dist/components/Dropdown/DrawerHeader.js +4 -3
- package/dist/components/Dropdown/Dropdown.js +3 -2
- package/dist/components/Dropdown/DropdownBase.js +4 -3
- package/dist/components/Dropdown/FloatingDropdown.js +4 -3
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/DsComponents/index.js +26 -31
- package/dist/components/Forms/Checkbox.js +4 -3
- package/dist/components/Forms/CheckboxOptions.js +4 -3
- package/dist/components/Forms/Field.js +6 -5
- package/dist/components/Forms/FieldBase.js +3 -2
- package/dist/components/Forms/Fieldset.js +10 -23
- package/dist/components/Forms/FieldsetBase.js +4 -3
- package/dist/components/Forms/Input.js +8 -7
- package/dist/components/Forms/Label.js +3 -2
- package/dist/components/Forms/Legend.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/Select.js +5 -23
- package/dist/components/Forms/SelectField.js +4 -3
- package/dist/components/Forms/Switch.js +4 -3
- 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/Textarea.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 +4 -3
- package/dist/components/GlobalHeader/GlobalHeader.js +29 -28
- package/dist/components/GlobalHeader/GlobalMenuButton.js +7 -6
- package/dist/components/GlobalHeader/HeaderDrawer.js +12 -11
- package/dist/components/GlobalHeader/HeaderDropdown.js +6 -5
- package/dist/components/GlobalHeader/HeaderLogo.js +4 -3
- package/dist/components/GlobalMenu/GlobalMenu.js +11 -10
- package/dist/components/GlobalMenu/LocaleSwitcher.js +4 -3
- package/dist/components/GlobalMenu/LogoutButton.js +7 -6
- package/dist/components/Icon/Icon.js +4 -3
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Inbox/InboxPage.js +7 -6
- package/dist/components/InboxSearch/InboxSearch.js +7 -6
- package/dist/components/Item/ItemLabel.js +1 -1
- package/dist/components/Item/ItemMedia.js +3 -2
- package/dist/components/Item/ItemSelect.js +5 -4
- package/dist/components/Item/index.js +1 -1
- package/dist/components/Layout/Layout.js +8 -7
- package/dist/components/List/List.js +4 -3
- package/dist/components/List/ListBase.js +4 -3
- package/dist/components/List/ListItemHeader.js +14 -13
- package/dist/components/List/ListItemIcon.js +5 -4
- package/dist/components/List/ListItemLabel.js +12 -11
- 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 +4 -3
- 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 +1 -1
- package/dist/components/Metadata/MetaItemIcon.js +3 -2
- package/dist/components/Metadata/MetaTimestamp.js +1 -1
- package/dist/components/Metadata/Metadata.js +4 -3
- package/dist/components/Metadata/index.js +1 -1
- package/dist/components/Modal/Modal.js +4 -3
- package/dist/components/Modal/ModalBase.js +4 -3
- package/dist/components/Modal/ModalHeader.js +4 -3
- package/dist/components/Modal/ModalIcon.js +6 -5
- package/dist/components/Notifications/NotificationItem.js +4 -3
- package/dist/components/Notifications/NotificationItemBase.js +4 -3
- package/dist/components/Notifications/NotificationItemControls.js +7 -6
- package/dist/components/Notifications/NotificationItemIcon.js +6 -5
- package/dist/components/Page/AccordionSection.js +4 -3
- package/dist/components/Page/ContactButtons.js +4 -3
- package/dist/components/Page/ContactSection.js +4 -3
- package/dist/components/Page/PageDetails.js +7 -6
- package/dist/components/Page/PageMenu.js +9 -8
- package/dist/components/Page/PageNav.js +8 -7
- package/dist/components/Page/Section.js +8 -7
- package/dist/components/Pagination/Pagination.js +11 -10
- package/dist/components/ResourceListItem/ResourceListItem.js +4 -3
- package/dist/components/RootProvider/RootProvider.js +4 -3
- package/dist/components/RootProvider/index.js +1 -1
- package/dist/components/Search/SearchItem.js +8 -7
- package/dist/components/Searchbar/Autocomplete.js +11 -10
- package/dist/components/Searchbar/AutocompleteItem.js +4 -3
- package/dist/components/Searchbar/Searchbar.js +8 -7
- package/dist/components/Searchbar/SearchbarField.js +8 -7
- package/dist/components/Settings/SettingsItem.js +4 -3
- package/dist/components/Settings/SettingsItemBase.js +13 -12
- package/dist/components/Settings/SettingsList.js +4 -3
- package/dist/components/Settings/SettingsListVirtual.js +4 -3
- package/dist/components/Settings/SettingsModal.js +4 -3
- package/dist/components/Settings/SettingsSection.js +10 -9
- package/dist/components/Settings/UsedByLog.js +12 -11
- package/dist/components/Settings/UsedByLogItem.js +10 -9
- package/dist/components/SkipLink/SkipLink.js +9 -12
- package/dist/components/Snackbar/SnackbarItem.js +4 -3
- package/dist/components/Timeline/Timeline.js +4 -3
- package/dist/components/Timeline/TimelineActivity.js +4 -3
- package/dist/components/Timeline/TimelineBase.js +8 -7
- package/dist/components/Timeline/TimelineFooter.js +4 -3
- 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 +4 -3
- package/dist/components/Toolbar/DatepickerFilter.js +5 -4
- package/dist/components/Toolbar/SelectDateFilter.js +4 -3
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +4 -3
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +4 -3
- package/dist/components/Toolbar/ToolbarFilterButton.js +4 -3
- package/dist/components/Toolbar/ToolbarFilterMenu.js +12 -11
- 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/Tooltip/Tooltip.js +7 -99
- package/dist/components/Transmission/Transmission.js +4 -3
- package/dist/components/Transmission/TransmissionList.js +10 -9
- package/dist/components/Transmission/TransmissionType.js +4 -3
- package/dist/components/Typography/Heading.js +3 -2
- package/dist/components/Typography/Link.js +4 -4
- package/dist/components/Typography/index.js +1 -1
- package/dist/components/UserListItem/UserListItem.js +4 -3
- package/dist/components/index.js +421 -426
- package/dist/hooks/useAccountSelector.js +4 -3
- package/dist/index.js +434 -439
- package/dist/tooltip-B5zQ3zF0.js +6303 -0
- package/dist/types/lib/components/Toolbar/ToolbarSearch.stories.d.ts +2 -0
- package/dist/types/lib/components/UserListItem/UserListItem.d.ts +1 -1
- package/dist/types/lib/components/UserListItem/UserListItem.stories.d.ts +7 -0
- package/dist/use-pagination-mAaJfKMF.js +52 -0
- package/package.json +4 -4
- package/dist/alert-BzifOfXl.js +0 -10
- package/dist/button-BB5sYVKY.js +0 -38
- package/dist/fieldset-legend-B6lDmp0N.js +0 -10
- package/dist/floating-ui.dom-bEgaHJCq.js +0 -997
- package/dist/heading-C_XYsUfi.js +0 -12
- package/dist/index-D7FJjvrv.js +0 -86
- package/dist/index-Q0EA2XB0.js +0 -111
- package/dist/index-z82sbSVU.js +0 -105
- package/dist/input-wBv_FkEV.js +0 -12
- package/dist/label-xTmTyPhk.js +0 -11
- package/dist/link-D1SA3LCe.js +0 -10
- package/dist/lite-1fxw3LjI.js +0 -7
- package/dist/paragraph-BRiIBpbY.js +0 -11
- package/dist/textarea-BBstVlPT.js +0 -10
- package/dist/textfield-f4Za2qt6.js +0 -3484
- package/dist/use-merge-refs-Cj4kTYVj.js +0 -29
package/dist/heading-C_XYsUfi.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { S as a } from "./index-D7FJjvrv.js";
|
|
4
|
-
import { c as i } from "./lite-1fxw3LjI.js";
|
|
5
|
-
import { forwardRef as f } from "react";
|
|
6
|
-
const u = f(function({ level: o = 2, className: r, asChild: t, ...e }, n) {
|
|
7
|
-
const s = t ? a : `h${o}`;
|
|
8
|
-
return m(s, { className: i("ds-heading", r), ref: n, ...e });
|
|
9
|
-
});
|
|
10
|
-
export {
|
|
11
|
-
u as H
|
|
12
|
-
};
|
package/dist/index-D7FJjvrv.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as i from "react";
|
|
2
|
-
import { jsx as p, Fragment as g } from "react/jsx-runtime";
|
|
3
|
-
function d(t, n) {
|
|
4
|
-
if (typeof t == "function")
|
|
5
|
-
return t(n);
|
|
6
|
-
t != null && (t.current = n);
|
|
7
|
-
}
|
|
8
|
-
function C(...t) {
|
|
9
|
-
return (n) => {
|
|
10
|
-
let r = !1;
|
|
11
|
-
const l = t.map((e) => {
|
|
12
|
-
const o = d(e, n);
|
|
13
|
-
return !r && typeof o == "function" && (r = !0), o;
|
|
14
|
-
});
|
|
15
|
-
if (r)
|
|
16
|
-
return () => {
|
|
17
|
-
for (let e = 0; e < l.length; e++) {
|
|
18
|
-
const o = l[e];
|
|
19
|
-
typeof o == "function" ? o() : d(t[e], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var E = /* @__PURE__ */ Symbol.for("react.lazy"), u = i[" use ".trim().toString()];
|
|
25
|
-
function _(t) {
|
|
26
|
-
return typeof t == "object" && t !== null && "then" in t;
|
|
27
|
-
}
|
|
28
|
-
function S(t) {
|
|
29
|
-
return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === E && "_payload" in t && _(t._payload);
|
|
30
|
-
}
|
|
31
|
-
// @__NO_SIDE_EFFECTS__
|
|
32
|
-
function h(t) {
|
|
33
|
-
const n = /* @__PURE__ */ R(t), r = i.forwardRef((l, e) => {
|
|
34
|
-
let { children: o, ...s } = l;
|
|
35
|
-
S(o) && typeof u == "function" && (o = u(o._payload));
|
|
36
|
-
const a = i.Children.toArray(o), c = a.find($);
|
|
37
|
-
if (c) {
|
|
38
|
-
const f = c.props.children, b = a.map((y) => y === c ? i.Children.count(f) > 1 ? i.Children.only(null) : i.isValidElement(f) ? f.props.children : null : y);
|
|
39
|
-
return /* @__PURE__ */ p(n, { ...s, ref: e, children: i.isValidElement(f) ? i.cloneElement(f, void 0, b) : null });
|
|
40
|
-
}
|
|
41
|
-
return /* @__PURE__ */ p(n, { ...s, ref: e, children: o });
|
|
42
|
-
});
|
|
43
|
-
return r.displayName = `${t}.Slot`, r;
|
|
44
|
-
}
|
|
45
|
-
var I = /* @__PURE__ */ h("Slot");
|
|
46
|
-
// @__NO_SIDE_EFFECTS__
|
|
47
|
-
function R(t) {
|
|
48
|
-
const n = i.forwardRef((r, l) => {
|
|
49
|
-
let { children: e, ...o } = r;
|
|
50
|
-
if (S(e) && typeof u == "function" && (e = u(e._payload)), i.isValidElement(e)) {
|
|
51
|
-
const s = x(e), a = j(o, e.props);
|
|
52
|
-
return e.type !== i.Fragment && (a.ref = l ? C(l, s) : s), i.cloneElement(e, a);
|
|
53
|
-
}
|
|
54
|
-
return i.Children.count(e) > 1 ? i.Children.only(null) : null;
|
|
55
|
-
});
|
|
56
|
-
return n.displayName = `${t}.SlotClone`, n;
|
|
57
|
-
}
|
|
58
|
-
var m = /* @__PURE__ */ Symbol("radix.slottable");
|
|
59
|
-
// @__NO_SIDE_EFFECTS__
|
|
60
|
-
function P(t) {
|
|
61
|
-
const n = ({ children: r }) => /* @__PURE__ */ p(g, { children: r });
|
|
62
|
-
return n.displayName = `${t}.Slottable`, n.__radixId = m, n;
|
|
63
|
-
}
|
|
64
|
-
var V = /* @__PURE__ */ P("Slottable");
|
|
65
|
-
function $(t) {
|
|
66
|
-
return i.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === m;
|
|
67
|
-
}
|
|
68
|
-
function j(t, n) {
|
|
69
|
-
const r = { ...n };
|
|
70
|
-
for (const l in n) {
|
|
71
|
-
const e = t[l], o = n[l];
|
|
72
|
-
/^on[A-Z]/.test(l) ? e && o ? r[l] = (...a) => {
|
|
73
|
-
const c = o(...a);
|
|
74
|
-
return e(...a), c;
|
|
75
|
-
} : e && (r[l] = e) : l === "style" ? r[l] = { ...e, ...o } : l === "className" && (r[l] = [e, o].filter(Boolean).join(" "));
|
|
76
|
-
}
|
|
77
|
-
return { ...t, ...r };
|
|
78
|
-
}
|
|
79
|
-
function x(t) {
|
|
80
|
-
let n = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning;
|
|
81
|
-
return r ? t.ref : (n = Object.getOwnPropertyDescriptor(t, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? t.props.ref : t.props.ref || t.ref);
|
|
82
|
-
}
|
|
83
|
-
export {
|
|
84
|
-
I as S,
|
|
85
|
-
V as a
|
|
86
|
-
};
|
package/dist/index-Q0EA2XB0.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { c as M } from "./lite-1fxw3LjI.js";
|
|
4
|
-
import { forwardRef as f, useRef as u, useEffect as A } from "react";
|
|
5
|
-
import { u as x } from "./use-merge-refs-Cj4kTYVj.js";
|
|
6
|
-
var k = typeof window < "u" && typeof window.document < "u" && typeof window.navigator < "u", b;
|
|
7
|
-
k && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474
|
|
8
|
-
/^Mac/i.test(((b = navigator.userAgentData) == null ? void 0 : b.platform) || navigator.platform);
|
|
9
|
-
var T = ":host(:not([hidden])) { display: block }", E = typeof HTMLElement > "u" ? class {
|
|
10
|
-
} : HTMLElement;
|
|
11
|
-
function r(t, e, n) {
|
|
12
|
-
return n === void 0 ? t.getAttribute(e) : (n === null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n), null);
|
|
13
|
-
}
|
|
14
|
-
var w = (t, e, n) => {
|
|
15
|
-
for (const o of n[0].split(","))
|
|
16
|
-
n[0] = o, Element.prototype[`${t}EventListener`].apply(e, n);
|
|
17
|
-
}, g = (t, ...e) => w("add", t, e), v = (t, ...e) => w("remove", t, e), H = (t) => {
|
|
18
|
-
const e = "key" in t && (t.key === " " || t.key === "Enter");
|
|
19
|
-
return e && t.preventDefault(), e && t.target instanceof HTMLElement && t.target.click(), e;
|
|
20
|
-
}, U = (t) => {
|
|
21
|
-
var e;
|
|
22
|
-
const n = ((e = t.getRootNode) == null ? void 0 : e.call(t)) || t.ownerDocument;
|
|
23
|
-
return n instanceof Document || n instanceof ShadowRoot ? n : document;
|
|
24
|
-
}, d = (t, e, n) => {
|
|
25
|
-
const o = document.createElement(t);
|
|
26
|
-
if (e && (o.textContent = e), n) for (const [i, s] of Object.entries(n)) r(o, i, s);
|
|
27
|
-
return o;
|
|
28
|
-
}, D = {
|
|
29
|
-
define: (t, e) => !k || window.customElements.get(t) || window.customElements.define(t, e)
|
|
30
|
-
}, $ = `${T}
|
|
31
|
-
::slotted(u-summary) { cursor: pointer; display: block }
|
|
32
|
-
::slotted(u-summary)::before { content: ''; display: inline-block; vertical-align: middle; margin-inline: .05em .3125em; border-block: .3125em solid transparent; border-inline-start: .5em solid }
|
|
33
|
-
::slotted(u-summary[aria-expanded="true"])::before { rotate: 90deg }
|
|
34
|
-
:host > [part="details-content"]:not([hidden=""]) { display: block }`, N = class extends E {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(), this._content = null, this.shadowRoot || this.attachShadow({ mode: "open" }).append(
|
|
37
|
-
d("slot", null, { name: "summary" }),
|
|
38
|
-
d("slot", null, { part: "details-content" }),
|
|
39
|
-
d("style", $)
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
// Using ES2015 syntax for backwards compatibility
|
|
43
|
-
static get observedAttributes() {
|
|
44
|
-
return ["open"];
|
|
45
|
-
}
|
|
46
|
-
connectedCallback() {
|
|
47
|
-
var t;
|
|
48
|
-
this._content = (t = this.shadowRoot) == null ? void 0 : t.children[1], r(this, "role", "group"), g(this._content, "beforematch", this), g(this, "click,keydown", this), this.attributeChangedCallback();
|
|
49
|
-
}
|
|
50
|
-
disconnectedCallback() {
|
|
51
|
-
this._content && v(this._content, "beforematch", this), v(this, "click,keydown", this), this._content = null;
|
|
52
|
-
}
|
|
53
|
-
attributeChangedCallback(t, e, n) {
|
|
54
|
-
const o = "onbeforematch" in this ? "until-found" : !0, i = this.open;
|
|
55
|
-
for (const s of this.children)
|
|
56
|
-
s.nodeName === "U-SUMMARY" && r(s, "aria-expanded", `${i}`);
|
|
57
|
-
if (this._content && (r(this._content, "aria-hidden", `${!i}`), r(this._content, "tabindex", i ? null : "-1"), this._content.hidden = i ? !1 : o), i && this.name) {
|
|
58
|
-
const s = U(this).querySelectorAll(
|
|
59
|
-
`${this.nodeName}[name="${this.name}"]`
|
|
60
|
-
);
|
|
61
|
-
for (const l of s)
|
|
62
|
-
l !== this && (l.open = !1);
|
|
63
|
-
}
|
|
64
|
-
t === "open" && e === null != (n === null) && this.dispatchEvent(new Event("toggle"));
|
|
65
|
-
}
|
|
66
|
-
handleEvent(t) {
|
|
67
|
-
const e = this.querySelector(":scope > u-summary"), n = e?.contains(t.target);
|
|
68
|
-
t.defaultPrevented || (t.type === "beforematch" && (this.open = !0), n && t.type === "keydown" && H(t), n && t.type === "click" && (this.open = !this.open));
|
|
69
|
-
}
|
|
70
|
-
get open() {
|
|
71
|
-
return this.hasAttribute("open");
|
|
72
|
-
}
|
|
73
|
-
set open(t) {
|
|
74
|
-
r(this, "open", t ? "" : null);
|
|
75
|
-
}
|
|
76
|
-
get name() {
|
|
77
|
-
return r(this, "name") || "";
|
|
78
|
-
}
|
|
79
|
-
set name(t) {
|
|
80
|
-
r(this, "name", t);
|
|
81
|
-
}
|
|
82
|
-
}, O = class extends E {
|
|
83
|
-
connectedCallback() {
|
|
84
|
-
r(this, "role", "button"), this.slot = "summary", this.tabIndex = 0;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
D.define("u-details", N);
|
|
88
|
-
D.define("u-summary", O);
|
|
89
|
-
const j = f(function({ className: e, open: n, defaultOpen: o = !1, variant: i = "default", onToggle: s, ...l }, S) {
|
|
90
|
-
const h = u(null), R = u(o), _ = x([h, S]), p = u(s), c = u(n);
|
|
91
|
-
return p.current = s, c.current = n, A(() => {
|
|
92
|
-
const a = h.current, y = (L) => {
|
|
93
|
-
!a || a?.open === c.current || (p.current?.(L), c.current !== void 0 && (a.open = c.current));
|
|
94
|
-
};
|
|
95
|
-
return a?.addEventListener("toggle", y, !0), () => a?.removeEventListener("toggle", y, !0);
|
|
96
|
-
}, []), m("u-details", { class: M("ds-details", e), open: (n ?? R.current) || void 0, "data-variant": i, ref: _, ...l });
|
|
97
|
-
}), B = f(function(e, n) {
|
|
98
|
-
return m("div", { ref: n, ...e });
|
|
99
|
-
}), I = f(function({ className: e, ...n }, o) {
|
|
100
|
-
return m("u-summary", { ref: o, class: e, ...n });
|
|
101
|
-
}), C = Object.assign(j, {
|
|
102
|
-
Summary: I,
|
|
103
|
-
Content: B
|
|
104
|
-
});
|
|
105
|
-
C.Summary.displayName = "Details.Summary";
|
|
106
|
-
C.Content.displayName = "Details.Content";
|
|
107
|
-
export {
|
|
108
|
-
C as D,
|
|
109
|
-
I as a,
|
|
110
|
-
B as b
|
|
111
|
-
};
|
package/dist/index-z82sbSVU.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as l, jsxs as E, Fragment as j } from "react/jsx-runtime";
|
|
3
|
-
import { S as D } from "./index-D7FJjvrv.js";
|
|
4
|
-
import { c as C } from "./lite-1fxw3LjI.js";
|
|
5
|
-
import { useRef as N, useEffect as x, forwardRef as h, useState as k } from "react";
|
|
6
|
-
import { u as I } from "./use-merge-refs-Cj4kTYVj.js";
|
|
7
|
-
import { P as O } from "./paragraph-BRiIBpbY.js";
|
|
8
|
-
function $(n, t = 50) {
|
|
9
|
-
const i = N(null);
|
|
10
|
-
return x(() => () => {
|
|
11
|
-
i.current && clearTimeout(i.current);
|
|
12
|
-
}, []), (...r) => {
|
|
13
|
-
i.current && clearTimeout(i.current), i.current = window.setTimeout(() => {
|
|
14
|
-
n(...r);
|
|
15
|
-
}, t);
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const q = h(function({ className: t, asChild: i, ...s }, r) {
|
|
19
|
-
return l(i ? D : "p", { className: C("ds-validation-message", t), "data-field": "validation", ref: r, ...s });
|
|
20
|
-
});
|
|
21
|
-
function H(n) {
|
|
22
|
-
if (!n)
|
|
23
|
-
return;
|
|
24
|
-
const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = `:${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;
|
|
25
|
-
let r = null, d = "";
|
|
26
|
-
const m = (p) => {
|
|
27
|
-
const v = [], F = [];
|
|
28
|
-
for (const e of p)
|
|
29
|
-
e.attributeName && v.push(e.target ?? n), v.push(...e.addedNodes || []), F.push(...e.removedNodes || []);
|
|
30
|
-
for (const e of v)
|
|
31
|
-
w(e) && (R(e) ? t.set(e, e.htmlFor) : e.hasAttribute("data-field") ? t.set(e, e.id) : T(e) && !e.hidden && (r = e, d = e.getAttribute("aria-describedby") || ""));
|
|
32
|
-
for (const e of F)
|
|
33
|
-
w(e) && (r === e && (r = null), t.has(e) && (A(e, R(e) ? "for" : "id", t.get(e)), t.delete(e)));
|
|
34
|
-
const u = d ? d.split(" ") : [], b = r?.id || s;
|
|
35
|
-
i.clear();
|
|
36
|
-
for (const [e, g] of t) {
|
|
37
|
-
const f = e.getAttribute("data-field");
|
|
38
|
-
let o;
|
|
39
|
-
if (f) {
|
|
40
|
-
const c = (i.get(f) || 0) + 1;
|
|
41
|
-
i.set(f, c), o = `${b}:${f}:${c}`;
|
|
42
|
-
} else
|
|
43
|
-
o = b;
|
|
44
|
-
g || A(e, R(e) ? "for" : "id", o), u.includes(e.id) || (f === "validation" ? u.unshift(e.id) : f && u.push(e.id));
|
|
45
|
-
}
|
|
46
|
-
A(r, "id", b), A(r, "aria-describedby", u.join(" ").trim());
|
|
47
|
-
}, a = V(m);
|
|
48
|
-
return a.observe(n, {
|
|
49
|
-
attributeFilter: ["id", "for", "aria-describedby"],
|
|
50
|
-
attributes: !0,
|
|
51
|
-
childList: !0,
|
|
52
|
-
subtree: !0
|
|
53
|
-
}), m([{ addedNodes: n.querySelectorAll("*") }]), a.takeRecords(), () => a.disconnect();
|
|
54
|
-
}
|
|
55
|
-
const w = (n) => n instanceof Element, R = (n) => n instanceof HTMLLabelElement, T = (n) => n instanceof HTMLElement && "validity" in n && !(n instanceof HTMLButtonElement), A = (n, t, i) => i ? n?.setAttribute(t, i) : n?.removeAttribute(t);
|
|
56
|
-
function V(n) {
|
|
57
|
-
const t = [], i = new MutationObserver((r) => {
|
|
58
|
-
t.length || requestAnimationFrame(s), t.push(...r);
|
|
59
|
-
}), s = () => {
|
|
60
|
-
n(t, i), t.length = 0, i.takeRecords();
|
|
61
|
-
};
|
|
62
|
-
return i;
|
|
63
|
-
}
|
|
64
|
-
const B = h(function({ className: t, position: i, asChild: s, ...r }, d) {
|
|
65
|
-
const m = s ? D : "div", a = N(null), p = I([a, d]);
|
|
66
|
-
return x(() => H(a.current), []), l(m, { className: C("ds-field", t), "data-position": i, ref: p, ...r });
|
|
67
|
-
}), P = h(function({ className: t, ...i }, s) {
|
|
68
|
-
return l("div", { className: C("ds-field-affixes", t), ref: s, ...i });
|
|
69
|
-
}), z = h(function({ className: t, ...i }, s) {
|
|
70
|
-
return l("span", { className: C("ds-field-affix", t), "aria-hidden": "true", ref: s, ...i });
|
|
71
|
-
}), y = (n, t) => n.replace("%d", Math.abs(t).toString()), G = h(function({ limit: t, under: i = "%d tegn igjen", over: s = "%d tegn for mye", hint: r = "Maks %d tegn tillatt.", ...d }, m) {
|
|
72
|
-
const [a, p] = k(0), [v, F] = k(""), u = N(null), b = N(null), e = a > t, g = t - a, f = $((o) => F(o), 1200);
|
|
73
|
-
return x(() => {
|
|
74
|
-
const o = b.current?.closest(".ds-field"), c = Array.from(o?.getElementsByTagName("*") || []).find(T), M = ({ target: S }) => {
|
|
75
|
-
T(S) && p(S.value.length);
|
|
76
|
-
};
|
|
77
|
-
return c && M({ target: c }), u.current = c, o?.addEventListener("input", M), () => o?.removeEventListener("input", M);
|
|
78
|
-
}, []), x(() => {
|
|
79
|
-
if (u.current) {
|
|
80
|
-
const o = u.current.value.length;
|
|
81
|
-
p((c) => c === o ? c : o);
|
|
82
|
-
}
|
|
83
|
-
}), x(() => {
|
|
84
|
-
f(y(e ? s : i, g));
|
|
85
|
-
}, [a, t, s, i, e, g]), E(j, { children: [l("div", { className: "ds-sr-only", "aria-live": "polite", ref: b, children: v }), e ? l(q, { ref: m, ...d, "aria-hidden": "true", "data-field": null, children: y(s, g) }) : l(O, { ref: m, ...d, "aria-hidden": "true", children: y(i, g) }), l("div", { className: "ds-sr-only", "aria-hidden": "true", "data-field": "description", children: y(r, t) })] });
|
|
86
|
-
}), J = h(function(t, i) {
|
|
87
|
-
return l("div", { "data-field": "description", ref: i, ...t });
|
|
88
|
-
}), L = Object.assign(B, {
|
|
89
|
-
Description: J,
|
|
90
|
-
Affixes: P,
|
|
91
|
-
Affix: z,
|
|
92
|
-
Counter: G
|
|
93
|
-
});
|
|
94
|
-
L.Description.displayName = "Field.Description";
|
|
95
|
-
L.Affixes.displayName = "Field.Affixes";
|
|
96
|
-
L.Affix.displayName = "Field.Affix";
|
|
97
|
-
L.Counter.displayName = "Field.Counter";
|
|
98
|
-
export {
|
|
99
|
-
L as F,
|
|
100
|
-
q as V,
|
|
101
|
-
J as a,
|
|
102
|
-
P as b,
|
|
103
|
-
z as c,
|
|
104
|
-
$ as u
|
|
105
|
-
};
|
package/dist/input-wBv_FkEV.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
-
import { c as i } from "./lite-1fxw3LjI.js";
|
|
4
|
-
import { forwardRef as u } from "react";
|
|
5
|
-
const d = u(function({ type: r = "text", className: o, onChange: e, onClick: p, ...t }, a) {
|
|
6
|
-
return f("input", { className: i("ds-input", o), ref: a, type: r, onChange: (n) => t.readOnly || e?.(n), onClick: (n) => {
|
|
7
|
-
t.readOnly && n.preventDefault(), p?.(n);
|
|
8
|
-
}, ...t });
|
|
9
|
-
});
|
|
10
|
-
export {
|
|
11
|
-
d as I
|
|
12
|
-
};
|
package/dist/label-xTmTyPhk.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { S as s } from "./index-D7FJjvrv.js";
|
|
4
|
-
import { c as l } from "./lite-1fxw3LjI.js";
|
|
5
|
-
import { forwardRef as n } from "react";
|
|
6
|
-
const u = n(function({ className: o, weight: e = "medium", asChild: t, ...r }, m) {
|
|
7
|
-
return a(t ? s : "label", { ref: m, className: l("ds-label", o), "data-weight": e, ...r });
|
|
8
|
-
});
|
|
9
|
-
export {
|
|
10
|
-
u as L
|
|
11
|
-
};
|
package/dist/link-D1SA3LCe.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { S as n } from "./index-D7FJjvrv.js";
|
|
4
|
-
import { c as e } from "./lite-1fxw3LjI.js";
|
|
5
|
-
import { forwardRef as a } from "react";
|
|
6
|
-
const i = a(({ asChild: o, className: r, ...m }, s) => t(o ? n : "a", { className: e("ds-link", r), ref: s, ...m }));
|
|
7
|
-
i.displayName = "Link";
|
|
8
|
-
export {
|
|
9
|
-
i as L
|
|
10
|
-
};
|
package/dist/lite-1fxw3LjI.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { S as n } from "./index-D7FJjvrv.js";
|
|
4
|
-
import { c as s } from "./lite-1fxw3LjI.js";
|
|
5
|
-
import { forwardRef as e } from "react";
|
|
6
|
-
const g = e(function({ className: r, asChild: a, variant: o = "default", ...t }, p) {
|
|
7
|
-
return m(a ? n : "p", { ref: p, className: s("ds-paragraph", r), "data-variant": o, ...t });
|
|
8
|
-
});
|
|
9
|
-
export {
|
|
10
|
-
g as P
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { c as o } from "./lite-1fxw3LjI.js";
|
|
4
|
-
import { forwardRef as s } from "react";
|
|
5
|
-
const n = s(function({ className: r, ...e }, t) {
|
|
6
|
-
return a("textarea", { className: o("ds-input", r), ref: t, ...e });
|
|
7
|
-
});
|
|
8
|
-
export {
|
|
9
|
-
n as T
|
|
10
|
-
};
|