asma-ui-core 3.104.0 → 3.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +62 -43
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -52
- package/dist/components/data-display/tooltip/StyledTooltip.js +110 -65
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +104 -80
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +94 -85
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/menu/StyledMenuList.js +47 -38
- package/dist/components/navigation/tabs/StyledTab.js +25 -18
- package/dist/components/navigation/tabs/StyledTabs.js +33 -33
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +4 -3
- package/dist/helpers/warnUnnamedDialog.js +6 -0
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +15 -2
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +10 -7
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +2 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -1
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +9 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +57 -50
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/dist/table/shared-components/button/StyledButton.module.js +11 -11
- package/package.json +1 -1
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Children as
|
|
1
|
+
import { cn as s } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as A } from "../../../helpers/sx.js";
|
|
3
|
+
import { StyledTooltip as E } from "../../data-display/tooltip/StyledTooltip.js";
|
|
4
|
+
import { StyledCheckbox as _ } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
|
|
5
|
+
import { Children as C, isValidElement as S } from "react";
|
|
6
6
|
import { jsx as u } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
7
|
+
var c = {
|
|
8
8
|
en: "Already added",
|
|
9
9
|
no: "Allerede lagt til"
|
|
10
|
-
},
|
|
10
|
+
}, L = () => (typeof document > "u" ? "" : document.documentElement.lang).toLowerCase().startsWith("en") ? c.en : c.no, f = (a) => {
|
|
11
11
|
let t = !1;
|
|
12
|
-
return
|
|
13
|
-
if (t || !
|
|
14
|
-
if (o.type ===
|
|
12
|
+
return C.forEach(a, (o) => {
|
|
13
|
+
if (t || !S(o)) return;
|
|
14
|
+
if (o.type === _) {
|
|
15
15
|
const e = o.props;
|
|
16
16
|
t = e.checked === !0 && e.disabled === !0;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const n = o.props.children;
|
|
20
|
+
n !== void 0 && f(n) && (t = !0);
|
|
21
21
|
}), t;
|
|
22
|
-
},
|
|
23
|
-
const
|
|
22
|
+
}, H = ({ children: a, onClick: t, onMouseDown: o, onMouseUp: n, disabled: e, disabledReason: l, "aria-busy": v, selected: d, dense: y, tooltip: x, className: h, classes: p, sx: b, "data-test": D, "data-testid": w, value: M }) => {
|
|
23
|
+
const g = (i) => {
|
|
24
|
+
e || (i.key === "Enter" || i.key === " ") && (i.preventDefault(), t?.(i));
|
|
25
|
+
}, r = !!e && !!l, k = /* @__PURE__ */ u("li", {
|
|
24
26
|
role: "menuitem",
|
|
25
27
|
"aria-disabled": e ? !0 : void 0,
|
|
28
|
+
"aria-busy": v ? !0 : void 0,
|
|
29
|
+
"data-has-reason": r ? "" : void 0,
|
|
26
30
|
tabIndex: -1,
|
|
27
|
-
"data-test":
|
|
28
|
-
"data-testid":
|
|
31
|
+
"data-test": D,
|
|
32
|
+
"data-testid": w,
|
|
29
33
|
onClick: e ? void 0 : t,
|
|
30
34
|
onMouseDown: e ? void 0 : o,
|
|
31
|
-
onMouseUp: e ? void 0 :
|
|
32
|
-
onKeyDown:
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
className: i("box-border flex items-center px-4 text-base outline-none focus-visible:shadow-[inset_3px_0_var(--colors-focus-ring)]", f ? "min-h-8 py-1" : "min-h-10 py-2", "asma-pressable asma-touch-target", e ? "cursor-not-allowed text-delta-300 aria-disabled:text-delta-300" : i("cursor-pointer text-delta-700", !l && "hover:bg-delta-50"), l && i("bg-gama-50", d?.selected), d?.root, v),
|
|
35
|
+
onMouseUp: e ? void 0 : n,
|
|
36
|
+
onKeyDown: g,
|
|
37
|
+
className: s("box-border flex items-center px-4 text-base outline-none focus-visible:shadow-[inset_3px_0_var(--colors-focus-ring)]", y ? "min-h-8 py-1" : "min-h-10 py-2", "asma-pressable asma-touch-target", e ? "cursor-not-allowed text-delta-300 aria-disabled:text-delta-300" : s("cursor-pointer text-delta-700", !d && "hover:bg-delta-50"), d && s("bg-gama-50", p?.selected), p?.root, h),
|
|
36
38
|
style: {
|
|
37
39
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
38
|
-
...
|
|
40
|
+
...A(b)
|
|
39
41
|
},
|
|
40
|
-
children:
|
|
41
|
-
}), m =
|
|
42
|
-
return
|
|
42
|
+
children: a
|
|
43
|
+
}), m = r ? l : x ?? (f(a) ? L() : void 0);
|
|
44
|
+
return /* @__PURE__ */ u(E, {
|
|
43
45
|
title: m,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
open: m ? void 0 : !1,
|
|
47
|
+
arrow: !r,
|
|
48
|
+
placement: r ? "left" : "top",
|
|
49
|
+
openOnTap: r,
|
|
50
|
+
persistentDescription: r,
|
|
51
|
+
children: k
|
|
52
|
+
});
|
|
48
53
|
};
|
|
49
54
|
export {
|
|
50
|
-
|
|
55
|
+
H as StyledMenuItem
|
|
51
56
|
};
|
|
@@ -1,65 +1,74 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { consumerOverrides as
|
|
3
|
-
import
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
7
|
-
const
|
|
1
|
+
import { cn as R } from "../../../helpers/cn.js";
|
|
2
|
+
import { consumerOverrides as T } from "../../../helpers/classOverride.js";
|
|
3
|
+
import p from "./StyledMenu.module.js";
|
|
4
|
+
import { useEffect as M, useLayoutEffect as k, useRef as q } from "react";
|
|
5
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
6
|
+
var d = '[role="menu"], [role="listbox"]', y = '[role="menuitem"]', E = (r) => Array.from(r.childNodes).flatMap((t) => t instanceof HTMLElement ? t.hidden ? [] : t.matches(d) ? [null] : t.matches(y) ? [t] : t.querySelector(y) ? E(t) : [null] : t.textContent?.trim() ? [null] : []), h = (r) => r ? Array.from(r.querySelectorAll('[role="menuitem"]')) : [], v = (r) => h(r).filter((t) => t.getAttribute("aria-disabled") !== "true"), x = (r, t) => {
|
|
7
|
+
const u = h(r).filter((o) => o.closest(d) === r), m = (t && u.includes(t) ? t : void 0) ?? u.find((o) => o.tabIndex === 0) ?? v(r).find((o) => o.closest(d) === r) ?? u[0];
|
|
8
|
+
u.forEach((o) => {
|
|
9
|
+
o.tabIndex = o === m ? 0 : -1;
|
|
10
|
+
});
|
|
11
|
+
}, _ = ({ children: r, id: t, role: u = "menu", className: m, autoFocus: o, disablePadding: w, onClick: I, onKeyDown: L }) => {
|
|
12
|
+
const i = q(null), b = T(m, "padding");
|
|
8
13
|
k(() => {
|
|
9
14
|
const e = i.current;
|
|
10
15
|
if (!e) return;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
if (Array.from(e.querySelectorAll(
|
|
14
|
-
const
|
|
15
|
-
e.style.maxHeight =
|
|
16
|
+
const n = () => {
|
|
17
|
+
const a = E(e);
|
|
18
|
+
if (Array.from(e.querySelectorAll(y)).filter((l) => l.closest(d) === e).forEach((l) => l.removeAttribute("data-menu-separator")), a.forEach((l, f) => l?.toggleAttribute("data-menu-separator", !!a[f + 1])), e.classList.contains(p.anchoredList)) {
|
|
19
|
+
const l = (a.every(Boolean) ? a[7] : null)?.getBoundingClientRect(), f = l && l.height > 0 ? l.top - e.getBoundingClientRect().top + e.scrollTop + l.height / 2 : null;
|
|
20
|
+
e.style.maxHeight = f === null ? "" : `${f}px`, e.toggleAttribute("data-menu-scroll", f !== null);
|
|
16
21
|
}
|
|
22
|
+
x(e);
|
|
17
23
|
};
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
return
|
|
24
|
+
n();
|
|
25
|
+
const c = requestAnimationFrame(n), s = new MutationObserver(n);
|
|
26
|
+
return s.observe(e, {
|
|
21
27
|
childList: !0,
|
|
22
28
|
subtree: !0,
|
|
23
29
|
attributes: !0,
|
|
24
30
|
attributeFilter: ["hidden"]
|
|
25
31
|
}), () => {
|
|
26
|
-
cancelAnimationFrame(
|
|
32
|
+
cancelAnimationFrame(c), s.disconnect();
|
|
27
33
|
};
|
|
28
|
-
}, []),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
34
|
+
}, []), M(() => {
|
|
35
|
+
o && (v(i.current)[0] ?? h(i.current)[0])?.focus();
|
|
36
|
+
}, [o]);
|
|
37
|
+
const S = (e) => {
|
|
38
|
+
if (L?.(e), ![
|
|
33
39
|
"ArrowDown",
|
|
34
40
|
"ArrowUp",
|
|
35
41
|
"Home",
|
|
36
42
|
"End"
|
|
37
43
|
].includes(e.key)) return;
|
|
38
44
|
e.preventDefault();
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
let
|
|
43
|
-
e.key === "ArrowDown" ?
|
|
44
|
-
},
|
|
45
|
-
id:
|
|
46
|
-
className:
|
|
45
|
+
const n = h(i.current);
|
|
46
|
+
if (n.length === 0) return;
|
|
47
|
+
const c = n.findIndex((a) => a === document.activeElement);
|
|
48
|
+
let s = c;
|
|
49
|
+
e.key === "ArrowDown" ? s = (c + 1) % n.length : e.key === "ArrowUp" ? s = (c - 1 + n.length) % n.length : e.key === "Home" ? s = 0 : e.key === "End" && (s = n.length - 1), n[s]?.focus(), i.current?.hasAttribute("data-menu-scroll") && n[s]?.scrollIntoView({ block: "nearest" });
|
|
50
|
+
}, g = {
|
|
51
|
+
id: t,
|
|
52
|
+
className: R(p.list, "m-0 list-none outline-none", !b && "px-0", !b && (w ? "py-0" : "py-2"), m),
|
|
47
53
|
style: { fontFamily: "Roboto, Helvetica, Arial, sans-serif" },
|
|
48
|
-
onClick:
|
|
49
|
-
onKeyDown:
|
|
54
|
+
onClick: I,
|
|
55
|
+
onKeyDown: S,
|
|
56
|
+
onFocus: (e) => {
|
|
57
|
+
i.current && e.target instanceof HTMLElement && x(i.current, e.target);
|
|
58
|
+
}
|
|
50
59
|
};
|
|
51
|
-
return
|
|
60
|
+
return u === "listbox" ? /* @__PURE__ */ A("ul", {
|
|
52
61
|
ref: i,
|
|
53
|
-
...
|
|
62
|
+
...g,
|
|
54
63
|
role: "listbox",
|
|
55
|
-
children:
|
|
56
|
-
}) : /* @__PURE__ */
|
|
64
|
+
children: r
|
|
65
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
57
66
|
ref: i,
|
|
58
|
-
...
|
|
67
|
+
...g,
|
|
59
68
|
role: "menu",
|
|
60
|
-
children:
|
|
69
|
+
children: r
|
|
61
70
|
});
|
|
62
71
|
};
|
|
63
72
|
export {
|
|
64
|
-
|
|
73
|
+
_ as StyledMenuList
|
|
65
74
|
};
|
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { cn as y } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as _ } from "../../../helpers/sx.js";
|
|
3
|
+
import { StyledTooltip as w } from "../../data-display/tooltip/StyledTooltip.js";
|
|
4
|
+
import { useTabsContext as T } from "./TabsContext.js";
|
|
5
|
+
import { useCallback as S } from "react";
|
|
6
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
7
|
+
var A = ({ value: i, label: m, disabled: t, disabledReason: l, tooltip: p, className: n, sx: f, index: x }) => {
|
|
8
|
+
const e = T(), o = i !== void 0 ? i : x, r = e ? e.value === o : !1, b = /\btext-(?:xs|sm|base|lg|xl|\[)/.test(n ?? ""), u = /\bfont-(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black)\b/.test(n ?? ""), h = /\b(?:uppercase|lowercase|capitalize|normal-case)\b/.test(n ?? ""), d = S((a) => {
|
|
9
|
+
e?.register(o, a);
|
|
10
|
+
}, [e, o]), s = t && l ? l : p, v = !!t && !!s, g = /* @__PURE__ */ c("button", {
|
|
11
|
+
ref: d,
|
|
12
12
|
type: "button",
|
|
13
13
|
role: "tab",
|
|
14
14
|
"aria-selected": r,
|
|
15
|
-
"aria-disabled":
|
|
16
|
-
disabled: e,
|
|
15
|
+
"aria-disabled": t ? !0 : void 0,
|
|
17
16
|
tabIndex: r ? 0 : -1,
|
|
18
17
|
"data-tab-value": typeof o == "string" || typeof o == "number" ? String(o) : void 0,
|
|
19
|
-
onClick: (
|
|
20
|
-
className:
|
|
18
|
+
onClick: (a) => !t && e?.onSelect(a, o),
|
|
19
|
+
className: y("inline-flex min-h-12 min-w-[90px] shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-t-lg border-0 bg-transparent px-4 py-3 tracking-normal outline-none transition-colors", !b && (e?.size === "small" ? "text-base" : "text-lg"), !u && (e?.size === "small" || r || t ? "font-semibold" : "font-medium hover:font-semibold focus-visible:font-semibold"), !h && "normal-case", e?.size === "small" && "min-h-10 px-3 py-2", "asma-pressable", t ? "text-delta-300" : r ? "text-gama-500" : "text-delta-600", t ? "cursor-not-allowed" : "cursor-pointer", "focus-visible:shadow-[inset_0_0_0_3px_var(--colors-focus-ring)]", !t && !r && "hover:shadow-[inset_0_-3px_0_0_var(--colors-delta-300)]", n),
|
|
21
20
|
style: {
|
|
22
21
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
23
|
-
...
|
|
22
|
+
..._(f)
|
|
24
23
|
},
|
|
25
|
-
children:
|
|
24
|
+
children: m
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ c(w, {
|
|
27
|
+
title: s,
|
|
28
|
+
open: s ? void 0 : !1,
|
|
29
|
+
arrow: !0,
|
|
30
|
+
openOnTap: v,
|
|
31
|
+
persistentDescription: !!s,
|
|
32
|
+
children: g
|
|
26
33
|
});
|
|
27
34
|
};
|
|
28
35
|
export {
|
|
29
|
-
|
|
36
|
+
A as StyledTab
|
|
30
37
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as s } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as K } from "../../../helpers/sx.js";
|
|
3
3
|
import { ChevronRightIcon as M } from "../../icons/chevron-right-icon/ChevronRightIcon.js";
|
|
4
4
|
import { ChevronLeftIcon as V } from "../../icons/chevron-left-icon/ChevronLeftIcon.js";
|
|
@@ -6,39 +6,39 @@ import { consumerOverrides as q } from "../../../helpers/classOverride.js";
|
|
|
6
6
|
import { TabsContext as z } from "./TabsContext.js";
|
|
7
7
|
import { Children as F, cloneElement as G, isValidElement as J, useCallback as b, useLayoutEffect as Q, useMemo as U, useRef as E, useState as A } from "react";
|
|
8
8
|
import { jsx as l, jsxs as B } from "react/jsx-runtime";
|
|
9
|
-
var I = 120, le = ({ value:
|
|
10
|
-
const
|
|
9
|
+
var I = 120, le = ({ value: n, onChange: m, variant: g = "standard", scrollButtons: w = "auto", centered: j, size: f = "default", className: p, sx: N, children: x }) => {
|
|
10
|
+
const i = E(null), a = E(/* @__PURE__ */ new Map()), [h, O] = A({
|
|
11
11
|
left: 0,
|
|
12
12
|
width: 0,
|
|
13
13
|
disabled: !1
|
|
14
|
-
}), [
|
|
14
|
+
}), [c, W] = A({
|
|
15
15
|
left: !1,
|
|
16
16
|
right: !1
|
|
17
17
|
}), y = g === "scrollable", v = b((e, t) => {
|
|
18
|
-
t ?
|
|
19
|
-
}, []), S = b((e, t) => m?.(e, t), [m]),
|
|
20
|
-
const e =
|
|
18
|
+
t ? a.current.set(e, t) : a.current.delete(e);
|
|
19
|
+
}, []), S = b((e, t) => m?.(e, t), [m]), d = b(() => {
|
|
20
|
+
const e = a.current.get(n), t = i.current;
|
|
21
21
|
if (e && O({
|
|
22
22
|
left: e.offsetLeft,
|
|
23
23
|
width: e.offsetWidth,
|
|
24
24
|
disabled: e.disabled || e.getAttribute("aria-disabled") === "true"
|
|
25
25
|
}), t) {
|
|
26
|
-
const { scrollLeft: o, scrollWidth: r, clientWidth:
|
|
26
|
+
const { scrollLeft: o, scrollWidth: r, clientWidth: u } = t;
|
|
27
27
|
W({
|
|
28
28
|
left: o > 1,
|
|
29
|
-
right: o +
|
|
29
|
+
right: o + u < r - 1
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
}, [
|
|
32
|
+
}, [n]);
|
|
33
33
|
Q(() => {
|
|
34
|
-
|
|
35
|
-
const e =
|
|
34
|
+
d();
|
|
35
|
+
const e = i.current;
|
|
36
36
|
if (!e) return;
|
|
37
|
-
const t = new ResizeObserver(
|
|
37
|
+
const t = new ResizeObserver(d);
|
|
38
38
|
return t.observe(e), () => t.disconnect();
|
|
39
|
-
}, [
|
|
39
|
+
}, [d, x]);
|
|
40
40
|
const k = (e) => {
|
|
41
|
-
|
|
41
|
+
i.current?.scrollBy({
|
|
42
42
|
left: e,
|
|
43
43
|
behavior: "smooth"
|
|
44
44
|
});
|
|
@@ -50,33 +50,33 @@ var I = 120, le = ({ value: i, onChange: m, variant: g = "standard", scrollButto
|
|
|
50
50
|
"End"
|
|
51
51
|
].includes(e.key)) return;
|
|
52
52
|
e.preventDefault();
|
|
53
|
-
const t = Array.from(
|
|
53
|
+
const t = Array.from(a.current.values());
|
|
54
54
|
if (t.length === 0) return;
|
|
55
|
-
const o = t.findIndex((
|
|
55
|
+
const o = t.findIndex((u) => u === document.activeElement);
|
|
56
56
|
let r = o;
|
|
57
57
|
e.key === "ArrowRight" ? r = (o + 1) % t.length : e.key === "ArrowLeft" ? r = (o - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1), t[r]?.focus();
|
|
58
|
-
}, L = y && w !== !1, R = w === !0, D = L && (R ||
|
|
59
|
-
value:
|
|
60
|
-
size:
|
|
58
|
+
}, L = y && w !== !1, R = w === !0, D = L && (R || c.left), P = L && (R || c.right), T = q(p, "padding-x"), H = U(() => ({
|
|
59
|
+
value: n,
|
|
60
|
+
size: f,
|
|
61
61
|
onSelect: S,
|
|
62
62
|
register: v
|
|
63
63
|
}), [
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
n,
|
|
65
|
+
f,
|
|
66
66
|
S,
|
|
67
67
|
v
|
|
68
68
|
]), C = "flex h-10 w-10 shrink-0 items-center justify-center self-center rounded-[10%] border border-solid border-delta-500 text-delta-700 transition-colors hover:bg-gama-50 disabled:invisible";
|
|
69
69
|
return /* @__PURE__ */ l(z.Provider, {
|
|
70
70
|
value: H,
|
|
71
71
|
children: /* @__PURE__ */ B("div", {
|
|
72
|
-
className:
|
|
72
|
+
className: s("relative flex items-center rounded-t-lg bg-white", !T && "px-4", p),
|
|
73
73
|
style: K(N),
|
|
74
74
|
children: [
|
|
75
75
|
D && /* @__PURE__ */ l("button", {
|
|
76
76
|
type: "button",
|
|
77
77
|
"aria-label": "scroll tabs left",
|
|
78
|
-
className:
|
|
79
|
-
disabled: !
|
|
78
|
+
className: s(C, "mr-2"),
|
|
79
|
+
disabled: !c.left,
|
|
80
80
|
onClick: () => k(-I),
|
|
81
81
|
children: /* @__PURE__ */ l(V, {
|
|
82
82
|
width: 24,
|
|
@@ -84,26 +84,26 @@ var I = 120, le = ({ value: i, onChange: m, variant: g = "standard", scrollButto
|
|
|
84
84
|
})
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ B("div", {
|
|
87
|
-
ref:
|
|
87
|
+
ref: i,
|
|
88
88
|
role: "tablist",
|
|
89
89
|
"aria-orientation": "horizontal",
|
|
90
90
|
onKeyDown: _,
|
|
91
|
-
onScroll:
|
|
92
|
-
className:
|
|
91
|
+
onScroll: d,
|
|
92
|
+
className: s("relative flex bg-[linear-gradient(to_top,var(--colors-delta-200)_1px,transparent_1px)] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", y ? "flex-1 overflow-x-auto" : "w-full", g === "fullWidth" && "[&>*]:flex-1", j && "justify-center", f === "small" && "min-h-9"),
|
|
93
93
|
children: [F.map(x, (e, t) => J(e) ? G(e, { index: t }) : e), /* @__PURE__ */ l("span", {
|
|
94
94
|
"aria-hidden": !0,
|
|
95
|
-
className:
|
|
95
|
+
className: s("absolute bottom-0 h-[3px] transition-all duration-300", h.disabled ? "bg-delta-300" : "bg-gama-500"),
|
|
96
96
|
style: {
|
|
97
|
-
left:
|
|
98
|
-
width:
|
|
97
|
+
left: h.left,
|
|
98
|
+
width: h.width
|
|
99
99
|
}
|
|
100
100
|
})]
|
|
101
101
|
}),
|
|
102
102
|
P && /* @__PURE__ */ l("button", {
|
|
103
103
|
type: "button",
|
|
104
104
|
"aria-label": "scroll tabs right",
|
|
105
|
-
className:
|
|
106
|
-
disabled: !
|
|
105
|
+
className: s(C, "ml-2"),
|
|
106
|
+
disabled: !c.right,
|
|
107
107
|
onClick: () => k(I),
|
|
108
108
|
children: /* @__PURE__ */ l(M, {
|
|
109
109
|
width: 24,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as n } from "../../../helpers/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { registerOpenModalDialog as A } from "../../../hooks/useTopLayer.hook.js";
|
|
3
|
+
import { CloseIcon as H } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { IndeterminateIcon as q } from "../../icons/indeterminate-icon/IndeterminateIcon.js";
|
|
5
5
|
import { StyledButton as I } from "../../inputs/button/StyledButton.js";
|
|
6
6
|
import { useShortViewportMediaQuery as G } from "../../../hooks/useMediaQuery.hook.js";
|
|
7
7
|
import { useDebouncedValue as P } from "../../../hooks/useDebouncedValue.hook.js";
|
|
@@ -26,7 +26,7 @@ var te = 500, xe = ({ dataTest: r, id: D, open: a, onClose: o, title: s, ariaLab
|
|
|
26
26
|
v.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.open || e.showModal(), e.focus({ preventScroll: !0 });
|
|
27
27
|
const U = requestAnimationFrame(() => {
|
|
28
28
|
y(!0);
|
|
29
|
-
}), V =
|
|
29
|
+
}), V = A(e);
|
|
30
30
|
return () => {
|
|
31
31
|
cancelAnimationFrame(U), V(), y(!1), e.open && e.close();
|
|
32
32
|
const E = v.current;
|
|
@@ -87,12 +87,12 @@ var te = 500, xe = ({ dataTest: r, id: D, open: a, onClose: o, title: s, ariaLab
|
|
|
87
87
|
onClick: () => {
|
|
88
88
|
o("closeButton");
|
|
89
89
|
},
|
|
90
|
-
startIcon: /* @__PURE__ */ t(
|
|
90
|
+
startIcon: /* @__PURE__ */ t(H, {
|
|
91
91
|
width: 24,
|
|
92
92
|
height: 24
|
|
93
93
|
})
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */ t(
|
|
95
|
+
/* @__PURE__ */ t(q, {
|
|
96
96
|
"aria-hidden": "true",
|
|
97
97
|
focusable: "false",
|
|
98
98
|
width: 24,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { StyledTooltip as c } from "../../data-display/tooltip/StyledTooltip.js";
|
|
2
|
+
import { ContentCopyIcon as d } from "../../icons/content-copy-icon/ContentCopyIcon.js";
|
|
3
3
|
import { StyledButton as m } from "../../inputs/button/StyledButton.js";
|
|
4
4
|
import { useMobileMediaQuery as h } from "../../../hooks/useMediaQuery.hook.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx as t } from "react/jsx-runtime";
|
|
7
7
|
var g = ({ className: n, contentToCopy: p, locale: r, messageInfo: a, text: e }) => {
|
|
8
8
|
const i = r === "en" ? "Copy" : "Kopier", l = h();
|
|
9
|
-
return /* @__PURE__ */ t(
|
|
9
|
+
return /* @__PURE__ */ t(c, {
|
|
10
10
|
title: i,
|
|
11
11
|
children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(m, {
|
|
12
12
|
dataTest: "copy-button",
|
|
@@ -14,7 +14,7 @@ var g = ({ className: n, contentToCopy: p, locale: r, messageInfo: a, text: e })
|
|
|
14
14
|
className: n,
|
|
15
15
|
size: "small",
|
|
16
16
|
variant: "text",
|
|
17
|
-
startIcon: /* @__PURE__ */ t(
|
|
17
|
+
startIcon: /* @__PURE__ */ t(d, {
|
|
18
18
|
width: 20,
|
|
19
19
|
height: 20
|
|
20
20
|
}),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { cn as m } from "../../../helpers/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { StyledTooltip as s } from "../../data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { ContentCopyIcon as c } from "../../icons/content-copy-icon/ContentCopyIcon.js";
|
|
4
4
|
import { StyledButton as d } from "../../inputs/button/StyledButton.js";
|
|
5
5
|
import e from "./CopyWrapper.module.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
8
8
|
var b = ({ className: i, contentToCopy: p, locale: o, messageInfo: a, children: n }) => /* @__PURE__ */ h("div", {
|
|
9
9
|
className: m("flex items-center hover:text-gama-500", e["copy-wrapper"], i),
|
|
10
|
-
children: [n, /* @__PURE__ */ t(
|
|
10
|
+
children: [n, /* @__PURE__ */ t(s, {
|
|
11
11
|
title: o === "no" ? "Kopier" : "Copy",
|
|
12
12
|
children: /* @__PURE__ */ t("div", {
|
|
13
13
|
className: e["hidden-copy"],
|
|
@@ -22,7 +22,7 @@ var b = ({ className: i, contentToCopy: p, locale: o, messageInfo: a, children:
|
|
|
22
22
|
a(o === "no" ? "Kopiert til utklippstavle" : "Copied to clipboard");
|
|
23
23
|
}).catch((l) => console.error("Copying failed with this: ", l));
|
|
24
24
|
},
|
|
25
|
-
startIcon: /* @__PURE__ */ t(
|
|
25
|
+
startIcon: /* @__PURE__ */ t(c, {
|
|
26
26
|
width: 20,
|
|
27
27
|
height: 20
|
|
28
28
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
"asma-core-ui-button": "_asma-core-ui-
|
|
3
|
-
contained:
|
|
4
|
-
common:
|
|
1
|
+
var _ = "_contained_11nol_6", o = "_common_11nol_6", t = "_medium_11nol_56", a = "_small_11nol_61", e = "_large_11nol_66", r = "_error_11nol_76", l = "_outlined_11nol_146", n = "_text_11nol_286", m = "_textGray_11nol_426", u = "_textWhite_11nol_496", v = {
|
|
2
|
+
"asma-core-ui-button": "_asma-core-ui-button_11nol_1",
|
|
3
|
+
contained: _,
|
|
4
|
+
common: o,
|
|
5
5
|
medium: t,
|
|
6
6
|
small: a,
|
|
7
|
-
large:
|
|
8
|
-
error:
|
|
9
|
-
outlined:
|
|
10
|
-
text:
|
|
11
|
-
textGray:
|
|
12
|
-
textWhite:
|
|
7
|
+
large: e,
|
|
8
|
+
error: r,
|
|
9
|
+
outlined: l,
|
|
10
|
+
text: n,
|
|
11
|
+
textGray: m,
|
|
12
|
+
textWhite: u
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
v as default
|
|
16
16
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r = (a) => a.tabIndex >= 0 && !a.matches(":disabled") && !a.closest("[inert]") && (a.checkVisibility?.() ?? !0), b = (a) => (a.tabIndex >= 0 || a.hasAttribute("tabindex")) && !a.matches(":disabled"), i = (a) => Array.from(a.querySelectorAll("*")).filter(r), l = (a) => r(a) ? a : Array.from(a.querySelectorAll("*")).find(r) ?? null, s = (a) => b(a) ? a : Array.from(a.querySelectorAll("*")).find(b) ?? null;
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
s as firstFocusable,
|
|
4
|
+
l as firstTabbable,
|
|
5
|
+
i as tabbableWithin
|
|
5
6
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
typeof process < "u" && process.env.NODE_ENV === "production" || console.warn(`[asma-ui-core/StyledDialog] "${e ?? "dialog"}" has no accessible name — pass dialogTitle, dialogLabel or ariaLabel, or render a heading in its content`);
|
|
3
|
+
}
|
|
4
|
+
export {
|
|
5
|
+
a as warnUnnamedDialog
|
|
6
|
+
};
|