@mattilsynet/design 3.3.2 → 3.3.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.stories.d.ts +1 -1
- package/mtds/app/app.d.ts +1 -1
- package/mtds/app/app.stories.d.ts +1 -1
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/avatar/avatar.stories.d.ts +1 -1
- package/mtds/badge/badge.stories.d.ts +1 -1
- package/mtds/breadcrumbs/breadcrumbs.stories.d.ts +1 -1
- package/mtds/button/button.stories.d.ts +1 -1
- package/mtds/card/card.stories.d.ts +1 -1
- package/mtds/chart/chart.stories.d.ts +1 -1
- package/mtds/chip/chip.stories.d.ts +1 -1
- package/mtds/errorsummary/errorsummary.stories.d.ts +1 -1
- package/mtds/field/field.stories.d.ts +1 -1
- package/mtds/index.iife.js +2 -2
- package/mtds/input/input.stories.d.ts +1 -1
- package/mtds/law/law.stories.d.ts +1 -1
- package/mtds/layout/layout.stories.d.ts +1 -1
- package/mtds/logo/logo.stories.d.ts +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.stories.d.ts +1 -1
- package/mtds/print/print.stories.d.ts +1 -1
- package/mtds/progress/progress.stories.d.ts +1 -1
- package/mtds/spinner/spinner.stories.d.ts +1 -1
- package/mtds/steps/steps.stories.d.ts +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/table/table-observer.js +7 -10
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.stories.d.ts +1 -1
- package/mtds/tag/tag.stories.d.ts +1 -1
- package/mtds/toast/toast.stories.d.ts +1 -1
- package/mtds/tokens.d.ts +3 -3
- package/mtds/tooltip/tooltip.stories.d.ts +1 -1
- package/mtds/typography/typography.stories.d.ts +1 -1
- package/package.json +8 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isBrowser as
|
|
2
|
-
const
|
|
1
|
+
import { isBrowser as i, debounce as b, attr as a, onHotReload as u, onMutation as f } from "../utils.js";
|
|
2
|
+
const r = /* @__PURE__ */ new WeakSet(), m = i() ? document.getElementsByTagName("table") : [], l = i() && window.ResizeObserver ? new ResizeObserver(b(c, 200)) : null;
|
|
3
3
|
function c(e) {
|
|
4
4
|
for (const { target: t, contentRect: o } of e)
|
|
5
|
-
if (!t.isConnected)
|
|
5
|
+
if (!t.isConnected) r.delete(t) && l?.unobserve(t);
|
|
6
6
|
else {
|
|
7
7
|
const n = t.getAttribute("data-mobile-source") === "self" ? o.width : window.innerWidth, d = Number(t.getAttribute("data-mobile-size")) || 768;
|
|
8
8
|
a(t, "data-mobile-active", n < d ? "" : null);
|
|
@@ -11,14 +11,11 @@ function c(e) {
|
|
|
11
11
|
function w() {
|
|
12
12
|
for (const e of m)
|
|
13
13
|
if (e.hasAttribute("data-mobile")) {
|
|
14
|
-
const t = Array.from(
|
|
15
|
-
|
|
16
|
-
(o) => o.innerText.trim()
|
|
17
|
-
);
|
|
18
|
-
s.has(e) || (s.add(e), l?.observe(e), c([{ target: e, contentRect: e.getBoundingClientRect() }]));
|
|
14
|
+
const t = Array.from(e.tHead?.rows[0]?.cells || [], (o) => (o.innerText ?? o.textContent)?.trim() || "");
|
|
15
|
+
r.has(e) || (r.add(e), l?.observe(e), c([{ target: e, contentRect: e.getBoundingClientRect() }]));
|
|
19
16
|
for (const o of e.tBodies)
|
|
20
|
-
for (const
|
|
21
|
-
for (const n of
|
|
17
|
+
for (const s of o.rows)
|
|
18
|
+
for (const n of s.cells)
|
|
22
19
|
a(n, "data-th", t[n.cellIndex] || ":empty");
|
|
23
20
|
}
|
|
24
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-observer.js","sources":["../../designsystem/table/table-observer.ts"],"sourcesContent":["import { attr, debounce, isBrowser, onHotReload, onMutation } from \"../utils\";\n\nconst MOBILE = new WeakSet();\nconst TABLES = isBrowser() ? document.getElementsByTagName(\"table\") : [];\nconst RESIZER =\n\tisBrowser() && window.ResizeObserver // Check for ResizeObserver support, as it's not available in all environments (e.g., JSDOM)\n\t\t? new ResizeObserver(debounce(handleResize, 200))\n\t\t: null;\n\nfunction handleResize(\n\tentries: Pick<ResizeObserverEntry, \"target\" | \"contentRect\">[],\n) {\n\tfor (const { target: table, contentRect: rect } of entries) {\n\t\tif (!table.isConnected) MOBILE.delete(table) && RESIZER?.unobserve(table);\n\t\telse {\n\t\t\tconst isSelf = table.getAttribute(\"data-mobile-source\") === \"self\";\n\t\t\tconst source = isSelf ? rect.width : window.innerWidth;\n\t\t\tconst size = Number(table.getAttribute(\"data-mobile-size\")) || 768;\n\n\t\t\tattr(table, \"data-mobile-active\", source < size ? \"\" : null);\n\t\t}\n\t}\n}\n\nfunction handleTableMobile() {\n\tfor (const target of TABLES)\n\t\tif (target.hasAttribute(\"data-mobile\")) {\n\t\t\tconst ths = Array.from(target.tHead?.rows[0]?.cells || [], (th)
|
|
1
|
+
{"version":3,"file":"table-observer.js","sources":["../../designsystem/table/table-observer.ts"],"sourcesContent":["import { attr, debounce, isBrowser, onHotReload, onMutation } from \"../utils\";\n\nconst MOBILE = new WeakSet();\nconst TABLES = isBrowser() ? document.getElementsByTagName(\"table\") : [];\nconst RESIZER =\n\tisBrowser() && window.ResizeObserver // Check for ResizeObserver support, as it's not available in all environments (e.g., JSDOM)\n\t\t? new ResizeObserver(debounce(handleResize, 200))\n\t\t: null;\n\nfunction handleResize(\n\tentries: Pick<ResizeObserverEntry, \"target\" | \"contentRect\">[],\n) {\n\tfor (const { target: table, contentRect: rect } of entries) {\n\t\tif (!table.isConnected) MOBILE.delete(table) && RESIZER?.unobserve(table);\n\t\telse {\n\t\t\tconst isSelf = table.getAttribute(\"data-mobile-source\") === \"self\";\n\t\t\tconst source = isSelf ? rect.width : window.innerWidth;\n\t\t\tconst size = Number(table.getAttribute(\"data-mobile-size\")) || 768;\n\n\t\t\tattr(table, \"data-mobile-active\", source < size ? \"\" : null);\n\t\t}\n\t}\n}\n\nfunction handleTableMobile() {\n\tfor (const target of TABLES)\n\t\tif (target.hasAttribute(\"data-mobile\")) {\n\t\t\tconst ths = Array.from(target.tHead?.rows[0]?.cells || [], (th) => {\n\t\t\t\treturn (th.innerText ?? th.textContent)?.trim() || \"\"; // Fallback to textContent if innerText is not supported (e.g., in JSDOM)\n\t\t\t});\n\n\t\t\tif (!MOBILE.has(target)) {\n\t\t\t\tMOBILE.add(target);\n\t\t\t\tRESIZER?.observe(target);\n\t\t\t\thandleResize([{ target, contentRect: target.getBoundingClientRect() }]); // Instant initial check\n\t\t\t}\n\n\t\t\tfor (const tbody of target.tBodies)\n\t\t\t\tfor (const row of tbody.rows)\n\t\t\t\t\tfor (const cell of row.cells)\n\t\t\t\t\t\tattr(cell, \"data-th\", ths[cell.cellIndex] || \":empty\");\n\t\t}\n}\n\nonHotReload(\"table\", () => [\n\tonMutation(document, handleTableMobile, {\n\t\tattributeFilter: [\"data-mobile\"],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["MOBILE","TABLES","isBrowser","RESIZER","debounce","handleResize","entries","table","rect","source","size","attr","handleTableMobile","target","ths","th","tbody","row","cell","onHotReload","onMutation"],"mappings":";AAEA,MAAMA,wBAAa,QAAA,GACbC,IAASC,EAAA,IAAc,SAAS,qBAAqB,OAAO,IAAI,CAAA,GAChEC,IACLD,EAAA,KAAe,OAAO,iBACnB,IAAI,eAAeE,EAASC,GAAc,GAAG,CAAC,IAC9C;AAEJ,SAASA,EACRC,GACC;AACD,aAAW,EAAE,QAAQC,GAAO,aAAaC,EAAA,KAAUF;AAClD,QAAI,CAACC,EAAM,YAAa,CAAAP,EAAO,OAAOO,CAAK,KAAKJ,GAAS,UAAUI,CAAK;AAAA,SACnE;AAEJ,YAAME,IADSF,EAAM,aAAa,oBAAoB,MAAM,SACpCC,EAAK,QAAQ,OAAO,YACtCE,IAAO,OAAOH,EAAM,aAAa,kBAAkB,CAAC,KAAK;AAE/D,MAAAI,EAAKJ,GAAO,sBAAsBE,IAASC,IAAO,KAAK,IAAI;AAAA,IAC5D;AAEF;AAEA,SAASE,IAAoB;AAC5B,aAAWC,KAAUZ;AACpB,QAAIY,EAAO,aAAa,aAAa,GAAG;AACvC,YAAMC,IAAM,MAAM,KAAKD,EAAO,OAAO,KAAK,CAAC,GAAG,SAAS,CAAA,GAAI,CAACE,OACnDA,EAAG,aAAaA,EAAG,cAAc,UAAU,EACnD;AAED,MAAKf,EAAO,IAAIa,CAAM,MACrBb,EAAO,IAAIa,CAAM,GACjBV,GAAS,QAAQU,CAAM,GACvBR,EAAa,CAAC,EAAE,QAAAQ,GAAQ,aAAaA,EAAO,sBAAA,EAAsB,CAAG,CAAC;AAGvE,iBAAWG,KAASH,EAAO;AAC1B,mBAAWI,KAAOD,EAAM;AACvB,qBAAWE,KAAQD,EAAI;AACtB,YAAAN,EAAKO,GAAM,WAAWJ,EAAII,EAAK,SAAS,KAAK,QAAQ;AAAA,IACzD;AACF;AAEAC,EAAY,SAAS,MAAM;AAAA,EAC1BC,EAAW,UAAUR,GAAmB;AAAA,IACvC,iBAAiB,CAAC,aAAa;AAAA,IAC/B,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
|
|
@@ -6,7 +6,7 @@ declare const meta: {
|
|
|
6
6
|
};
|
|
7
7
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
8
8
|
[x: string]: any;
|
|
9
|
-
}>) => import("react
|
|
9
|
+
}>) => import("react").JSX.Element)[];
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
@@ -3,7 +3,7 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
}>) => import("react
|
|
6
|
+
}>) => import("react").JSX.Element)[];
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof meta>;
|
|
@@ -6,7 +6,7 @@ declare const meta: {
|
|
|
6
6
|
};
|
|
7
7
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
8
8
|
[x: string]: any;
|
|
9
|
-
}>) => import("react
|
|
9
|
+
}>) => import("react").JSX.Element)[];
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
package/mtds/tokens.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Colors: () => import("react
|
|
2
|
-
export declare const Sizes: () => import("react
|
|
3
|
-
export declare const Radius: () => import("react
|
|
1
|
+
export declare const Colors: () => import("react").JSX.Element;
|
|
2
|
+
export declare const Sizes: () => import("react").JSX.Element;
|
|
3
|
+
export declare const Radius: () => import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
}>) => import("react
|
|
6
|
+
}>) => import("react").JSX.Element)[];
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof meta>;
|
|
@@ -3,7 +3,7 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
}>) => import("react
|
|
6
|
+
}>) => import("react").JSX.Element)[];
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof meta>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattilsynet/design",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
"@handsontable/react-wrapper": "17.1.0",
|
|
62
62
|
"@phosphor-icons/core": "^2.1.1",
|
|
63
63
|
"@phosphor-icons/react": "^2.1.10",
|
|
64
|
-
"@storybook/addon-docs": "^10.4.
|
|
65
|
-
"@storybook/addon-themes": "^10.4.
|
|
66
|
-
"@storybook/react-vite": "^10.4.
|
|
64
|
+
"@storybook/addon-docs": "^10.4.2",
|
|
65
|
+
"@storybook/addon-themes": "^10.4.2",
|
|
66
|
+
"@storybook/react-vite": "^10.4.2",
|
|
67
67
|
"@tanstack/react-table": "^8.21.3",
|
|
68
68
|
"@turf/boolean-point-in-polygon": "^7.3.5",
|
|
69
69
|
"@turf/helpers": "^7.3.5",
|
|
70
70
|
"@types/leaflet": "^1.9.21",
|
|
71
71
|
"@types/leaflet.markercluster": "^1.5.6",
|
|
72
72
|
"@types/node": "^25.9.1",
|
|
73
|
-
"@types/react": "^19.2.
|
|
73
|
+
"@types/react": "^19.2.16",
|
|
74
74
|
"@types/react-dom": "^19.2.3",
|
|
75
75
|
"@vitejs/plugin-react": "^5.2.0",
|
|
76
76
|
"fast-glob": "^3.3.3",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"leaflet": "^2.0.0-alpha.1",
|
|
79
79
|
"postcss": "^8.5.15",
|
|
80
80
|
"postcss-nesting": "^14.0.0",
|
|
81
|
-
"react": "^19.2.
|
|
82
|
-
"react-dom": "^19.2.
|
|
81
|
+
"react": "^19.2.7",
|
|
82
|
+
"react-dom": "^19.2.7",
|
|
83
83
|
"react-moveable": "^0.56.0",
|
|
84
|
-
"storybook": "^10.4.
|
|
84
|
+
"storybook": "^10.4.2",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
86
|
"vite": "^7.3.2",
|
|
87
87
|
"vite-plugin-dts": "^4.5.4",
|