@mattilsynet/design 3.1.15 → 3.1.18
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/atlas/atlas-element.d.ts +1 -1
- package/mtds/atlas/atlas-element.js +41 -42
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-matgeo.d.ts +0 -1
- package/mtds/atlas/atlas-matgeo.js +20 -22
- package/mtds/atlas/atlas-matgeo.js.map +1 -1
- package/mtds/atlas.iife.js +4 -4
- package/mtds/card/card.d.ts +5 -5
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart.js +13 -12
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/details/details.js +9 -9
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog.js +8 -9
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/field/field.js +0 -1
- package/mtds/index.d.ts +1 -1
- package/mtds/index.iife.js +16 -196
- package/mtds/index.js +17 -35
- package/mtds/index.js.map +1 -1
- package/mtds/logo/logo.js +15 -7
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/print/print.d.ts +8 -0
- package/mtds/print/print.js +11 -0
- package/mtds/print/print.js.map +1 -0
- package/mtds/print/print.stories.d.ts +2 -0
- package/mtds/react.d.ts +1 -0
- package/mtds/react.js +30 -28
- package/mtds/react.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +45 -44
- package/mtds/styles.module.css.js +82 -80
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/tag/tag.js +14 -5
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/toast/toast.js +0 -1
- package/mtds/utils.d.ts +1 -1
- package/mtds/utils.js +7 -7
- package/mtds/utils.js.map +1 -1
- package/package.json +16 -14
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +0 -284
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +0 -1
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -201
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
- package/mtds/print/print.css.js +0 -185
- package/mtds/print/print.css.js.map +0 -1
package/mtds/styles.json
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"alert": "
|
|
3
|
-
"app": "
|
|
4
|
-
"sticky": "
|
|
5
|
-
"avatar": "
|
|
6
|
-
"badge": "
|
|
7
|
-
"breadcrumbs": "
|
|
8
|
-
"button": "
|
|
9
|
-
"card": "
|
|
10
|
-
"group": "
|
|
11
|
-
"chip": "
|
|
12
|
-
"details": "
|
|
13
|
-
"dialog": "
|
|
14
|
-
"divider": "
|
|
15
|
-
"errorsummary": "
|
|
16
|
-
"field": "
|
|
17
|
-
"suggestion": "
|
|
18
|
-
"affixes": "
|
|
19
|
-
"fieldset": "
|
|
20
|
-
"fileupload": "
|
|
21
|
-
"helptext": "
|
|
22
|
-
"input": "
|
|
23
|
-
"law": "
|
|
24
|
-
"grid": "
|
|
25
|
-
"flex": "
|
|
26
|
-
"link": "
|
|
27
|
-
"logo": "
|
|
28
|
-
"pagination": "
|
|
29
|
-
"popover": "
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
2
|
+
"alert": "_alert_jc0nn_1 _ds-alert_c9r86_3",
|
|
3
|
+
"app": "_app_jc0nn_1",
|
|
4
|
+
"sticky": "_sticky_jc0nn_1",
|
|
5
|
+
"avatar": "_avatar_jc0nn_1 _ds-avatar_c9r86_1",
|
|
6
|
+
"badge": "_badge_jc0nn_1",
|
|
7
|
+
"breadcrumbs": "_breadcrumbs_jc0nn_1 _ds-breadcrumbs_c9r86_5",
|
|
8
|
+
"button": "_button_jc0nn_1 _ds-button_c9r86_1",
|
|
9
|
+
"card": "_card_jc0nn_1",
|
|
10
|
+
"group": "_group_jc0nn_1",
|
|
11
|
+
"chip": "_chip_jc0nn_1 _ds-chip_c9r86_5",
|
|
12
|
+
"details": "_details_jc0nn_1 _ds-details_c9r86_3",
|
|
13
|
+
"dialog": "_dialog_jc0nn_1 _ds-dialog_c9r86_5",
|
|
14
|
+
"divider": "_divider_jc0nn_1",
|
|
15
|
+
"errorsummary": "_errorsummary_jc0nn_1 _ds-error-summary_c9r86_5",
|
|
16
|
+
"field": "_field_jc0nn_1 _ds-field_c9r86_1",
|
|
17
|
+
"suggestion": "_suggestion_jc0nn_1 _ds-suggestion_c9r86_5",
|
|
18
|
+
"affixes": "_affixes_jc0nn_1 _ds-field-affixes_c9r86_3",
|
|
19
|
+
"fieldset": "_fieldset_jc0nn_1 _ds-fieldset_c9r86_3",
|
|
20
|
+
"fileupload": "_fileupload_jc0nn_1",
|
|
21
|
+
"helptext": "_helptext_jc0nn_1 _ds-focus_c9r86_1",
|
|
22
|
+
"input": "_input_jc0nn_1 _ds-input_c9r86_1",
|
|
23
|
+
"law": "_law_jc0nn_1",
|
|
24
|
+
"grid": "_grid_jc0nn_1",
|
|
25
|
+
"flex": "_flex_jc0nn_1",
|
|
26
|
+
"link": "_link_jc0nn_1",
|
|
27
|
+
"logo": "_logo_jc0nn_1",
|
|
28
|
+
"pagination": "_pagination_jc0nn_1 _ds-pagination_c9r86_5",
|
|
29
|
+
"popover": "_popover_jc0nn_1 _ds-popover_c9r86_3",
|
|
30
|
+
"print": "_print_jc0nn_1",
|
|
31
|
+
"progress": "_progress_jc0nn_1",
|
|
32
|
+
"skeleton": "_skeleton_jc0nn_1 _ds-skeleton_c9r86_5",
|
|
33
|
+
"spinner": "_spinner_jc0nn_1",
|
|
34
|
+
"steps": "_steps_jc0nn_1",
|
|
35
|
+
"table": "_table_jc0nn_1 _ds-table_c9r86_5",
|
|
36
|
+
"tabs": "_tabs_jc0nn_1 _ds-tabs_c9r86_5",
|
|
37
|
+
"tag": "_tag_jc0nn_1 _ds-tag_c9r86_5",
|
|
38
|
+
"toast": "_toast_jc0nn_1",
|
|
39
|
+
"togglegroup": "_togglegroup_jc0nn_1 _ds-toggle-group_c9r86_5",
|
|
40
|
+
"heading": "_heading_jc0nn_1 _ds-heading_c9r86_1",
|
|
41
|
+
"ingress": "_ingress_jc0nn_1",
|
|
42
|
+
"muted": "_muted_jc0nn_1",
|
|
43
|
+
"info": "_info_jc0nn_1",
|
|
44
|
+
"prose": "_prose_jc0nn_1",
|
|
45
|
+
"validation": "_validation_jc0nn_1 _ds-validation-message_c9r86_1",
|
|
46
|
+
"body": "_body_jc0nn_162"
|
|
46
47
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const _ = "
|
|
1
|
+
const _ = "_alert_jc0nn_1 _ds-alert_c9r86_3", n = "_app_jc0nn_1", t = "_sticky_jc0nn_1", s = "_avatar_jc0nn_1 _ds-avatar_c9r86_1", o = "_badge_jc0nn_1", c = "_breadcrumbs_jc0nn_1 _ds-breadcrumbs_c9r86_5", e = "_button_jc0nn_1 _ds-button_c9r86_1", a = "_card_jc0nn_1", r = "_group_jc0nn_1", i = "_chip_jc0nn_1 _ds-chip_c9r86_5", d = "_details_jc0nn_1 _ds-details_c9r86_3", l = "_dialog_jc0nn_1 _ds-dialog_c9r86_5", p = "__drawer_jc0nn_1", g = "_divider_jc0nn_1", j = "_errorsummary_jc0nn_1 _ds-error-summary_c9r86_5", u = "_field_jc0nn_1 _ds-field_c9r86_1", f = "_suggestion_jc0nn_1 _ds-suggestion_c9r86_5", b = "_affixes_jc0nn_1 _ds-field-affixes_c9r86_3", m = "_fieldset_jc0nn_1 _ds-fieldset_c9r86_3", k = "_fileupload_jc0nn_1", h = "_helptext_jc0nn_1 _ds-focus_c9r86_1", v = "_input_jc0nn_1 _ds-input_c9r86_1", x = "_law_jc0nn_1", y = "_grid_jc0nn_1", w = "_flex_jc0nn_1", C = "_link_jc0nn_1", M = "_logo_jc0nn_1", O = "__logo_jc0nn_1", S = "_pagination_jc0nn_1 _ds-pagination_c9r86_5", T = "_popover_jc0nn_1 _ds-popover_c9r86_3", q = "_print_jc0nn_1", z = "_progress_jc0nn_1", A = "__indeterminate_jc0nn_1", B = "_skeleton_jc0nn_1 _ds-skeleton_c9r86_5", D = "__skeleton_jc0nn_1", E = "_spinner_jc0nn_1", F = "_steps_jc0nn_1", G = "_table_jc0nn_1 _ds-table_c9r86_5", H = "__scrollShadow_jc0nn_1", I = "_tabs_jc0nn_1 _ds-tabs_c9r86_5", J = "__scrollMask_jc0nn_1", K = "_tag_jc0nn_1 _ds-tag_c9r86_5", L = "_toast_jc0nn_1", N = "__toastClose_jc0nn_1", P = "__toastOpen_jc0nn_1", Q = "__toastTimeout_jc0nn_1", R = "_togglegroup_jc0nn_1 _ds-toggle-group_c9r86_5", U = "__tooltip_jc0nn_1 _ds-tooltip_c9r86_5", V = "_heading_jc0nn_1 _ds-heading_c9r86_1", W = "_ingress_jc0nn_1", X = "_muted_jc0nn_1", Y = "_info_jc0nn_1", Z = "_prose_jc0nn_1", $ = "_validation_jc0nn_1 _ds-validation-message_c9r86_1", __ = "_body_jc0nn_162", n_ = "__checked_jc0nn_1", t_ = {
|
|
2
2
|
alert: _,
|
|
3
|
-
app:
|
|
3
|
+
app: n,
|
|
4
4
|
sticky: t,
|
|
5
|
-
avatar:
|
|
6
|
-
badge:
|
|
7
|
-
breadcrumbs:
|
|
5
|
+
avatar: s,
|
|
6
|
+
badge: o,
|
|
7
|
+
breadcrumbs: c,
|
|
8
8
|
button: e,
|
|
9
|
-
card:
|
|
10
|
-
group:
|
|
11
|
-
chip:
|
|
12
|
-
details:
|
|
13
|
-
dialog:
|
|
9
|
+
card: a,
|
|
10
|
+
group: r,
|
|
11
|
+
chip: i,
|
|
12
|
+
details: d,
|
|
13
|
+
dialog: l,
|
|
14
14
|
_drawer: p,
|
|
15
15
|
divider: g,
|
|
16
|
-
errorsummary:
|
|
17
|
-
field:
|
|
18
|
-
suggestion:
|
|
19
|
-
affixes:
|
|
20
|
-
fieldset:
|
|
16
|
+
errorsummary: j,
|
|
17
|
+
field: u,
|
|
18
|
+
suggestion: f,
|
|
19
|
+
affixes: b,
|
|
20
|
+
fieldset: m,
|
|
21
21
|
fileupload: k,
|
|
22
22
|
helptext: h,
|
|
23
23
|
input: v,
|
|
@@ -29,88 +29,90 @@ const _ = "_alert_1d3iq_1 _ds-alert_s9m4f_3", s = "_app_1d3iq_1", t = "_sticky_1
|
|
|
29
29
|
_logo: O,
|
|
30
30
|
pagination: S,
|
|
31
31
|
popover: T,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
print: q,
|
|
33
|
+
progress: z,
|
|
34
|
+
_indeterminate: A,
|
|
35
|
+
skeleton: B,
|
|
36
|
+
_skeleton: D,
|
|
37
|
+
spinner: E,
|
|
38
|
+
steps: F,
|
|
39
|
+
table: G,
|
|
40
|
+
_scrollShadow: H,
|
|
41
|
+
tabs: I,
|
|
42
|
+
_scrollMask: J,
|
|
43
|
+
tag: K,
|
|
44
|
+
toast: L,
|
|
45
|
+
_toastClose: N,
|
|
46
|
+
_toastOpen: P,
|
|
47
|
+
_toastTimeout: Q,
|
|
48
|
+
togglegroup: R,
|
|
49
|
+
_tooltip: U,
|
|
50
|
+
heading: V,
|
|
51
|
+
ingress: W,
|
|
52
|
+
muted: X,
|
|
53
|
+
info: Y,
|
|
54
|
+
prose: Z,
|
|
55
|
+
validation: $,
|
|
56
|
+
body: __,
|
|
57
|
+
_checked: n_
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
n_ as _checked,
|
|
60
61
|
p as _drawer,
|
|
61
|
-
|
|
62
|
+
A as _indeterminate,
|
|
62
63
|
O as _logo,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
J as _scrollMask,
|
|
65
|
+
H as _scrollShadow,
|
|
66
|
+
D as _skeleton,
|
|
67
|
+
N as _toastClose,
|
|
68
|
+
P as _toastOpen,
|
|
69
|
+
Q as _toastTimeout,
|
|
70
|
+
U as _tooltip,
|
|
71
|
+
b as affixes,
|
|
71
72
|
_ as alert,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
n as app,
|
|
74
|
+
s as avatar,
|
|
75
|
+
o as badge,
|
|
76
|
+
__ as body,
|
|
77
|
+
c as breadcrumbs,
|
|
77
78
|
e as button,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
a as card,
|
|
80
|
+
i as chip,
|
|
81
|
+
t_ as default,
|
|
82
|
+
d as details,
|
|
83
|
+
l as dialog,
|
|
83
84
|
g as divider,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
j as errorsummary,
|
|
86
|
+
u as field,
|
|
87
|
+
m as fieldset,
|
|
87
88
|
k as fileupload,
|
|
88
89
|
w as flex,
|
|
89
90
|
y as grid,
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
r as group,
|
|
92
|
+
V as heading,
|
|
92
93
|
h as helptext,
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
Y as info,
|
|
95
|
+
W as ingress,
|
|
95
96
|
v as input,
|
|
96
97
|
x as law,
|
|
97
98
|
C as link,
|
|
98
99
|
M as logo,
|
|
99
|
-
|
|
100
|
+
X as muted,
|
|
100
101
|
S as pagination,
|
|
101
102
|
T as popover,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
E as
|
|
103
|
+
q as print,
|
|
104
|
+
z as progress,
|
|
105
|
+
Z as prose,
|
|
106
|
+
B as skeleton,
|
|
107
|
+
E as spinner,
|
|
108
|
+
F as steps,
|
|
107
109
|
t as sticky,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
f as suggestion,
|
|
111
|
+
G as table,
|
|
112
|
+
I as tabs,
|
|
113
|
+
K as tag,
|
|
114
|
+
L as toast,
|
|
115
|
+
R as togglegroup,
|
|
116
|
+
$ as validation
|
|
115
117
|
};
|
|
116
118
|
//# sourceMappingURL=styles.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/mtds/tag/tag.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import i from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import p from "../styles.module.css.js";
|
|
5
|
-
const x = n(function({ as: r, className:
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
5
|
+
const x = n(function({ as: r, className: a, "data-tooltip": o, ...t }, m) {
|
|
6
|
+
const f = r || (t.href ? "a" : "span");
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
8
|
+
f,
|
|
9
|
+
{
|
|
10
|
+
className: i(p.tag, a),
|
|
11
|
+
"data-tooltip": o,
|
|
12
|
+
tabIndex: o ? 0 : void 0,
|
|
13
|
+
ref: m,
|
|
14
|
+
...t
|
|
15
|
+
}
|
|
16
|
+
);
|
|
8
17
|
});
|
|
9
18
|
export {
|
|
10
19
|
x as Tag
|
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<\n\tAs,\n\t{ \"data-icon\"?: boolean | \"true\" | \"false\" | \"none\" }\n>;\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
|
|
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<\n\tAs,\n\t{ \"data-icon\"?: boolean | \"true\" | \"false\" | \"none\" }\n>;\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>(\n\t{ as, className, \"data-tooltip\": dataTooltip, ...rest }: TagProps<Href, As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn (\n\t\t<Tag\n\t\t\tclassName={clsx(styles.tag, className)}\n\t\t\tdata-tooltip={dataTooltip}\n\t\t\ttabIndex={dataTooltip ? 0 : undefined}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as TagComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Tag","forwardRef","as","className","dataTooltip","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAuBO,MAAMA,IAAoBC,EAAiB,SAIjD,EAAE,IAAAC,GAAI,WAAAC,GAAW,gBAAgBC,GAAa,GAAGC,EAAA,GACjDC,GACC;AACD,QAAMN,IAAME,MAAOG,EAAK,OAAO,MAAM;AAErC,SACC,gBAAAE;AAAA,IAACP;AAAAA,IAAA;AAAA,MACA,WAAWQ,EAAKC,EAAO,KAAKN,CAAS;AAAA,MACrC,gBAAcC;AAAA,MACd,UAAUA,IAAc,IAAI;AAAA,MAC5B,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
package/mtds/toast/toast.js
CHANGED
package/mtds/utils.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const onMutation: (el: Node, callback: (observer: MutationObserve
|
|
|
47
47
|
export declare const toCustomElementProps: <T extends Record<string, unknown>>(rest: T, klass?: string) => T & {
|
|
48
48
|
suppressHydrationWarning: boolean;
|
|
49
49
|
"aria-selected": boolean | undefined;
|
|
50
|
-
class: string;
|
|
50
|
+
class: string | undefined;
|
|
51
51
|
hidden: boolean;
|
|
52
52
|
open: boolean;
|
|
53
53
|
};
|
package/mtds/utils.js
CHANGED
|
@@ -30,12 +30,12 @@ const l = (e, t, o) => o === void 0 ? e.getAttribute(t) ?? null : (o === null ?
|
|
|
30
30
|
n || (n = requestAnimationFrame(s));
|
|
31
31
|
});
|
|
32
32
|
return d.observe(e, o), s(), i;
|
|
33
|
-
}, c = "aria-selected",
|
|
33
|
+
}, c = "aria-selected", v = (e, t) => Object.assign({}, e, {
|
|
34
34
|
suppressHydrationWarning: !0,
|
|
35
35
|
// Make Next.js happy
|
|
36
36
|
[c]: e[c] === void 0 ? void 0 : `${(e[c] || "false") !== "false"}`,
|
|
37
37
|
// Ensure aria-selected boolean is string
|
|
38
|
-
class: u(t, e.className),
|
|
38
|
+
class: u(t, e.className) || void 0,
|
|
39
39
|
// Use class instead of className
|
|
40
40
|
hidden: !!e.hidden,
|
|
41
41
|
// Ensure boolean prop behaviour
|
|
@@ -45,21 +45,21 @@ const l = (e, t, o) => o === void 0 ? e.getAttribute(t) ?? null : (o === null ?
|
|
|
45
45
|
const n = document.createElement(e);
|
|
46
46
|
if (o && (n.textContent = o), t) for (const [s, i] of Object.entries(t)) l(n, s, i);
|
|
47
47
|
return n;
|
|
48
|
-
},
|
|
49
|
-
} : HTMLElement,
|
|
48
|
+
}, R = typeof HTMLElement > "u" ? class {
|
|
49
|
+
} : HTMLElement, g = (e, t) => !r() || window.customElements.get(e) || window.customElements.define(e, t), w = typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets, H = (e, t) => {
|
|
50
50
|
if (!w) return;
|
|
51
51
|
e.shadowRoot || e.attachShadow({ mode: "open" }).append(m("slot"));
|
|
52
52
|
const o = new CSSStyleSheet();
|
|
53
53
|
o.replaceSync(t), e.shadowRoot.adoptedStyleSheets = [o];
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
R as MTDSElement,
|
|
57
57
|
E as QUICK_EVENT,
|
|
58
58
|
w as SUPPORTS_CONSTRUCTED_CSS,
|
|
59
59
|
H as attachStyle,
|
|
60
60
|
l as attr,
|
|
61
61
|
h as debounce,
|
|
62
|
-
|
|
62
|
+
g as defineElement,
|
|
63
63
|
C as getByCSSModule,
|
|
64
64
|
r as isBrowser,
|
|
65
65
|
f as off,
|
|
@@ -67,6 +67,6 @@ export {
|
|
|
67
67
|
T as onHotReload,
|
|
68
68
|
b as onMutation,
|
|
69
69
|
m as tag,
|
|
70
|
-
|
|
70
|
+
v as toCustomElementProps
|
|
71
71
|
};
|
|
72
72
|
//# sourceMappingURL=utils.js.map
|
package/mtds/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../designsystem/utils.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport styles from \"./styles.module.css\";\n\nexport const QUICK_EVENT = { capture: true, passive: true };\nexport const isBrowser = () =>\n\ttypeof window !== \"undefined\" && typeof document !== \"undefined\"; // Using function to play nice with Vitest where DOM can come and go\n\nexport const getByCSSModule = (key: string) =>\n\tisBrowser() ? document.getElementsByClassName(styles[key].split(\" \")[0]) : [];\n\nexport function debounce<T extends unknown[]>(\n\tcallback: (...args: T) => void,\n\tdelay: number,\n) {\n\tlet timer: ReturnType<typeof setTimeout>;\n\n\treturn function (this: unknown, ...args: T) {\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => callback.apply(this, args), delay);\n\t};\n}\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to read/write attributes from\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport const attr = (\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null => {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n};\n\n/**\n * on\n * @param el The Element to use as EventTarget\n * @param types A space separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\tel: Node | Window | ShadowRoot,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): (() => void) => {\n\tconst [types, ...options] = rest;\n\tfor (const type of types.split(\" \")) el.addEventListener(type, ...options);\n\treturn () => off(el, ...rest);\n};\n\n/**\n * off\n * @param el The Element to use as EventTarget\n * @param types A space separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\tel: Node | Window | ShadowRoot,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => {\n\tconst [types, ...options] = rest;\n\tfor (const type of types.split(\" \")) el.removeEventListener(type, ...options);\n};\n\ndeclare global {\n\tinterface Window {\n\t\t_mtdsHotReloadCleanup?: Map<string, Array<() => void>>;\n\t}\n}\n\n/**\n * onHotReload\n * @description Runs a callback when window is loaded in browser, and ensures cleanup when hot-reloading\n * @param key The key to identify setup and corresponding cleanup\n * @param callback The callback to run when the page is ready\n */\nexport const onHotReload = (key: string, setup: () => Array<() => void>) => {\n\tif (!isBrowser()) return; // Skip if not in modern browser environment, but on each call as Vitest might have unloaded jsdom between tests\n\tif (!window._mtdsHotReloadCleanup) window._mtdsHotReloadCleanup = new Map(); // Hot reload cleanup support supporting all build tools\n\n\tconst run = () => {\n\t\twindow._mtdsHotReloadCleanup?.get(key)?.map((cleanup) => cleanup()); // Run previous cleanup\n\t\twindow._mtdsHotReloadCleanup?.set(key, setup()); // Store new cleanup\n\t};\n\n\tif (document.readyState !== \"complete\") on(window, \"load\", run);\n\telse document.fonts?.ready?.then(run) || setTimeout(run, 0); // Prefer fonts ready promise if available, but fallback to setTimeout\n};\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport const onMutation = (\n\tel: Node,\n\tcallback: (observer: MutationObserver) => void,\n\toptions: MutationObserverInit,\n) => {\n\tlet queue = 0;\n\tconst onFrame = () => {\n\t\tif (!el.isConnected) return cleanup(); // Disconnect if element is removed from DOM\n\t\tcallback(observer);\n\t\tobserver.takeRecords(); // Clear records to avoid multiple triggers\n\t\tqueue = 0;\n\t};\n\tconst cleanup = () => observer?.disconnect?.();\n\tconst observer = new MutationObserver(() => {\n\t\tif (!queue) queue = requestAnimationFrame(onFrame); // requestAnimationFrame only runs when page is visible\n\t});\n\n\tobserver.observe(el, options);\n\tonFrame(); // Initial run\n\treturn cleanup;\n};\n\n/**\n * toCustomElementProps\n * @description Utility to quickly convert props to custom element attributes\n * @param props The props to convert\n * @returns The converted props\n */\nconst SELECTED = \"aria-selected\";\nexport const toCustomElementProps = <T extends Record<string, unknown>>(\n\trest: T,\n\tklass?: string,\n) =>\n\tObject.assign({}, rest, {\n\t\tsuppressHydrationWarning: true, // Make Next.js happy\n\t\t[SELECTED]:\n\t\t\trest[SELECTED] === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (`${(rest[SELECTED] || \"false\") !== \"false\"}` as unknown as boolean), // Ensure aria-selected boolean is string\n\t\tclass: clsx(klass, rest.className as string), // Use class instead of className\n\t\thidden: !!rest.hidden, // Ensure boolean prop behaviour\n\t\topen: !!rest.open, // Ensure boolean prop behaviour\n\t});\n\n/**\n * tag\n * @description creates element and assigns properties\n * @param tagName The tagname of element to create\n * @param attrs Optional attributes to add to the element\n * @param text Optional text content to add to the element\n * @return HTMLElement with props\n */\nexport const tag = <TagName extends keyof HTMLElementTagNameMap>(\n\ttagName: TagName,\n\tattrs?: Record<string, string | null> | null,\n\ttext?: string | null,\n): HTMLElementTagNameMap[TagName] => {\n\tconst el = document.createElement(tagName);\n\tif (text) el.textContent = text;\n\tif (attrs) for (const [key, val] of Object.entries(attrs)) attr(el, key, val);\n\treturn el;\n};\n\n// Make sure we have a HTMLElement to extend (for server side rendering)\nexport const MTDSElement =\n\ttypeof HTMLElement === \"undefined\"\n\t\t? (class {} as typeof HTMLElement)\n\t\t: HTMLElement;\n\n/**\n * defineElement\n * @description Defines a customElement if running in browser and if not already registered\n */\nexport const defineElement = (\n\tname: string,\n\tinstance: CustomElementConstructor,\n) =>\n\t!isBrowser() ||\n\twindow.customElements.get(name) ||\n\twindow.customElements.define(name, instance);\n\n/**\n * attachStyle\n * @param el The Element to scope styles for\n * @param css The css to inject\n */\nexport const SUPPORTS_CONSTRUCTED_CSS =\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets;\n\nexport const attachStyle = (el: Element, css: string) => {\n\tif (!SUPPORTS_CONSTRUCTED_CSS) return;\n\tif (!el.shadowRoot) el.attachShadow({ mode: \"open\" }).append(tag(\"slot\"));\n\n\tconst sheet = new CSSStyleSheet();\n\tsheet.replaceSync(css);\n\t(el.shadowRoot as ShadowRoot).adoptedStyleSheets = [sheet];\n};\n"],"names":["QUICK_EVENT","isBrowser","getByCSSModule","key","styles","debounce","callback","delay","timer","args","attr","el","name","value","on","rest","types","options","type","off","onHotReload","setup","run","cleanup","onMutation","queue","onFrame","observer","SELECTED","toCustomElementProps","klass","clsx","tag","tagName","attrs","text","val","MTDSElement","defineElement","instance","SUPPORTS_CONSTRUCTED_CSS","attachStyle","css","sheet"],"mappings":";;AAGO,MAAMA,IAAc,EAAE,SAAS,IAAM,SAAS,GAAA,GACxCC,IAAY,MACxB,OAAO,SAAW,OAAe,OAAO,WAAa,KAEzCC,IAAiB,CAACC,MAC9BF,EAAA,IAAc,SAAS,uBAAuBG,EAAOD,CAAG,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;AAErE,SAASE,EACfC,GACAC,GACC;AACD,MAAIC;AAEJ,SAAO,YAA4BC,GAAS;AAC3C,iBAAaD,CAAK,GAClBA,IAAQ,WAAW,MAAMF,EAAS,MAAM,MAAMG,CAAI,GAAGF,CAAK;AAAA,EAC3D;AACD;AASO,MAAMG,IAAO,CACnBC,GACAC,GACAC,MAEIA,MAAU,SAAkBF,EAAG,aAAaC,CAAI,KAAK,QACrDC,MAAU,OAAMF,EAAG,gBAAgBC,CAAI,IAClCD,EAAG,aAAaC,CAAI,MAAMC,KAAOF,EAAG,aAAaC,GAAMC,CAAK,GAC9D,OASKC,IAAK,CACjBH,MACGI,MACe;AAClB,QAAM,CAACC,GAAO,GAAGC,CAAO,IAAIF;AAC5B,aAAWG,KAAQF,EAAM,MAAM,GAAG,EAAG,CAAAL,EAAG,iBAAiBO,GAAM,GAAGD,CAAO;AACzE,SAAO,MAAME,EAAIR,GAAI,GAAGI,CAAI;AAC7B,GAQaI,IAAM,CAClBR,MACGI,MACO;AACV,QAAM,CAACC,GAAO,GAAGC,CAAO,IAAIF;AAC5B,aAAWG,KAAQF,EAAM,MAAM,GAAG,EAAG,CAAAL,EAAG,oBAAoBO,GAAM,GAAGD,CAAO;AAC7E,GAcaG,IAAc,CAACjB,GAAakB,MAAmC;AAC3E,MAAI,CAACpB,IAAa;AAClB,EAAK,OAAO,0BAAuB,OAAO,4CAA4B,IAAA;AAEtE,QAAMqB,IAAM,MAAM;AACjB,WAAO,uBAAuB,IAAInB,CAAG,GAAG,IAAI,CAACoB,MAAYA,GAAS,GAClE,OAAO,uBAAuB,IAAIpB,GAAKkB,EAAA,CAAO;AAAA,EAC/C;AAEA,EAAI,SAAS,eAAe,aAAYP,EAAG,QAAQ,QAAQQ,CAAG,IACzD,SAAS,OAAO,OAAO,KAAKA,CAAG,KAAK,WAAWA,GAAK,CAAC;AAC3D,GAMaE,IAAa,CACzBb,GACAL,GACAW,MACI;AACJ,MAAIQ,IAAQ;AACZ,QAAMC,IAAU,MAAM;AACrB,QAAI,CAACf,EAAG,YAAa,QAAOY,EAAA;AAC5B,IAAAjB,EAASqB,CAAQ,GACjBA,EAAS,YAAA,GACTF,IAAQ;AAAA,EACT,GACMF,IAAU,MAAMI,GAAU,aAAA,GAC1BA,IAAW,IAAI,iBAAiB,MAAM;AAC3C,IAAKF,MAAOA,IAAQ,sBAAsBC,CAAO;AAAA,EAClD,CAAC;AAED,SAAAC,EAAS,QAAQhB,GAAIM,CAAO,GAC5BS,EAAA,GACOH;AACR,GAQMK,IAAW,iBACJC,IAAuB,CACnCd,GACAe,MAEA,OAAO,OAAO,CAAA,GAAIf,GAAM;AAAA,EACvB,0BAA0B;AAAA;AAAA,EAC1B,CAACa,CAAQ,GACRb,EAAKa,CAAQ,MAAM,SAChB,SACC,IAAIb,EAAKa,CAAQ,KAAK,aAAa,OAAO;AAAA;AAAA,EAC/C,OAAOG,EAAKD,GAAOf,EAAK,SAAmB;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../designsystem/utils.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport styles from \"./styles.module.css\";\n\nexport const QUICK_EVENT = { capture: true, passive: true };\nexport const isBrowser = () =>\n\ttypeof window !== \"undefined\" && typeof document !== \"undefined\"; // Using function to play nice with Vitest where DOM can come and go\n\nexport const getByCSSModule = (key: string) =>\n\tisBrowser() ? document.getElementsByClassName(styles[key].split(\" \")[0]) : [];\n\nexport function debounce<T extends unknown[]>(\n\tcallback: (...args: T) => void,\n\tdelay: number,\n) {\n\tlet timer: ReturnType<typeof setTimeout>;\n\n\treturn function (this: unknown, ...args: T) {\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => callback.apply(this, args), delay);\n\t};\n}\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to read/write attributes from\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport const attr = (\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null => {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n};\n\n/**\n * on\n * @param el The Element to use as EventTarget\n * @param types A space separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\tel: Node | Window | ShadowRoot,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): (() => void) => {\n\tconst [types, ...options] = rest;\n\tfor (const type of types.split(\" \")) el.addEventListener(type, ...options);\n\treturn () => off(el, ...rest);\n};\n\n/**\n * off\n * @param el The Element to use as EventTarget\n * @param types A space separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\tel: Node | Window | ShadowRoot,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => {\n\tconst [types, ...options] = rest;\n\tfor (const type of types.split(\" \")) el.removeEventListener(type, ...options);\n};\n\ndeclare global {\n\tinterface Window {\n\t\t_mtdsHotReloadCleanup?: Map<string, Array<() => void>>;\n\t}\n}\n\n/**\n * onHotReload\n * @description Runs a callback when window is loaded in browser, and ensures cleanup when hot-reloading\n * @param key The key to identify setup and corresponding cleanup\n * @param callback The callback to run when the page is ready\n */\nexport const onHotReload = (key: string, setup: () => Array<() => void>) => {\n\tif (!isBrowser()) return; // Skip if not in modern browser environment, but on each call as Vitest might have unloaded jsdom between tests\n\tif (!window._mtdsHotReloadCleanup) window._mtdsHotReloadCleanup = new Map(); // Hot reload cleanup support supporting all build tools\n\n\tconst run = () => {\n\t\twindow._mtdsHotReloadCleanup?.get(key)?.map((cleanup) => cleanup()); // Run previous cleanup\n\t\twindow._mtdsHotReloadCleanup?.set(key, setup()); // Store new cleanup\n\t};\n\n\tif (document.readyState !== \"complete\") on(window, \"load\", run);\n\telse document.fonts?.ready?.then(run) || setTimeout(run, 0); // Prefer fonts ready promise if available, but fallback to setTimeout\n};\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport const onMutation = (\n\tel: Node,\n\tcallback: (observer: MutationObserver) => void,\n\toptions: MutationObserverInit,\n) => {\n\tlet queue = 0;\n\tconst onFrame = () => {\n\t\tif (!el.isConnected) return cleanup(); // Disconnect if element is removed from DOM\n\t\tcallback(observer);\n\t\tobserver.takeRecords(); // Clear records to avoid multiple triggers\n\t\tqueue = 0;\n\t};\n\tconst cleanup = () => observer?.disconnect?.();\n\tconst observer = new MutationObserver(() => {\n\t\tif (!queue) queue = requestAnimationFrame(onFrame); // requestAnimationFrame only runs when page is visible\n\t});\n\n\tobserver.observe(el, options);\n\tonFrame(); // Initial run\n\treturn cleanup;\n};\n\n/**\n * toCustomElementProps\n * @description Utility to quickly convert props to custom element attributes\n * @param props The props to convert\n * @returns The converted props\n */\nconst SELECTED = \"aria-selected\";\nexport const toCustomElementProps = <T extends Record<string, unknown>>(\n\trest: T,\n\tklass?: string,\n) =>\n\tObject.assign({}, rest, {\n\t\tsuppressHydrationWarning: true, // Make Next.js happy\n\t\t[SELECTED]:\n\t\t\trest[SELECTED] === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (`${(rest[SELECTED] || \"false\") !== \"false\"}` as unknown as boolean), // Ensure aria-selected boolean is string\n\t\tclass: clsx(klass, rest.className as string) || undefined, // Use class instead of className\n\t\thidden: !!rest.hidden, // Ensure boolean prop behaviour\n\t\topen: !!rest.open, // Ensure boolean prop behaviour\n\t});\n\n/**\n * tag\n * @description creates element and assigns properties\n * @param tagName The tagname of element to create\n * @param attrs Optional attributes to add to the element\n * @param text Optional text content to add to the element\n * @return HTMLElement with props\n */\nexport const tag = <TagName extends keyof HTMLElementTagNameMap>(\n\ttagName: TagName,\n\tattrs?: Record<string, string | null> | null,\n\ttext?: string | null,\n): HTMLElementTagNameMap[TagName] => {\n\tconst el = document.createElement(tagName);\n\tif (text) el.textContent = text;\n\tif (attrs) for (const [key, val] of Object.entries(attrs)) attr(el, key, val);\n\treturn el;\n};\n\n// Make sure we have a HTMLElement to extend (for server side rendering)\nexport const MTDSElement =\n\ttypeof HTMLElement === \"undefined\"\n\t\t? (class {} as typeof HTMLElement)\n\t\t: HTMLElement;\n\n/**\n * defineElement\n * @description Defines a customElement if running in browser and if not already registered\n */\nexport const defineElement = (\n\tname: string,\n\tinstance: CustomElementConstructor,\n) =>\n\t!isBrowser() ||\n\twindow.customElements.get(name) ||\n\twindow.customElements.define(name, instance);\n\n/**\n * attachStyle\n * @param el The Element to scope styles for\n * @param css The css to inject\n */\nexport const SUPPORTS_CONSTRUCTED_CSS =\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets;\n\nexport const attachStyle = (el: Element, css: string) => {\n\tif (!SUPPORTS_CONSTRUCTED_CSS) return;\n\tif (!el.shadowRoot) el.attachShadow({ mode: \"open\" }).append(tag(\"slot\"));\n\n\tconst sheet = new CSSStyleSheet();\n\tsheet.replaceSync(css);\n\t(el.shadowRoot as ShadowRoot).adoptedStyleSheets = [sheet];\n};\n"],"names":["QUICK_EVENT","isBrowser","getByCSSModule","key","styles","debounce","callback","delay","timer","args","attr","el","name","value","on","rest","types","options","type","off","onHotReload","setup","run","cleanup","onMutation","queue","onFrame","observer","SELECTED","toCustomElementProps","klass","clsx","tag","tagName","attrs","text","val","MTDSElement","defineElement","instance","SUPPORTS_CONSTRUCTED_CSS","attachStyle","css","sheet"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattilsynet/design",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,42 +54,44 @@
|
|
|
54
54
|
"storybook:build": "npm run build && storybook build"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "2.4.
|
|
58
|
-
"@digdir/designsystemet-css": "^1.
|
|
59
|
-
"@digdir/designsystemet-types": "^1.
|
|
60
|
-
"@handsontable/react-wrapper": "
|
|
57
|
+
"@biomejs/biome": "2.4.8",
|
|
58
|
+
"@digdir/designsystemet-css": "^1.13.0",
|
|
59
|
+
"@digdir/designsystemet-types": "^1.13.0",
|
|
60
|
+
"@handsontable/react-wrapper": "17.0.1",
|
|
61
61
|
"@phosphor-icons/core": "^2.1.1",
|
|
62
62
|
"@phosphor-icons/react": "^2.1.10",
|
|
63
|
-
"@storybook/addon-docs": "^10.
|
|
64
|
-
"@storybook/addon-themes": "^10.
|
|
65
|
-
"@storybook/react-vite": "^10.
|
|
63
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
64
|
+
"@storybook/addon-themes": "^10.3.3",
|
|
65
|
+
"@storybook/react-vite": "^10.3.3",
|
|
66
66
|
"@tanstack/react-table": "^8.21.3",
|
|
67
67
|
"@turf/boolean-point-in-polygon": "^7.3.4",
|
|
68
68
|
"@turf/helpers": "^7.3.4",
|
|
69
69
|
"@types/leaflet": "^1.9.21",
|
|
70
70
|
"@types/leaflet.markercluster": "^1.5.6",
|
|
71
|
-
"@types/node": "^25.
|
|
71
|
+
"@types/node": "^25.5.0",
|
|
72
72
|
"@types/react": "^19.2.14",
|
|
73
73
|
"@types/react-dom": "^19.2.3",
|
|
74
|
-
"@vitejs/plugin-react": "^5.
|
|
74
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
75
75
|
"fast-glob": "^3.3.3",
|
|
76
|
-
"handsontable": "
|
|
76
|
+
"handsontable": "17.0.1",
|
|
77
77
|
"leaflet": "^2.0.0-alpha.1",
|
|
78
78
|
"postcss": "^8.5.8",
|
|
79
79
|
"postcss-nesting": "^14.0.0",
|
|
80
80
|
"react": "^19.2.4",
|
|
81
81
|
"react-dom": "^19.2.4",
|
|
82
82
|
"react-moveable": "^0.56.0",
|
|
83
|
-
"storybook": "^10.
|
|
84
|
-
"typescript": "^
|
|
83
|
+
"storybook": "^10.3.3",
|
|
84
|
+
"typescript": "^6.0.2",
|
|
85
85
|
"vite": "^7.3.1",
|
|
86
86
|
"vite-plugin-dts": "^4.5.4"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@digdir/designsystemet-web": "^1.
|
|
89
|
+
"@digdir/designsystemet-web": "^1.13.0",
|
|
90
|
+
"@u-elements/u-combobox": "^1.0.7",
|
|
90
91
|
"@u-elements/u-datalist": "^1.1.0",
|
|
91
92
|
"@u-elements/u-details": "^0.2.2",
|
|
92
93
|
"@u-elements/u-progress": "^0.0.7",
|
|
94
|
+
"@u-elements/u-tabs": "^0.1.2",
|
|
93
95
|
"clsx": "^2.1.1"
|
|
94
96
|
},
|
|
95
97
|
"overrides": {
|