@mattilsynet/design 2.1.2 → 2.1.4
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/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.d.ts +2 -1
- package/mtds/analytics/analytics.js +83 -59
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +6 -6
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +26 -10
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +10 -26
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +1 -1
- package/mtds/app/app.js.map +1 -1
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.js +8 -4
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.d.ts +5 -2
- package/mtds/card/card.js.map +1 -1
- package/mtds/card/card.stories.d.ts +1 -0
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/details/details.js.map +1 -1
- package/mtds/details/details.stories.d.ts +1 -0
- package/mtds/dialog/dialog-observer.js +7 -3
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.js +6 -4
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js +342 -0
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js +397 -0
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js +137 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +1 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js.map +1 -1
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +1 -1
- package/mtds/field/field-observer.js +54 -48
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.d.ts +3 -3
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset-observer.js +4 -4
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/index.iife.js +17 -7
- package/mtds/input/input.js.map +1 -1
- package/mtds/layout/layout.d.ts +4 -5
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +4 -2
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination-helper.js.map +1 -1
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +28 -14
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.d.ts +3 -2
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/popover/popover.stories.d.ts +1 -0
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-types.d.ts +1 -0
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +20 -20
- package/mtds/styles.module.css.js +31 -31
- package/mtds/table/table-observer.js +10 -8
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/togglegroup/togglegroup-observer.js +8 -8
- package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +14 -10
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.d.ts +2 -14
- package/mtds/utils.js +60 -71
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +14 -13
- package/mtds/toast/toast-observer.d.ts +0 -2
package/mtds/styles.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
"alert": "_alert_1run0_1 _ds-
|
|
2
|
+
"alert": "_alert_1run0_1 _ds-alert_wy3tx_1",
|
|
3
3
|
"app": "_app_1run0_1",
|
|
4
4
|
"sticky": "_sticky_1run0_1",
|
|
5
|
-
"avatar": "_avatar_1run0_1 _ds-
|
|
5
|
+
"avatar": "_avatar_1run0_1 _ds-avatar_wy3tx_1",
|
|
6
6
|
"badge": "_badge_1run0_1",
|
|
7
|
-
"breadcrumbs": "_breadcrumbs_1run0_1 _ds-
|
|
8
|
-
"button": "_button_1run0_1 _ds-
|
|
7
|
+
"breadcrumbs": "_breadcrumbs_1run0_1 _ds-breadcrumbs_wy3tx_1",
|
|
8
|
+
"button": "_button_1run0_1 _ds-button_wy3tx_1",
|
|
9
9
|
"card": "_card_1run0_1",
|
|
10
10
|
"group": "_group_1run0_1",
|
|
11
|
-
"chip": "_chip_1run0_1 _ds-
|
|
12
|
-
"details": "_details_1run0_1 _ds-
|
|
13
|
-
"dialog": "_dialog_1run0_1 _ds-
|
|
11
|
+
"chip": "_chip_1run0_1 _ds-chip_wy3tx_1",
|
|
12
|
+
"details": "_details_1run0_1 _ds-details_wy3tx_1",
|
|
13
|
+
"dialog": "_dialog_1run0_1 _ds-dialog_wy3tx_1",
|
|
14
14
|
"divider": "_divider_1run0_1",
|
|
15
|
-
"errorsummary": "_errorsummary_1run0_1 _ds-error-
|
|
16
|
-
"field": "_field_1run0_1 _ds-
|
|
17
|
-
"affixes": "_affixes_1run0_1 _ds-field-
|
|
18
|
-
"fieldset": "_fieldset_1run0_1 _ds-
|
|
19
|
-
"heading": "_heading_1run0_1 _ds-
|
|
15
|
+
"errorsummary": "_errorsummary_1run0_1 _ds-error-summary_wy3tx_1",
|
|
16
|
+
"field": "_field_1run0_1 _ds-field_wy3tx_1",
|
|
17
|
+
"affixes": "_affixes_1run0_1 _ds-field-affixes_wy3tx_1",
|
|
18
|
+
"fieldset": "_fieldset_1run0_1 _ds-fieldset_wy3tx_1",
|
|
19
|
+
"heading": "_heading_1run0_1 _ds-heading_wy3tx_1",
|
|
20
20
|
"ingress": "_ingress_1run0_1",
|
|
21
21
|
"muted": "_muted_1run0_1",
|
|
22
22
|
"info": "_info_1run0_1",
|
|
23
23
|
"prose": "_prose_1run0_1",
|
|
24
|
-
"helptext": "_helptext_1run0_1 _ds-
|
|
25
|
-
"input": "_input_1run0_1 _ds-
|
|
24
|
+
"helptext": "_helptext_1run0_1 _ds-focus_wy3tx_1",
|
|
25
|
+
"input": "_input_1run0_1 _ds-input_wy3tx_1",
|
|
26
26
|
"grid": "_grid_1run0_1",
|
|
27
27
|
"flex": "_flex_1run0_1",
|
|
28
28
|
"link": "_link_1run0_1",
|
|
29
29
|
"logo": "_logo_1run0_1",
|
|
30
|
-
"pagination": "_pagination_1run0_1 _ds-
|
|
30
|
+
"pagination": "_pagination_1run0_1 _ds-pagination_wy3tx_1",
|
|
31
31
|
"popover": "_popover_1run0_1",
|
|
32
32
|
"progress": "_progress_1run0_1",
|
|
33
|
-
"skeleton": "_skeleton_1run0_1 _ds-
|
|
33
|
+
"skeleton": "_skeleton_1run0_1 _ds-skeleton_wy3tx_1",
|
|
34
34
|
"spinner": "_spinner_1run0_1",
|
|
35
35
|
"steps": "_steps_1run0_1",
|
|
36
|
-
"table": "_table_1run0_1 _ds-
|
|
37
|
-
"tabs": "_tabs_1run0_1 _ds-
|
|
38
|
-
"tag": "_tag_1run0_1 _ds-
|
|
36
|
+
"table": "_table_1run0_1 _ds-table_wy3tx_1",
|
|
37
|
+
"tabs": "_tabs_1run0_1 _ds-tabs_wy3tx_1",
|
|
38
|
+
"tag": "_tag_1run0_1 _ds-tag_wy3tx_1",
|
|
39
39
|
"togglegroup": "_togglegroup_1run0_1",
|
|
40
|
-
"validation": "_validation_1run0_1 _ds-validation-
|
|
40
|
+
"validation": "_validation_1run0_1 _ds-validation-message_wy3tx_1",
|
|
41
41
|
"body": "_body_1run0_153"
|
|
42
42
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const _ = "_alert_1run0_1 _ds-
|
|
1
|
+
const _ = "_alert_1run0_1 _ds-alert_wy3tx_1", t = "_app_1run0_1", n = "_sticky_1run0_1", s = "_avatar_1run0_1 _ds-avatar_wy3tx_1", r = "_badge_1run0_1", o = "_breadcrumbs_1run0_1 _ds-breadcrumbs_wy3tx_1", e = "_button_1run0_1 _ds-button_wy3tx_1", a = "_card_1run0_1", d = "_group_1run0_1", i = "_chip_1run0_1 _ds-chip_wy3tx_1", u = "_details_1run0_1 _ds-details_wy3tx_1", c = "_dialog_1run0_1 _ds-dialog_wy3tx_1", l = "__drawer_1run0_1", p = "_divider_1run0_1", g = "_errorsummary_1run0_1 _ds-error-summary_wy3tx_1", y = "__errorsummary_1run0_1", x = "_field_1run0_1 _ds-field_wy3tx_1", b = "__datalist_1run0_1", w = "_affixes_1run0_1 _ds-field-affixes_wy3tx_1", f = "_fieldset_1run0_1 _ds-fieldset_wy3tx_1", m = "_heading_1run0_1 _ds-heading_wy3tx_1", k = "_ingress_1run0_1", h = "_muted_1run0_1", v = "_info_1run0_1", M = "_prose_1run0_1", S = "_helptext_1run0_1 _ds-focus_wy3tx_1", j = "_input_1run0_1 _ds-input_wy3tx_1", q = "_grid_1run0_1", z = "_flex_1run0_1", A = "_link_1run0_1", B = "_logo_1run0_1", C = "_pagination_1run0_1 _ds-pagination_wy3tx_1", D = "_popover_1run0_1", E = "_progress_1run0_1", F = "__indeterminate_1run0_1", G = "_skeleton_1run0_1 _ds-skeleton_wy3tx_1", H = "__skeleton_1run0_1", I = "_spinner_1run0_1", J = "_steps_1run0_1", K = "_table_1run0_1 _ds-table_wy3tx_1", L = "__scrollShadow_1run0_1", N = "_tabs_1run0_1 _ds-tabs_wy3tx_1", O = "__scrollMask_1run0_1", P = "_tag_1run0_1 _ds-tag_wy3tx_1", Q = "_togglegroup_1run0_1", R = "__tooltip_1run0_1", T = "_validation_1run0_1 _ds-validation-message_wy3tx_1", U = "_body_1run0_153", V = "__checked_1run0_1", W = {
|
|
2
2
|
alert: _,
|
|
3
|
-
app:
|
|
4
|
-
sticky:
|
|
5
|
-
avatar:
|
|
3
|
+
app: t,
|
|
4
|
+
sticky: n,
|
|
5
|
+
avatar: s,
|
|
6
6
|
badge: r,
|
|
7
7
|
breadcrumbs: o,
|
|
8
8
|
button: e,
|
|
9
|
-
card:
|
|
10
|
-
group:
|
|
11
|
-
chip:
|
|
9
|
+
card: a,
|
|
10
|
+
group: d,
|
|
11
|
+
chip: i,
|
|
12
12
|
details: u,
|
|
13
13
|
dialog: c,
|
|
14
14
|
_drawer: l,
|
|
15
15
|
divider: p,
|
|
16
|
-
errorsummary:
|
|
17
|
-
_errorsummary:
|
|
18
|
-
field:
|
|
16
|
+
errorsummary: g,
|
|
17
|
+
_errorsummary: y,
|
|
18
|
+
field: x,
|
|
19
19
|
_datalist: b,
|
|
20
|
-
affixes:
|
|
21
|
-
fieldset:
|
|
22
|
-
heading:
|
|
23
|
-
ingress:
|
|
24
|
-
muted:
|
|
25
|
-
info:
|
|
20
|
+
affixes: w,
|
|
21
|
+
fieldset: f,
|
|
22
|
+
heading: m,
|
|
23
|
+
ingress: k,
|
|
24
|
+
muted: h,
|
|
25
|
+
info: v,
|
|
26
26
|
prose: M,
|
|
27
27
|
helptext: S,
|
|
28
28
|
input: j,
|
|
@@ -53,40 +53,40 @@ export {
|
|
|
53
53
|
V as _checked,
|
|
54
54
|
b as _datalist,
|
|
55
55
|
l as _drawer,
|
|
56
|
-
|
|
56
|
+
y as _errorsummary,
|
|
57
57
|
F as _indeterminate,
|
|
58
58
|
O as _scrollMask,
|
|
59
59
|
L as _scrollShadow,
|
|
60
60
|
H as _skeleton,
|
|
61
61
|
R as _tooltip,
|
|
62
|
-
|
|
62
|
+
w as affixes,
|
|
63
63
|
_ as alert,
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
t as app,
|
|
65
|
+
s as avatar,
|
|
66
66
|
r as badge,
|
|
67
67
|
U as body,
|
|
68
68
|
o as breadcrumbs,
|
|
69
69
|
e as button,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
a as card,
|
|
71
|
+
i as chip,
|
|
72
72
|
W as default,
|
|
73
73
|
u as details,
|
|
74
74
|
c as dialog,
|
|
75
75
|
p as divider,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
g as errorsummary,
|
|
77
|
+
x as field,
|
|
78
|
+
f as fieldset,
|
|
79
79
|
z as flex,
|
|
80
80
|
q as grid,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
d as group,
|
|
82
|
+
m as heading,
|
|
83
83
|
S as helptext,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
v as info,
|
|
85
|
+
k as ingress,
|
|
86
86
|
j as input,
|
|
87
87
|
A as link,
|
|
88
88
|
B as logo,
|
|
89
|
-
|
|
89
|
+
h as muted,
|
|
90
90
|
C as pagination,
|
|
91
91
|
D as popover,
|
|
92
92
|
E as progress,
|
|
@@ -94,7 +94,7 @@ export {
|
|
|
94
94
|
G as skeleton,
|
|
95
95
|
I as spinner,
|
|
96
96
|
J as steps,
|
|
97
|
-
|
|
97
|
+
n as sticky,
|
|
98
98
|
K as table,
|
|
99
99
|
N as tabs,
|
|
100
100
|
P as tag,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "../styles.module.css.js";
|
|
2
2
|
import { onLoaded as i, onMutation as f, attr as o } from "../utils.js";
|
|
3
|
-
const d =
|
|
4
|
-
function m(
|
|
5
|
-
for (const t of
|
|
6
|
-
const
|
|
3
|
+
const d = s.table.split(" ")[0];
|
|
4
|
+
function m(a) {
|
|
5
|
+
for (const t of a) {
|
|
6
|
+
const n = [];
|
|
7
7
|
o(t, "role", "table"), t.caption && o(t.caption, "role", "caption");
|
|
8
8
|
for (const r of [t.tHead, t.tFoot, ...t.tBodies])
|
|
9
9
|
if (r) {
|
|
10
10
|
o(r, "role", "rowgroup");
|
|
11
|
-
const
|
|
11
|
+
const l = r.nodeName === "TBODY";
|
|
12
12
|
for (const c of r.rows) {
|
|
13
13
|
o(c, "role", "row");
|
|
14
14
|
for (const e of c.cells)
|
|
15
|
-
|
|
15
|
+
l ? o(e, "data-th", n[e.cellIndex] || ":empty") : n.push(e.innerText.trim()), e.nodeName === "TD" ? o(e, "role", "cell") : (o(e, "role", l ? "rowheader" : "columnheader"), o(e, "scope", l ? "row" : "col"));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
i(
|
|
20
|
+
i(
|
|
21
|
+
() => f(document.documentElement, d, m)
|
|
22
|
+
);
|
|
21
23
|
//# sourceMappingURL=table-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-observer.js","sources":["../../designsystem/table/table-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, onLoaded, onMutation } from \"../utils\";\n\nconst CSS_TABLE = styles.table.split(\" \")[0];\n\nfunction
|
|
1
|
+
{"version":3,"file":"table-observer.js","sources":["../../designsystem/table/table-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, onLoaded, onMutation } from \"../utils\";\n\nconst CSS_TABLE = styles.table.split(\" \")[0];\n\nfunction handleTableMutation(tables: HTMLCollectionOf<HTMLTableElement>) {\n\tfor (const table of tables) {\n\t\tconst ths: string[] = []; // Add data-th=\"\" to each cell to support data-mobile designs\n\n\t\tattr(table, \"role\", \"table\"); // Add helping role=\"\" to ensure screen readers understand the table regardless of CSS display\n\t\tif (table.caption) attr(table.caption, \"role\", \"caption\");\n\t\tfor (const group of [table.tHead, table.tFoot, ...table.tBodies])\n\t\t\tif (group) {\n\t\t\t\tattr(group, \"role\", \"rowgroup\");\n\t\t\t\tconst isTbody = group.nodeName === \"TBODY\";\n\n\t\t\t\tfor (const row of group.rows) {\n\t\t\t\t\tattr(row, \"role\", \"row\");\n\t\t\t\t\tfor (const cell of row.cells) {\n\t\t\t\t\t\tif (isTbody) attr(cell, \"data-th\", ths[cell.cellIndex] || \":empty\");\n\t\t\t\t\t\telse ths.push(cell.innerText.trim()); // Using innerText to only include visible text\n\t\t\t\t\t\tif (cell.nodeName === \"TD\") attr(cell, \"role\", \"cell\");\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tattr(cell, \"role\", isTbody ? \"rowheader\" : \"columnheader\");\n\t\t\t\t\t\t\tattr(cell, \"scope\", isTbody ? \"row\" : \"col\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t}\n}\n\nonLoaded(() =>\n\tonMutation(document.documentElement, CSS_TABLE, handleTableMutation),\n);\n"],"names":["CSS_TABLE","styles","handleTableMutation","tables","table","ths","attr","group","isTbody","row","cell","onLoaded","onMutation"],"mappings":";;AAGA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC;AAE3C,SAASC,EAAoBC,GAA4C;AACxE,aAAWC,KAASD,GAAQ;AAC3B,UAAME,IAAgB,CAAA;AAEtB,IAAAC,EAAKF,GAAO,QAAQ,OAAO,GACvBA,EAAM,WAASE,EAAKF,EAAM,SAAS,QAAQ,SAAS;AACxD,eAAWG,KAAS,CAACH,EAAM,OAAOA,EAAM,OAAO,GAAGA,EAAM,OAAO;AAC9D,UAAIG,GAAO;AACV,QAAAD,EAAKC,GAAO,QAAQ,UAAU;AAC9B,cAAMC,IAAUD,EAAM,aAAa;AAEnC,mBAAWE,KAAOF,EAAM,MAAM;AAC7B,UAAAD,EAAKG,GAAK,QAAQ,KAAK;AACvB,qBAAWC,KAAQD,EAAI;AACtB,YAAID,MAAcE,GAAM,WAAWL,EAAIK,EAAK,SAAS,KAAK,QAAQ,IAC7DL,EAAI,KAAKK,EAAK,UAAU,MAAM,GAC/BA,EAAK,aAAa,OAAMJ,EAAKI,GAAM,QAAQ,MAAM,KAEpDJ,EAAKI,GAAM,QAAQF,IAAU,cAAc,cAAc,GACzDF,EAAKI,GAAM,SAASF,IAAU,QAAQ,KAAK;AAAA,QAG9C;AAAA,MACD;AAAA,EACF;AACD;AAEAG;AAAA,EAAS,MACRC,EAAW,SAAS,iBAAiBZ,GAAWE,CAAmB;AACpE;"}
|
package/mtds/table/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":["../../designsystem/table/table.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type TableProps = React.ComponentPropsWithoutRef<\"table\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-border\"?: boolean | \"true\" | \"false\";\n\t\"data-fixed\"?: boolean;\n\t\"data-mobile\"?: \"divided\" | \"spaced\" | \"stacked\";\n};\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t<table className={clsx(styles.table, className)} ref={ref} {...rest} />\n\t);\n});\n"],"names":["Table","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../designsystem/table/table.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type TableProps = React.ComponentPropsWithoutRef<\"table\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-border\"?: boolean | \"true\" | \"false\";\n\t\"data-fixed\"?: boolean;\n\t\"data-mobile\"?: \"divided\" | \"spaced\" | \"stacked\";\n};\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t<table className={clsx(styles.table, className)} ref={ref} {...rest} />\n\t);\n});\n"],"names":["Table","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAWO,MAAMA,IAAQC,EAAyC,SAC7D,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,GACC;AACD,SACC,gBAAAC,EAAC,SAAA,EAAM,WAAWC,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAEvE,CAAC;"}
|
package/mtds/tabs/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sources":["../../designsystem/tabs/tabs.tsx"],"sourcesContent":["import type * as UTabs from \"@u-elements/u-tabs\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type TabsProps = UTabs.ReactUtabs;\nconst TabsComp = forwardRef<UTabs.UHTMLTabsElement, TabsProps>(\n\tfunction Tabs(props, ref) {\n\t\treturn <u-tabs ref={ref} {...toCustomElementProps(props, styles.tabs)} />;\n\t},\n);\n\nexport type TabsListProps = UTabs.ReactUtablist;\nconst TabsList = forwardRef<UTabs.UHTMLTabListElement, TabsListProps>(\n\tfunction TabsList(props, ref) {\n\t\treturn <u-tablist ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type TabsPanelProps = UTabs.ReactUtabpanel;\nconst TabsPanel = forwardRef<UTabs.UHTMLTabPanelElement, TabsPanelProps>(\n\tfunction TabsPanel(props, ref) {\n\t\treturn <u-tabpanel ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type TabsTabProps = UTabs.ReactUtab;\nconst TabsTab = forwardRef<UTabs.UHTMLTabElement, TabsTabProps>(\n\tfunction TabsTab(props, ref) {\n\t\treturn <u-tab ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Tabs = Object.assign(TabsComp, {\n\tList: TabsList,\n\tPanel: TabsPanel,\n\tTab: TabsTab,\n});\n"],"names":["TabsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","TabsList","TabsPanel","TabsTab","Tabs"],"mappings":";;;;AAMA,MAAMA,IAAWC;AAAA,EAChB,SAAcC,GAAOC,GAAK;
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../designsystem/tabs/tabs.tsx"],"sourcesContent":["import type * as UTabs from \"@u-elements/u-tabs\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type TabsProps = UTabs.ReactUtabs;\nconst TabsComp = forwardRef<UTabs.UHTMLTabsElement, TabsProps>(\n\tfunction Tabs(props, ref) {\n\t\treturn <u-tabs ref={ref} {...toCustomElementProps(props, styles.tabs)} />;\n\t},\n);\n\nexport type TabsListProps = UTabs.ReactUtablist;\nconst TabsList = forwardRef<UTabs.UHTMLTabListElement, TabsListProps>(\n\tfunction TabsList(props, ref) {\n\t\treturn <u-tablist ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type TabsPanelProps = UTabs.ReactUtabpanel;\nconst TabsPanel = forwardRef<UTabs.UHTMLTabPanelElement, TabsPanelProps>(\n\tfunction TabsPanel(props, ref) {\n\t\treturn <u-tabpanel ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type TabsTabProps = UTabs.ReactUtab;\nconst TabsTab = forwardRef<UTabs.UHTMLTabElement, TabsTabProps>(\n\tfunction TabsTab(props, ref) {\n\t\treturn <u-tab ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Tabs = Object.assign(TabsComp, {\n\tList: TabsList,\n\tPanel: TabsPanel,\n\tTab: TabsTab,\n});\n"],"names":["TabsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","TabsList","TabsPanel","TabsTab","Tabs"],"mappings":";;;;AAMA,MAAMA,IAAWC;AAAA,EAChB,SAAcC,GAAOC,GAAK;AACzB,WAAO,gBAAAC,EAAC,YAAO,KAAAD,GAAW,GAAGE,EAAqBH,GAAOI,EAAO,IAAI,GAAG;AAAA,EACxE;AACD,GAGMC,IAAWN;AAAA,EAChB,SAAkBC,GAAOC,GAAK;AAC7B,6BAAQ,aAAA,EAAU,KAAAA,GAAW,GAAGE,EAAqBH,CAAK,GAAG;AAAA,EAC9D;AACD,GAGMM,IAAYP;AAAA,EACjB,SAAmBC,GAAOC,GAAK;AAC9B,6BAAQ,cAAA,EAAW,KAAAA,GAAW,GAAGE,EAAqBH,CAAK,GAAG;AAAA,EAC/D;AACD,GAGMO,IAAUR;AAAA,EACf,SAAiBC,GAAOC,GAAK;AAC5B,6BAAQ,SAAA,EAAM,KAAAA,GAAW,GAAGE,EAAqBH,CAAK,GAAG;AAAA,EAC1D;AACD,GAEaQ,IAAO,OAAO,OAAOV,GAAU;AAAA,EAC3C,MAAMO;AAAA,EACN,OAAOC;AAAA,EACP,KAAKC;AACN,CAAC;"}
|
package/mtds/tag/tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sources":["../../designsystem/tag/tag.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type TagProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As>;\n\ntype TagComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: TagProps<Href, As>,\n) => JSX.Element;\n\nexport const Tag: TagComponent = forwardRef<null>(function Tag<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: TagProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.tag, className)} ref={ref} {...rest} />;\n}) as TagComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Tag","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tag.js","sources":["../../designsystem/tag/tag.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type TagProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As>;\n\ntype TagComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: TagProps<Href, As>,\n) => JSX.Element;\n\nexport const Tag: TagComponent = forwardRef<null>(function Tag<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: TagProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.tag, className)} ref={ref} {...rest} />;\n}) as TagComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Tag","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBO,MAAMA,IAAoBC,EAAiB,SAGhD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA4BC,GAA0B;AAC3E,QAAML,IAAME,MAAOE,EAAK,OAAO,MAAM;AAErC,SAAO,gBAAAE,EAACN,GAAA,EAAI,WAAWO,EAAKC,EAAO,KAAKL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AACzE,CAAC;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import c from "../styles.module.css.js";
|
|
2
|
-
import { onLoaded as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { key:
|
|
6
|
-
if (
|
|
2
|
+
import { onLoaded as g, on as l } from "../utils.js";
|
|
3
|
+
const u = `.${c.togglegroup.split(" ")[0]}`;
|
|
4
|
+
function f(e) {
|
|
5
|
+
const { key: n, target: t } = e, r = t instanceof HTMLInputElement && t.closest(u);
|
|
6
|
+
if (r && (n === "Enter" && t.click(), n?.startsWith("Arrow"))) {
|
|
7
7
|
e.preventDefault();
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const o = r.getElementsByTagName("input"), s = [...o].indexOf(t), i = n.match(/Arrow(Right|Down)/) ? 1 : -1;
|
|
9
|
+
o[(o.length + s + i) % o.length]?.focus();
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
g(() => l(document, "keydown", f));
|
|
13
13
|
//# sourceMappingURL=togglegroup-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"togglegroup-observer.js","sources":["../../designsystem/togglegroup/togglegroup-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { on, onLoaded } from \"../utils\";\n\nconst CSS_TOGGLEGROUP = `.${styles.togglegroup.split(\" \")[0]}`;\n\n// Prevent browsers from showing default validation bubbles\nfunction
|
|
1
|
+
{"version":3,"file":"togglegroup-observer.js","sources":["../../designsystem/togglegroup/togglegroup-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { on, onLoaded } from \"../utils\";\n\nconst CSS_TOGGLEGROUP = `.${styles.togglegroup.split(\" \")[0]}`;\n\n// Prevent browsers from showing default validation bubbles\nfunction handleTogglegroupKeydown(event: Event & Partial<KeyboardEvent>) {\n\tconst { key, target: el } = event;\n\tconst group = el instanceof HTMLInputElement && el.closest(CSS_TOGGLEGROUP);\n\n\tif (!group) return;\n\tif (key === \"Enter\") el.click();\n\tif (key?.startsWith(\"Arrow\")) {\n\t\tevent.preventDefault();\n\t\tconst inputs = group.getElementsByTagName(\"input\");\n\t\tconst index = [...inputs].indexOf(el);\n\t\tconst move = key.match(/Arrow(Right|Down)/) ? 1 : -1;\n\t\tinputs[(inputs.length + index + move) % inputs.length]?.focus();\n\t}\n}\n\nonLoaded(() => on(document, \"keydown\", handleTogglegroupKeydown));\n"],"names":["CSS_TOGGLEGROUP","styles","handleTogglegroupKeydown","event","key","el","group","inputs","index","move","onLoaded","on"],"mappings":";;AAGA,MAAMA,IAAkB,IAAIC,EAAO,YAAY,MAAM,GAAG,EAAE,CAAC,CAAC;AAG5D,SAASC,EAAyBC,GAAuC;AACxE,QAAM,EAAE,KAAAC,GAAK,QAAQC,EAAA,IAAOF,GACtBG,IAAQD,aAAc,oBAAoBA,EAAG,QAAQL,CAAe;AAE1E,MAAKM,MACDF,MAAQ,WAASC,EAAG,MAAA,GACpBD,GAAK,WAAW,OAAO,IAAG;AAC7B,IAAAD,EAAM,eAAA;AACN,UAAMI,IAASD,EAAM,qBAAqB,OAAO,GAC3CE,IAAQ,CAAC,GAAGD,CAAM,EAAE,QAAQF,CAAE,GAC9BI,IAAOL,EAAI,MAAM,mBAAmB,IAAI,IAAI;AAClD,IAAAG,GAAQA,EAAO,SAASC,IAAQC,KAAQF,EAAO,MAAM,GAAG,MAAA;AAAA,EACzD;AACD;AAEAG,EAAS,MAAMC,EAAG,UAAU,WAAWT,CAAwB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"togglegroup.js","sources":["../../designsystem/togglegroup/togglegroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type TogglegroupProps = React.ComponentPropsWithoutRef<\"fieldset\">;\nexport type TogglegroupItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"label\">,\n\t\"onChange\"\n> &\n\tPick<\n\t\tReact.ComponentPropsWithoutRef<\"input\">,\n\t\t\"defaultChecked\" | \"checked\" | \"onChange\"\n\t> & { name: string; value: string }; // Make name and value required\n\nconst TogglegroupComp = forwardRef<HTMLFieldSetElement, TogglegroupProps>(\n\tfunction Togglegroup({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<fieldset\n\t\t\t\tclassName={clsx(styles.togglegroup, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\nconst TogglegroupItem = forwardRef<HTMLLabelElement, TogglegroupItemProps>(\n\tfunction TogglegroupItem(\n\t\t{ children, checked, defaultChecked, name, onChange, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<label ref={ref} {...rest}>\n\t\t\t\t<input type=\"radio\" {...{ checked, defaultChecked, name, onChange }} />\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t},\n);\n\nexport const Togglegroup = Object.assign(TogglegroupComp, {\n\tItem: TogglegroupItem,\n});\n"],"names":["TogglegroupComp","forwardRef","className","rest","ref","jsx","clsx","styles","TogglegroupItem","children","checked","defaultChecked","name","onChange","jsxs","Togglegroup"],"mappings":";;;;AAcA,MAAMA,IAAkBC;AAAA,EACvB,SAAqB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;
|
|
1
|
+
{"version":3,"file":"togglegroup.js","sources":["../../designsystem/togglegroup/togglegroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type TogglegroupProps = React.ComponentPropsWithoutRef<\"fieldset\">;\nexport type TogglegroupItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"label\">,\n\t\"onChange\"\n> &\n\tPick<\n\t\tReact.ComponentPropsWithoutRef<\"input\">,\n\t\t\"defaultChecked\" | \"checked\" | \"onChange\"\n\t> & { name: string; value: string }; // Make name and value required\n\nconst TogglegroupComp = forwardRef<HTMLFieldSetElement, TogglegroupProps>(\n\tfunction Togglegroup({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<fieldset\n\t\t\t\tclassName={clsx(styles.togglegroup, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\nconst TogglegroupItem = forwardRef<HTMLLabelElement, TogglegroupItemProps>(\n\tfunction TogglegroupItem(\n\t\t{ children, checked, defaultChecked, name, onChange, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<label ref={ref} {...rest}>\n\t\t\t\t<input type=\"radio\" {...{ checked, defaultChecked, name, onChange }} />\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t},\n);\n\nexport const Togglegroup = Object.assign(TogglegroupComp, {\n\tItem: TogglegroupItem,\n});\n"],"names":["TogglegroupComp","forwardRef","className","rest","ref","jsx","clsx","styles","TogglegroupItem","children","checked","defaultChecked","name","onChange","jsxs","Togglegroup"],"mappings":";;;;AAcA,MAAMA,IAAkBC;AAAA,EACvB,SAAqB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AACjD,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,aAAaL,CAAS;AAAA,QAC7C,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD,GACMK,IAAkBP;AAAA,EACvB,SACC,EAAE,UAAAQ,GAAU,SAAAC,GAAS,gBAAAC,GAAgB,MAAAC,GAAM,UAAAC,GAAU,GAAGV,EAAA,GACxDC,GACC;AACD,WACC,gBAAAU,EAAC,SAAA,EAAM,KAAAV,GAAW,GAAGD,GACpB,UAAA;AAAA,MAAA,gBAAAE,EAAC,SAAA,EAAM,MAAK,SAAc,SAAAK,GAAS,gBAAAC,GAAgB,MAAAC,GAAM,UAAAC,GAAY;AAAA,MACpEJ;AAAA,IAAA,GACF;AAAA,EAEF;AACD,GAEaM,IAAc,OAAO,OAAOf,GAAiB;AAAA,EACzD,MAAMQ;AACP,CAAC;"}
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import L from "../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { flip as L, shift as h } from "../external/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
2
|
+
import w from "../styles.module.css.js";
|
|
3
|
+
import { IS_BROWSER as C, onLoaded as I, on as d, QUICK_EVENT as r, attr as a, anchorPosition as u } from "../utils.js";
|
|
4
|
+
const m = "aria-describedby", p = "Escape", s = "aria-labelledby", O = "--mtds-tooltip-position", A = 300, o = C ? Object.assign(document.createElement("div"), {
|
|
5
|
+
className: w._tooltip,
|
|
5
6
|
id: "mtds-tooltip",
|
|
6
7
|
popover: "manual"
|
|
7
8
|
}) : null;
|
|
8
9
|
let e = null, f = Number.NEGATIVE_INFINITY, T = 0;
|
|
9
10
|
function c({ target: i, type: t, key: n }) {
|
|
10
11
|
if (t === "keydown" && n !== p) return;
|
|
11
|
-
const l = f +
|
|
12
|
+
const l = f + A - Date.now();
|
|
12
13
|
clearTimeout(T), T = setTimeout(
|
|
13
|
-
|
|
14
|
+
S,
|
|
14
15
|
Math.max(l, 0),
|
|
15
16
|
n === p ? null : i
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function S(i) {
|
|
19
20
|
if (f = Date.now(), !o || i === o) return;
|
|
20
21
|
o?.isConnected || document.body.append(o);
|
|
21
22
|
let t = i?.closest?.("[data-tooltip]") || null;
|
|
22
23
|
if (t === e) return;
|
|
23
|
-
const n = t && a(t, "data-tooltip") || "", l = t && a(t, "data-tooltip-position") || window.getComputedStyle(t || document.body).getPropertyValue(
|
|
24
|
+
const n = t && a(t, "data-tooltip") || "", l = t && a(t, "data-tooltip-position") || window.getComputedStyle(t || document.body).getPropertyValue(O)?.trim() || "top";
|
|
24
25
|
(!n || n === "false" || n === "true" || l === "none") && (t = null), t && (o.textContent = n);
|
|
25
26
|
const E = e && a(e, s) === o?.id, b = (t instanceof HTMLElement ? t.innerText : t?.textContent)?.trim() || t?.hasAttribute(s) || t?.hasAttribute("aria-label");
|
|
26
|
-
e?.removeAttribute(E ? s : m), u(o, !1), e = t, e && a(e, b ? m : s, o?.id), e && o.hidePopover(), o.togglePopover(!!t), u(o, t || !1,
|
|
27
|
+
e?.removeAttribute(E ? s : m), u(o, !1), e = t, e && a(e, b ? m : s, o?.id), e && o.hidePopover(), o.togglePopover(!!t), u(o, t || !1, {
|
|
28
|
+
placement: l,
|
|
29
|
+
middleware: [L(), h({ padding: 10 })]
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
|
-
|
|
32
|
+
I(() => {
|
|
29
33
|
d(document, "blur,focus,mouseout,mouseover", c, r), d(window, "keydown", c, r), d(window, "blur", c, r);
|
|
30
34
|
});
|
|
31
35
|
//# sourceMappingURL=tooltip-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-observer.js","sources":["../../designsystem/tooltip/tooltip-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tanchorPosition,\n\tattr,\n\tIS_BROWSER,\n\ton,\n\tonLoaded,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst DESCRIBEDBY = \"aria-describedby\";\nconst ESC = \"Escape\";\nconst LABELLEDBY = \"aria-labelledby\";\nconst POSITION_CSS_PROPERTY = \"--mtds-tooltip-position\";\nconst THROTTLE_DELAY = 300;\nconst TOOLTIP = IS_BROWSER\n\t? Object.assign(document.createElement(\"div\"), {\n\t\t\tclassName: styles._tooltip,\n\t\t\tid: \"mtds-tooltip\",\n\t\t\tpopover: \"manual\",\n\t\t})\n\t: null; // Create a dummy element to avoid null checks\n\nlet ANCHOR: Element | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\n\nfunction
|
|
1
|
+
{"version":3,"file":"tooltip-observer.js","sources":["../../designsystem/tooltip/tooltip-observer.ts"],"sourcesContent":["import { flip, type Placement, shift } from \"@floating-ui/dom\";\nimport styles from \"../styles.module.css\";\nimport {\n\tanchorPosition,\n\tattr,\n\tIS_BROWSER,\n\ton,\n\tonLoaded,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst DESCRIBEDBY = \"aria-describedby\";\nconst ESC = \"Escape\";\nconst LABELLEDBY = \"aria-labelledby\";\nconst POSITION_CSS_PROPERTY = \"--mtds-tooltip-position\";\nconst THROTTLE_DELAY = 300;\nconst TOOLTIP = IS_BROWSER\n\t? Object.assign(document.createElement(\"div\"), {\n\t\t\tclassName: styles._tooltip,\n\t\t\tid: \"mtds-tooltip\",\n\t\t\tpopover: \"manual\",\n\t\t})\n\t: null; // Create a dummy element to avoid null checks\n\nlet ANCHOR: Element | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\n\nfunction handleTooltipMove({ target, type, key }: Event & { key?: string }) {\n\tif (type === \"keydown\" && key !== ESC) return; // Allow ESC dismiss to follow https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n\tconst wait = LAST_CALL + THROTTLE_DELAY - Date.now();\n\tclearTimeout(THROTTLE);\n\tTHROTTLE = setTimeout(\n\t\thandleTooltipMoveThrottled,\n\t\tMath.max(wait, 0),\n\t\tkey === ESC ? null : target,\n\t);\n}\n\n// Using a throttled function to avoid performance issues\nfunction handleTooltipMoveThrottled(target: Element | null) {\n\tLAST_CALL = Date.now();\n\n\t// Build and append tooltip if not existing\n\tif (!TOOLTIP || target === TOOLTIP) return; // Allow tooltip to be hovered, following https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\tlet anchor = target?.closest?.<Element>(\"[data-tooltip]\") || null;\n\n\t// No need to update\n\tif (anchor === ANCHOR) return;\n\n\tconst content = (anchor && attr(anchor, \"data-tooltip\")) || \"\";\n\tconst position =\n\t\t(anchor && attr(anchor, \"data-tooltip-position\")) ||\n\t\twindow\n\t\t\t.getComputedStyle(anchor || document.body)\n\t\t\t.getPropertyValue(POSITION_CSS_PROPERTY)\n\t\t\t?.trim() ||\n\t\t\"top\";\n\n\tconst isHidden =\n\t\t!content ||\n\t\tcontent === \"false\" ||\n\t\tcontent === \"true\" ||\n\t\tposition === \"none\";\n\n\tif (isHidden) anchor = null; // Do not show tooltip if boolish value\n\tif (anchor) TOOLTIP.textContent = content; // Only update content if new anchor\n\n\tconst hadLabel = ANCHOR && attr(ANCHOR, LABELLEDBY) === TOOLTIP?.id;\n\tconst hasLabel =\n\t\t(anchor instanceof HTMLElement\n\t\t\t? anchor.innerText\n\t\t\t: anchor?.textContent\n\t\t)?.trim() ||\n\t\tanchor?.hasAttribute(LABELLEDBY) ||\n\t\tanchor?.hasAttribute(\"aria-label\");\n\n\tANCHOR?.removeAttribute(hadLabel ? LABELLEDBY : DESCRIBEDBY); // Unlink previous anchor\n\tanchorPosition(TOOLTIP, false); // Reset anchor position\n\n\tANCHOR = anchor; // Store new anchor - might be null if no new anchor\n\tif (ANCHOR) attr(ANCHOR, hasLabel ? DESCRIBEDBY : LABELLEDBY, TOOLTIP?.id); // Use tooltip as description if allready has label\n\tif (ANCHOR) TOOLTIP.hidePopover(); // Hide tooltip so it can be placed on top-layer on next show\n\tTOOLTIP.togglePopover(!!anchor);\n\tanchorPosition(TOOLTIP, anchor || false, {\n\t\tplacement: position as Placement,\n\t\tmiddleware: [flip(), shift({ padding: 10 })],\n\t});\n}\n\nonLoaded(() => {\n\ton(document, \"blur,focus,mouseout,mouseover\", handleTooltipMove, QUICK_EVENT);\n\ton(window, \"keydown\", handleTooltipMove, QUICK_EVENT);\n\ton(window, \"blur\", handleTooltipMove, QUICK_EVENT);\n});\n"],"names":["DESCRIBEDBY","ESC","LABELLEDBY","POSITION_CSS_PROPERTY","THROTTLE_DELAY","TOOLTIP","IS_BROWSER","styles","ANCHOR","LAST_CALL","THROTTLE","handleTooltipMove","target","type","key","wait","handleTooltipMoveThrottled","anchor","content","attr","position","hadLabel","hasLabel","anchorPosition","flip","shift","onLoaded","on","QUICK_EVENT"],"mappings":";;;AAWA,MAAMA,IAAc,oBACdC,IAAM,UACNC,IAAa,mBACbC,IAAwB,2BACxBC,IAAiB,KACjBC,IAAUC,IACb,OAAO,OAAO,SAAS,cAAc,KAAK,GAAG;AAAA,EAC7C,WAAWC,EAAO;AAAA,EAClB,IAAI;AAAA,EACJ,SAAS;AACV,CAAC,IACA;AAEH,IAAIC,IAAyB,MACzBC,IAAY,OAAO,mBACnBC,IAAmD;AAEvD,SAASC,EAAkB,EAAE,QAAAC,GAAQ,MAAAC,GAAM,KAAAC,KAAiC;AAC3E,MAAID,MAAS,aAAaC,MAAQb,EAAK;AACvC,QAAMc,IAAON,IAAYL,IAAiB,KAAK,IAAA;AAC/C,eAAaM,CAAQ,GACrBA,IAAW;AAAA,IACVM;AAAA,IACA,KAAK,IAAID,GAAM,CAAC;AAAA,IAChBD,MAAQb,IAAM,OAAOW;AAAA,EAAA;AAEvB;AAGA,SAASI,EAA2BJ,GAAwB;AAI3D,MAHAH,IAAY,KAAK,IAAA,GAGb,CAACJ,KAAWO,MAAWP,EAAS;AACpC,EAAKA,GAAS,eAAa,SAAS,KAAK,OAAOA,CAAO;AACvD,MAAIY,IAASL,GAAQ,UAAmB,gBAAgB,KAAK;AAG7D,MAAIK,MAAWT,EAAQ;AAEvB,QAAMU,IAAWD,KAAUE,EAAKF,GAAQ,cAAc,KAAM,IACtDG,IACJH,KAAUE,EAAKF,GAAQ,uBAAuB,KAC/C,OACE,iBAAiBA,KAAU,SAAS,IAAI,EACxC,iBAAiBd,CAAqB,GACrC,UACH;AAQD,GALC,CAACe,KACDA,MAAY,WACZA,MAAY,UACZE,MAAa,YAEAH,IAAS,OACnBA,QAAgB,cAAcC;AAElC,QAAMG,IAAWb,KAAUW,EAAKX,GAAQN,CAAU,MAAMG,GAAS,IAC3DiB,KACJL,aAAkB,cAChBA,EAAO,YACPA,GAAQ,cACR,KAAA,KACHA,GAAQ,aAAaf,CAAU,KAC/Be,GAAQ,aAAa,YAAY;AAElC,EAAAT,GAAQ,gBAAgBa,IAAWnB,IAAaF,CAAW,GAC3DuB,EAAelB,GAAS,EAAK,GAE7BG,IAASS,GACLT,KAAQW,EAAKX,GAAQc,IAAWtB,IAAcE,GAAYG,GAAS,EAAE,GACrEG,OAAgB,YAAA,GACpBH,EAAQ,cAAc,CAAC,CAACY,CAAM,GAC9BM,EAAelB,GAASY,KAAU,IAAO;AAAA,IACxC,WAAWG;AAAA,IACX,YAAY,CAACI,EAAA,GAAQC,EAAM,EAAE,SAAS,IAAI,CAAC;AAAA,EAAA,CAC3C;AACF;AAEAC,EAAS,MAAM;AACd,EAAAC,EAAG,UAAU,iCAAiChB,GAAmBiB,CAAW,GAC5ED,EAAG,QAAQ,WAAWhB,GAAmBiB,CAAW,GACpDD,EAAG,QAAQ,QAAQhB,GAAmBiB,CAAW;AAClD,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sources":["../../designsystem/typography/typography.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type HeadingSizes = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingProps<As extends React.ElementType = \"h2\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-size\"?: HeadingSizes;\n\t\t\t\"data-justify\"?: \"start\" | \"center\";\n\t\t}\n\t>;\n\ntype HeadingComponent = <As extends React.ElementType = \"h2\">(\n\tprops: HeadingProps<As>,\n) => JSX.Element;\n\nexport const Heading: HeadingComponent = forwardRef<null>(function Heading<\n\tAs extends React.ElementType = \"h2\",\n>({ as, className, ...rest }: HeadingProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"h2\";\n\n\treturn (\n\t\t<Tag className={clsx(styles.heading, className)} ref={ref} {...rest} />\n\t);\n}) as HeadingComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type MutedProps<As extends React.ElementType = \"small\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype MutedComponent = <As extends React.ElementType = \"small\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Muted: MutedComponent = forwardRef<null>(function Muted<\n\tAs extends React.ElementType = \"small\",\n>({ as, className, ...rest }: MutedProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"small\";\n\treturn <Tag className={clsx(styles.muted, className)} ref={ref} {...rest} />;\n}) as MutedComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type IngressProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype IngressComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Ingress: IngressComponent = forwardRef<null>(function Ingress<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: IngressProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn (\n\t\t<Tag className={clsx(styles.ingress, className)} ref={ref} {...rest} />\n\t);\n}) as IngressComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type InfoProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype InfoComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Info: InfoComponent = forwardRef<null>(function Info<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: InfoProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn <Tag className={clsx(styles.info, className)} ref={ref} {...rest} />;\n}) as InfoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Heading","forwardRef","as","className","rest","ref","jsx","clsx","styles","Muted","Ingress","Info"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"typography.js","sources":["../../designsystem/typography/typography.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type HeadingSizes = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingProps<As extends React.ElementType = \"h2\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-size\"?: HeadingSizes;\n\t\t\t\"data-justify\"?: \"start\" | \"center\";\n\t\t}\n\t>;\n\ntype HeadingComponent = <As extends React.ElementType = \"h2\">(\n\tprops: HeadingProps<As>,\n) => JSX.Element;\n\nexport const Heading: HeadingComponent = forwardRef<null>(function Heading<\n\tAs extends React.ElementType = \"h2\",\n>({ as, className, ...rest }: HeadingProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"h2\";\n\n\treturn (\n\t\t<Tag className={clsx(styles.heading, className)} ref={ref} {...rest} />\n\t);\n}) as HeadingComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type MutedProps<As extends React.ElementType = \"small\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype MutedComponent = <As extends React.ElementType = \"small\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Muted: MutedComponent = forwardRef<null>(function Muted<\n\tAs extends React.ElementType = \"small\",\n>({ as, className, ...rest }: MutedProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"small\";\n\treturn <Tag className={clsx(styles.muted, className)} ref={ref} {...rest} />;\n}) as MutedComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type IngressProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype IngressComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Ingress: IngressComponent = forwardRef<null>(function Ingress<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: IngressProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn (\n\t\t<Tag className={clsx(styles.ingress, className)} ref={ref} {...rest} />\n\t);\n}) as IngressComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type InfoProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype InfoComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Info: InfoComponent = forwardRef<null>(function Info<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: InfoProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn <Tag className={clsx(styles.info, className)} ref={ref} {...rest} />;\n}) as InfoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Heading","forwardRef","as","className","rest","ref","jsx","clsx","styles","Muted","Ingress","Info"],"mappings":";;;;AAsBO,MAAMA,IAA4BC,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA0BC,GAA0B;AAGzE,SACC,gBAAAC,EAHWJ,KAAM,MAGhB,EAAI,WAAWK,EAAKC,EAAO,SAASL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAEvE,CAAC,GASYK,IAAwBR,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAwBC,GAA0B;AAEvE,SAAO,gBAAAC,EADKJ,KAAM,SACV,EAAI,WAAWK,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC3E,CAAC,GASYM,IAA4BT,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA0BC,GAA0B;AAEzE,SACC,gBAAAC,EAFWJ,KAAM,QAEhB,EAAI,WAAWK,EAAKC,EAAO,SAASL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAEvE,CAAC,GASYO,IAAsBV,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAuBC,GAA0B;AAEtE,SAAO,gBAAAC,EADKJ,KAAM,QACV,EAAI,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC;"}
|
package/mtds/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { computePosition } from '@floating-ui/dom';
|
|
1
2
|
export declare const QUICK_EVENT: {
|
|
2
3
|
capture: boolean;
|
|
3
4
|
passive: boolean;
|
|
@@ -34,19 +35,7 @@ declare global {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
export declare const onLoaded: (callback: () => void) => void;
|
|
37
|
-
|
|
38
|
-
* anchorPosition
|
|
39
|
-
* @param target The Element to position
|
|
40
|
-
* @param anchor The Element to use as anchor
|
|
41
|
-
*/
|
|
42
|
-
declare const POSITION: {
|
|
43
|
-
top: number;
|
|
44
|
-
right: number;
|
|
45
|
-
bottom: number;
|
|
46
|
-
left: number;
|
|
47
|
-
};
|
|
48
|
-
export type AnchorPosition = keyof typeof POSITION;
|
|
49
|
-
export declare function anchorPosition(target: HTMLElement, anchor: Element | false, place?: string | number, force?: boolean): boolean | undefined;
|
|
38
|
+
export declare function anchorPosition(target: HTMLElement, anchor: false | Element, options?: Parameters<typeof computePosition>[2]): void;
|
|
50
39
|
/**
|
|
51
40
|
* Speed up MutationObserver by debouncing and only running when page is visible
|
|
52
41
|
* @return new MutaionObserver
|
|
@@ -63,4 +52,3 @@ export declare const isInputLike: (el: unknown) => el is HTMLInputElement;
|
|
|
63
52
|
export declare const toCustomElementProps: ({ className, hidden, open, ...rest }: Record<string, unknown>, klass?: string) => {
|
|
64
53
|
[x: string]: unknown;
|
|
65
54
|
};
|
|
66
|
-
export {};
|
package/mtds/utils.js
CHANGED
|
@@ -1,96 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { autoUpdate as m, computePosition as l } from "./external/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
2
|
+
const $ = { capture: !0, passive: !0 }, p = typeof window < "u" && typeof document < "u";
|
|
3
|
+
function h(t, n) {
|
|
4
4
|
let e;
|
|
5
|
-
return (...
|
|
6
|
-
clearTimeout(e), e = setTimeout(() => t(...
|
|
5
|
+
return (...i) => {
|
|
6
|
+
clearTimeout(e), e = setTimeout(() => t(...i), n);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function A(t, n, e) {
|
|
10
10
|
return e === void 0 ? t.getAttribute(n) ?? null : (e === null ? t.removeAttribute(n) : t.getAttribute(n) !== e && t.setAttribute(n, e), null);
|
|
11
11
|
}
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
return t.id || (t.id = `${
|
|
12
|
+
let w = 0;
|
|
13
|
+
const E = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;
|
|
14
|
+
function C(t) {
|
|
15
|
+
return t.id || (t.id = `${E}${++w}`), t.id;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
for (const
|
|
19
|
-
e[0] =
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
17
|
+
const c = (t, n, [...e]) => {
|
|
18
|
+
for (const i of e[0].split(","))
|
|
19
|
+
e[0] = i, n[`${t}EventListener`](...e);
|
|
20
|
+
}, b = (t, ...n) => {
|
|
21
|
+
s && (t === window || t === document) && s.push(() => v(t, ...n)), c("add", t, n);
|
|
22
|
+
}, v = (t, ...n) => c("remove", t, n);
|
|
23
|
+
let s = null;
|
|
24
|
+
const S = (t) => {
|
|
25
|
+
if (!p) return;
|
|
26
26
|
window._mtdsUnbindEvents || (window._mtdsUnbindEvents = /* @__PURE__ */ new Map());
|
|
27
27
|
const n = () => requestAnimationFrame(() => {
|
|
28
28
|
const e = String(t).replace(/(\n|\s)/g, "");
|
|
29
|
-
window._mtdsUnbindEvents?.get(e)?.forEach((
|
|
29
|
+
window._mtdsUnbindEvents?.get(e)?.forEach((i) => {
|
|
30
|
+
i();
|
|
31
|
+
}), s = [], t(), window._mtdsUnbindEvents?.set(e, s?.slice(0)), s = null;
|
|
30
32
|
});
|
|
31
|
-
document.readyState === "complete" ? n() :
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Math.max(10, a - (c - p) / 2),
|
|
44
|
-
g - c - 10
|
|
45
|
-
), C = Math.min(
|
|
46
|
-
Math.max(10, d - (s - u) / 2),
|
|
47
|
-
v - s - 10
|
|
48
|
-
), W = a - c > 0, _ = a + p + c < g, $ = d - s > 0, I = d + u + s < v, T = i === r.top || i === r.bottom, B = i === r.right && (o || _) || !W, S = i === r.bottom && (o || I) || !$, D = Math.round(
|
|
49
|
-
T ? R : B ? a + p : a - c
|
|
50
|
-
), N = Math.round(
|
|
51
|
-
T ? S ? d + u : d - s : C
|
|
52
|
-
);
|
|
53
|
-
t.style.position = "absolute", t.style.left = `${D + M}px`, t.style.top = `${N + O}px`, l?.style.setProperty(
|
|
54
|
-
"translate",
|
|
55
|
-
`0px ${Math.round(S ? M + d + u + s + 30 : 0)}px`
|
|
33
|
+
document.readyState === "complete" ? n() : b(window, "load", n);
|
|
34
|
+
}, u = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
function y(t, n, e) {
|
|
36
|
+
u.get(t)?.(), u.delete(t), n && u.set(
|
|
37
|
+
t,
|
|
38
|
+
m(n, t, () => {
|
|
39
|
+
if (!t.isConnected || !n.isConnected || t.hidden)
|
|
40
|
+
return y(t, !1);
|
|
41
|
+
l(n, t, e).then(({ x: i, y: o }) => {
|
|
42
|
+
t.style.left = `${i}px`, t.style.top = `${o}px`;
|
|
43
|
+
});
|
|
44
|
+
})
|
|
56
45
|
);
|
|
57
46
|
}
|
|
58
|
-
function
|
|
47
|
+
function M(t) {
|
|
59
48
|
let n = 0;
|
|
60
|
-
const e = () => setTimeout(
|
|
61
|
-
t([],
|
|
62
|
-
},
|
|
49
|
+
const e = () => setTimeout(i, 200), i = () => {
|
|
50
|
+
t([], o), o.takeRecords(), n = 0;
|
|
51
|
+
}, o = new MutationObserver(() => {
|
|
63
52
|
n || (n = requestAnimationFrame(e));
|
|
64
53
|
});
|
|
65
|
-
return
|
|
54
|
+
return o;
|
|
66
55
|
}
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
if (t.isConnected &&
|
|
71
|
-
for (const
|
|
56
|
+
const d = /* @__PURE__ */ new WeakMap(), L = (t, n, e) => {
|
|
57
|
+
const i = t.getElementsByClassName(n), o = d.get(t) || [];
|
|
58
|
+
o.length || (d.set(t, o), M((T, f) => {
|
|
59
|
+
if (t.isConnected && o?.length)
|
|
60
|
+
for (const a of o) a();
|
|
72
61
|
else
|
|
73
|
-
|
|
62
|
+
f?.disconnect(), d.delete(t);
|
|
74
63
|
}).observe(t, {
|
|
75
64
|
attributeFilter: ["class", "hidden"],
|
|
76
65
|
attributes: !0,
|
|
77
66
|
childList: !0,
|
|
78
67
|
subtree: !0
|
|
79
|
-
})),
|
|
80
|
-
},
|
|
68
|
+
})), o.push(() => e(i));
|
|
69
|
+
}, _ = (t) => t instanceof HTMLElement && "validity" in t && !(t instanceof HTMLButtonElement), r = "aria-selected", I = ({ className: t, hidden: n, open: e, ...i }, o) => (i.suppressHydrationWarning = !0, i[r] !== void 0 && (i[r] = `${(i[r] || "false") !== "false"}`), (t || o) && (i.class = `${o} ${t}`.trim()), n && (i.hidden = !0), e && (i.open = !0), i);
|
|
81
70
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
p as IS_BROWSER,
|
|
72
|
+
$ as QUICK_EVENT,
|
|
73
|
+
y as anchorPosition,
|
|
74
|
+
A as attr,
|
|
75
|
+
M as createOptimizedMutationObserver,
|
|
76
|
+
h as debounce,
|
|
77
|
+
_ as isInputLike,
|
|
78
|
+
v as off,
|
|
79
|
+
b as on,
|
|
80
|
+
S as onLoaded,
|
|
81
|
+
L as onMutation,
|
|
82
|
+
I as toCustomElementProps,
|
|
83
|
+
C as useId
|
|
95
84
|
};
|
|
96
85
|
//# sourceMappingURL=utils.js.map
|