@mattilsynet/design 3.2.9 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/ai/AGENTS.md +892 -0
- package/mtds/ai/alert.mdx +63 -0
- package/mtds/ai/alert.stories.tsx +128 -0
- package/mtds/ai/analytics.mdx +185 -0
- package/mtds/ai/app.mdx +60 -0
- package/mtds/ai/app.stories.tsx +897 -0
- package/mtds/ai/atlas.mdx +82 -0
- package/mtds/ai/atlas.stories.tsx +424 -0
- package/mtds/ai/avatar.mdx +45 -0
- package/mtds/ai/avatar.stories.tsx +109 -0
- package/mtds/ai/badge.mdx +70 -0
- package/mtds/ai/badge.stories.tsx +122 -0
- package/mtds/ai/breadcrumbs.mdx +36 -0
- package/mtds/ai/breadcrumbs.stories.tsx +158 -0
- package/mtds/ai/button.mdx +179 -0
- package/mtds/ai/button.stories.tsx +440 -0
- package/mtds/ai/card.mdx +51 -0
- package/mtds/ai/card.stories.tsx +469 -0
- package/mtds/ai/chart.mdx +67 -0
- package/mtds/ai/chart.stories.tsx +519 -0
- package/mtds/ai/chip.mdx +71 -0
- package/mtds/ai/chip.stories.tsx +211 -0
- package/mtds/ai/details.mdx +33 -0
- package/mtds/ai/details.stories.tsx +91 -0
- package/mtds/ai/dialog.mdx +38 -0
- package/mtds/ai/dialog.stories.tsx +373 -0
- package/mtds/ai/divider.mdx +19 -0
- package/mtds/ai/divider.stories.tsx +50 -0
- package/mtds/ai/errorsummary.mdx +26 -0
- package/mtds/ai/errorsummary.stories.tsx +137 -0
- package/mtds/ai/field.mdx +86 -0
- package/mtds/ai/field.stories.tsx +863 -0
- package/mtds/ai/fieldset.mdx +126 -0
- package/mtds/ai/fieldset.stories.tsx +298 -0
- package/mtds/ai/fileupload.mdx +16 -0
- package/mtds/ai/fileupload.stories.tsx +126 -0
- package/mtds/ai/helptext.mdx +24 -0
- package/mtds/ai/helptext.stories.tsx +106 -0
- package/mtds/ai/input.mdx +223 -0
- package/mtds/ai/input.stories.tsx +352 -0
- package/mtds/ai/law.mdx +115 -0
- package/mtds/ai/law.stories.tsx +168 -0
- package/mtds/ai/layout.mdx +145 -0
- package/mtds/ai/layout.stories.tsx +443 -0
- package/mtds/ai/link.mdx +45 -0
- package/mtds/ai/link.stories.tsx +44 -0
- package/mtds/ai/logo.mdx +86 -0
- package/mtds/ai/logo.stories.tsx +146 -0
- package/mtds/ai/pagination.mdx +136 -0
- package/mtds/ai/pagination.stories.tsx +404 -0
- package/mtds/ai/popover.mdx +86 -0
- package/mtds/ai/popover.stories.tsx +355 -0
- package/mtds/ai/print.mdx +96 -0
- package/mtds/ai/print.stories.tsx +839 -0
- package/mtds/ai/progress.mdx +41 -0
- package/mtds/ai/progress.stories.tsx +141 -0
- package/mtds/ai/skeleton.mdx +26 -0
- package/mtds/ai/skeleton.stories.tsx +131 -0
- package/mtds/ai/spinner.mdx +26 -0
- package/mtds/ai/spinner.stories.tsx +72 -0
- package/mtds/ai/steps.mdx +37 -0
- package/mtds/ai/steps.stories.tsx +568 -0
- package/mtds/ai/table.mdx +124 -0
- package/mtds/ai/table.stories.tsx +1715 -0
- package/mtds/ai/tabs.mdx +106 -0
- package/mtds/ai/tabs.stories.tsx +159 -0
- package/mtds/ai/tag.mdx +49 -0
- package/mtds/ai/tag.stories.tsx +111 -0
- package/mtds/ai/toast.mdx +67 -0
- package/mtds/ai/toast.stories.tsx +215 -0
- package/mtds/ai/togglegroup.mdx +75 -0
- package/mtds/ai/togglegroup.stories.tsx +96 -0
- package/mtds/ai/tooltip.mdx +32 -0
- package/mtds/ai/tooltip.stories.tsx +34 -0
- package/mtds/ai/typography.mdx +67 -0
- package/mtds/ai/typography.stories.tsx +798 -0
- package/mtds/ai/validation.mdx +19 -0
- package/mtds/ai/validation.stories.tsx +45 -0
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/chart/chart-lines.js +19 -19
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart.css.js +16 -1
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.stories.d.ts +1 -0
- package/mtds/index.iife.js +32 -17
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/table/table-observer.js +26 -15
- package/mtds/table/table-observer.js.map +1 -1
- package/package.json +4 -2
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { isBrowser as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { isBrowser as r, debounce as b, attr as a, onHotReload as u, onMutation as f } from "../utils.js";
|
|
2
|
+
const s = /* @__PURE__ */ new WeakSet(), m = r() ? document.getElementsByTagName("table") : [], l = r() ? new ResizeObserver(b(c, 200)) : null;
|
|
3
|
+
function c(e) {
|
|
4
|
+
for (const { target: t, contentRect: o } of e)
|
|
5
|
+
if (!t.isConnected) s.delete(t) && l?.unobserve(t);
|
|
6
|
+
else {
|
|
7
|
+
const n = t.getAttribute("data-mobile-source") === "self" ? o.width : window.innerWidth, d = Number(t.getAttribute("data-mobile-size")) || 768;
|
|
8
|
+
a(t, "data-mobile-active", n < d ? "" : null);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function h() {
|
|
12
|
+
for (const e of m)
|
|
13
|
+
if (e.hasAttribute("data-mobile")) {
|
|
14
|
+
const t = Array.from(
|
|
15
|
+
e.tHead?.rows[0]?.cells || [],
|
|
16
|
+
(o) => o.innerText.trim()
|
|
17
|
+
);
|
|
18
|
+
s.has(e) || (s.add(e), l?.observe(e), c([{ target: e, contentRect: e.getBoundingClientRect() }]));
|
|
19
|
+
for (const o of e.tBodies)
|
|
20
|
+
for (const i of o.rows)
|
|
21
|
+
for (const n of i.cells)
|
|
22
|
+
a(n, "data-th", t[n.cellIndex] || ":empty");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
u("table", () => [
|
|
26
|
+
f(document, h, {
|
|
16
27
|
attributeFilter: ["data-mobile"],
|
|
17
28
|
attributes: !0,
|
|
18
29
|
childList: !0,
|
|
@@ -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 TABLES = isBrowser() ? document.getElementsByTagName(\"table\") : [];\nconst
|
|
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 = isBrowser()\n\t? new ResizeObserver(debounce(handleResize, 200))\n\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\tth.innerText.trim(),\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,IAAUD,MACb,IAAI,eAAeE,EAASC,GAAc,GAAG,CAAC,IAC9C;AAEH,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;AAAA,QAAKD,EAAO,OAAO,KAAK,CAAC,GAAG,SAAS,CAAA;AAAA,QAAI,CAACE,MAC3DA,EAAG,UAAU,KAAA;AAAA,MAAK;AAGnB,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;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattilsynet/design",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"./*.svg": "./mtds/*.svg",
|
|
36
36
|
"./*.ico": "./mtds/*.ico",
|
|
37
|
+
"./ai/*": "./mtds/ai/*",
|
|
37
38
|
"./icons/*": "./mtds/icons/*",
|
|
38
39
|
"./illustrations/*": "./mtds/illustrations/*",
|
|
39
40
|
"./index.iife.js": "./mtds/index.iife.js",
|
|
@@ -83,7 +84,8 @@
|
|
|
83
84
|
"storybook": "^10.4.1",
|
|
84
85
|
"typescript": "^6.0.3",
|
|
85
86
|
"vite": "^7.3.2",
|
|
86
|
-
"vite-plugin-dts": "^4.5.4"
|
|
87
|
+
"vite-plugin-dts": "^4.5.4",
|
|
88
|
+
"vite-plugin-static-copy": "^4.1.0"
|
|
87
89
|
},
|
|
88
90
|
"dependencies": {
|
|
89
91
|
"@digdir/designsystemet-web": "^1.15.0",
|