@mattilsynet/design 0.2.0 → 0.2.2

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/styles.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
- "alert": "_alert_zkihy_1 _ds-alert_14y6r_1",
3
- "avatar": "_avatar_zkihy_1 _ds-avatar_14y6r_1",
4
- "breadcrumbs": "_breadcrumbs_zkihy_1 _ds-breadcrumbs_14y6r_1",
5
- "button": "_button_zkihy_1 _ds-button_14y6r_1",
6
- "card": "_card_zkihy_1 _ds-card_14y6r_1",
7
- "chip": "_chip_zkihy_1 _ds-chip_14y6r_1",
8
- "details": "_details_zkihy_1 _ds-details_14y6r_1",
9
- "errorsummary": "_errorsummary_zkihy_1 _ds-error-summary_14y6r_1",
10
- "field": "_field_zkihy_1 _ds-field_14y6r_1",
11
- "fieldChildAdded": "_fieldChildAdded_zkihy_1",
12
- "affixes": "_affixes_zkihy_1 _ds-field-affixes_14y6r_1",
13
- "count": "_count_zkihy_1",
14
- "fieldset": "_fieldset_zkihy_1 _ds-fieldset_14y6r_1",
15
- "fieldsetValidationAdded": "_fieldsetValidationAdded_zkihy_1",
16
- "input": "_input_zkihy_1 _ds-input_14y6r_1",
17
- "grid": "_grid_zkihy_1",
18
- "flex": "_flex_zkihy_1",
19
- "box": "_box_zkihy_1",
20
- "link": "_link_zkihy_1",
21
- "logo": "_logo_zkihy_1 _ds-focus_14y6r_1",
22
- "modal": "_modal_zkihy_1 _ds-modal_14y6r_1",
23
- "pagination": "_pagination_zkihy_1 _ds-pagination_14y6r_1",
24
- "popover": "_popover_zkihy_1",
25
- "table": "_table_zkihy_1 _ds-table_14y6r_1",
26
- "scrollShadow": "_scrollShadow_zkihy_1",
27
- "tableChildAdded": "_tableChildAdded_zkihy_1",
28
- "tabs": "_tabs_zkihy_1",
29
- "tag": "_tag_zkihy_1 _ds-tag_14y6r_1",
30
- "validation": "_validation_zkihy_1 _ds-validation-message_14y6r_1",
31
- "body": "_body_zkihy_73"
2
+ "alert": "_alert_1xgwh_1 _ds-alert_14y6r_1",
3
+ "avatar": "_avatar_1xgwh_1 _ds-avatar_14y6r_1",
4
+ "breadcrumbs": "_breadcrumbs_1xgwh_1 _ds-breadcrumbs_14y6r_1",
5
+ "button": "_button_1xgwh_1 _ds-button_14y6r_1",
6
+ "card": "_card_1xgwh_1 _ds-card_14y6r_1",
7
+ "chip": "_chip_1xgwh_1 _ds-chip_14y6r_1",
8
+ "details": "_details_1xgwh_1 _ds-details_14y6r_1",
9
+ "errorsummary": "_errorsummary_1xgwh_1 _ds-error-summary_14y6r_1",
10
+ "field": "_field_1xgwh_1 _ds-field_14y6r_1",
11
+ "fieldChildAdded": "_fieldChildAdded_1xgwh_1",
12
+ "affixes": "_affixes_1xgwh_1 _ds-field-affixes_14y6r_1",
13
+ "count": "_count_1xgwh_1",
14
+ "fieldset": "_fieldset_1xgwh_1 _ds-fieldset_14y6r_1",
15
+ "fieldsetValidationAdded": "_fieldsetValidationAdded_1xgwh_1",
16
+ "input": "_input_1xgwh_1 _ds-input_14y6r_1",
17
+ "grid": "_grid_1xgwh_1",
18
+ "flex": "_flex_1xgwh_1",
19
+ "box": "_box_1xgwh_1",
20
+ "link": "_link_1xgwh_1",
21
+ "logo": "_logo_1xgwh_1 _ds-focus_14y6r_1",
22
+ "modal": "_modal_1xgwh_1 _ds-modal_14y6r_1",
23
+ "pagination": "_pagination_1xgwh_1 _ds-pagination_14y6r_1",
24
+ "popover": "_popover_1xgwh_1",
25
+ "table": "_table_1xgwh_1 _ds-table_14y6r_1",
26
+ "scrollShadow": "_scrollShadow_1xgwh_1",
27
+ "tableChildAdded": "_tableChildAdded_1xgwh_1",
28
+ "tabs": "_tabs_1xgwh_1",
29
+ "tag": "_tag_1xgwh_1 _ds-tag_14y6r_1",
30
+ "validation": "_validation_1xgwh_1 _ds-validation-message_14y6r_1",
31
+ "body": "_body_1xgwh_76"
32
32
  }
@@ -1,66 +1,66 @@
1
- const _ = "_alert_zkihy_1 _ds-alert_14y6r_1", d = "_avatar_zkihy_1 _ds-avatar_14y6r_1", i = "_breadcrumbs_zkihy_1 _ds-breadcrumbs_14y6r_1", t = "_button_zkihy_1 _ds-button_14y6r_1", s = "_card_zkihy_1 _ds-card_14y6r_1", o = "_chip_zkihy_1 _ds-chip_14y6r_1", a = "_details_zkihy_1 _ds-details_14y6r_1", e = "_errorsummary_zkihy_1 _ds-error-summary_14y6r_1", l = "_field_zkihy_1 _ds-field_14y6r_1", r = "_fieldChildAdded_zkihy_1", n = "_affixes_zkihy_1 _ds-field-affixes_14y6r_1", y = "_count_zkihy_1", c = "_fieldset_zkihy_1 _ds-fieldset_14y6r_1", h = "_fieldsetValidationAdded_zkihy_1", k = "_input_zkihy_1 _ds-input_14y6r_1", z = "_grid_zkihy_1", b = "_flex_zkihy_1", f = "_box_zkihy_1", u = "_link_zkihy_1", p = "_logo_zkihy_1 _ds-focus_14y6r_1", m = "_modal_zkihy_1 _ds-modal_14y6r_1", g = "_pagination_zkihy_1 _ds-pagination_14y6r_1", v = "_popover_zkihy_1", x = "_table_zkihy_1 _ds-table_14y6r_1", A = "_scrollShadow_zkihy_1", C = "_tableChildAdded_zkihy_1", w = "_tabs_zkihy_1", S = "_tag_zkihy_1 _ds-tag_14y6r_1", V = "_validation_zkihy_1 _ds-validation-message_14y6r_1", j = "_body_zkihy_73", q = {
1
+ const _ = "_alert_1xgwh_1 _ds-alert_14y6r_1", d = "_avatar_1xgwh_1 _ds-avatar_14y6r_1", t = "_breadcrumbs_1xgwh_1 _ds-breadcrumbs_14y6r_1", s = "_button_1xgwh_1 _ds-button_14y6r_1", o = "_card_1xgwh_1 _ds-card_14y6r_1", a = "_chip_1xgwh_1 _ds-chip_14y6r_1", e = "_details_1xgwh_1 _ds-details_14y6r_1", i = "_errorsummary_1xgwh_1 _ds-error-summary_14y6r_1", l = "_field_1xgwh_1 _ds-field_14y6r_1", r = "_fieldChildAdded_1xgwh_1", n = "_affixes_1xgwh_1 _ds-field-affixes_14y6r_1", c = "_count_1xgwh_1", g = "_fieldset_1xgwh_1 _ds-fieldset_14y6r_1", h = "_fieldsetValidationAdded_1xgwh_1", x = "_input_1xgwh_1 _ds-input_14y6r_1", w = "_grid_1xgwh_1", b = "_flex_1xgwh_1", f = "_box_1xgwh_1", y = "_link_1xgwh_1", u = "_logo_1xgwh_1 _ds-focus_14y6r_1", p = "_modal_1xgwh_1 _ds-modal_14y6r_1", m = "_pagination_1xgwh_1 _ds-pagination_14y6r_1", v = "_popover_1xgwh_1", A = "_table_1xgwh_1 _ds-table_14y6r_1", C = "_scrollShadow_1xgwh_1", k = "_tableChildAdded_1xgwh_1", S = "_tabs_1xgwh_1", V = "_tag_1xgwh_1 _ds-tag_14y6r_1", j = "_validation_1xgwh_1 _ds-validation-message_14y6r_1", q = "_body_1xgwh_76", z = {
2
2
  alert: _,
3
3
  avatar: d,
4
- breadcrumbs: i,
5
- button: t,
6
- card: s,
7
- chip: o,
8
- details: a,
9
- errorsummary: e,
4
+ breadcrumbs: t,
5
+ button: s,
6
+ card: o,
7
+ chip: a,
8
+ details: e,
9
+ errorsummary: i,
10
10
  field: l,
11
11
  fieldChildAdded: r,
12
12
  affixes: n,
13
- count: y,
14
- fieldset: c,
13
+ count: c,
14
+ fieldset: g,
15
15
  fieldsetValidationAdded: h,
16
- input: k,
17
- grid: z,
16
+ input: x,
17
+ grid: w,
18
18
  flex: b,
19
19
  box: f,
20
- link: u,
21
- logo: p,
22
- modal: m,
23
- pagination: g,
20
+ link: y,
21
+ logo: u,
22
+ modal: p,
23
+ pagination: m,
24
24
  popover: v,
25
- table: x,
26
- scrollShadow: A,
27
- tableChildAdded: C,
28
- tabs: w,
29
- tag: S,
30
- validation: V,
31
- body: j
25
+ table: A,
26
+ scrollShadow: C,
27
+ tableChildAdded: k,
28
+ tabs: S,
29
+ tag: V,
30
+ validation: j,
31
+ body: q
32
32
  };
33
33
  export {
34
34
  n as affixes,
35
35
  _ as alert,
36
36
  d as avatar,
37
- j as body,
37
+ q as body,
38
38
  f as box,
39
- i as breadcrumbs,
40
- t as button,
41
- s as card,
42
- o as chip,
43
- y as count,
44
- q as default,
45
- a as details,
46
- e as errorsummary,
39
+ t as breadcrumbs,
40
+ s as button,
41
+ o as card,
42
+ a as chip,
43
+ c as count,
44
+ z as default,
45
+ e as details,
46
+ i as errorsummary,
47
47
  l as field,
48
48
  r as fieldChildAdded,
49
- c as fieldset,
49
+ g as fieldset,
50
50
  h as fieldsetValidationAdded,
51
51
  b as flex,
52
- z as grid,
53
- k as input,
54
- u as link,
55
- p as logo,
56
- m as modal,
57
- g as pagination,
52
+ w as grid,
53
+ x as input,
54
+ y as link,
55
+ u as logo,
56
+ p as modal,
57
+ m as pagination,
58
58
  v as popover,
59
- A as scrollShadow,
60
- x as table,
61
- C as tableChildAdded,
62
- w as tabs,
63
- S as tag,
64
- V as validation
59
+ C as scrollShadow,
60
+ A as table,
61
+ k as tableChildAdded,
62
+ S as tabs,
63
+ V as tag,
64
+ j as validation
65
65
  };
66
66
  //# sourceMappingURL=styles.module.css.js.map
@@ -1,7 +1,7 @@
1
1
  import f from "../styles.module.css.js";
2
- import { IS_BROWSER as d, onAdd as i } from "../utils.js";
3
- const b = f.table.split(" ")[0], l = /* @__PURE__ */ new WeakMap();
4
- function m(t) {
2
+ import { onAdd as d } from "../utils.js";
3
+ const i = f.table.split(" ")[0], l = /* @__PURE__ */ new WeakMap();
4
+ function b(t) {
5
5
  var o, e;
6
6
  for (const n of t) if (n instanceof HTMLTableElement) {
7
7
  const a = Array.from(((e = (o = n.tHead) == null ? void 0 : o.rows[0]) == null ? void 0 : e.cells) || [], (r) => {
@@ -14,17 +14,16 @@ function m(t) {
14
14
  c.setAttribute("data-th", a[c.cellIndex] || "");
15
15
  }
16
16
  }
17
- d && p(document);
18
- function p(t) {
19
- const o = t.getElementsByClassName(b), e = i(f.tableChildAdded, () => m(o));
17
+ function u(t) {
18
+ const o = t.getElementsByClassName(i), e = d(f.tableChildAdded, () => b(o));
20
19
  l.set(t, e), e.observe(t);
21
20
  }
22
- function B(t) {
21
+ function A(t) {
23
22
  var o;
24
23
  (o = l.get(t)) == null || o.disconnect(t);
25
24
  }
26
25
  export {
27
- p as observe,
28
- B as unobserve
26
+ u as observe,
27
+ A as unobserve
29
28
  };
30
29
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sources":["../../designsystem/table/table.ts"],"sourcesContent":["import styles from '../styles.module.css';\nimport { IS_BROWSER, onAdd } from '../utils';\nconst CSS_TABLE = styles.table.split(' ')[0];\nconst BOUND = new WeakMap<Element | Document, ReturnType<typeof onAdd>>();\n\nfunction process(tables: HTMLCollectionOf<Element>) {\n for(const table of tables) if (table instanceof HTMLTableElement) {\n const ths = Array.from(table.tHead?.rows[0]?.cells || [], (el) => el.innerText?.trim()); // Using innerText to only include visible text\n for (const tbody of table.tBodies) {\n for (const row of tbody.rows) {\n for (const cell of row.cells) {\n cell.setAttribute('data-th', ths[cell.cellIndex] || '');\n }\n }\n }\n }\n}\n\nif (IS_BROWSER) observe(document);\n\nexport function observe (el: Element | Document) {\n const tables = el.getElementsByClassName(CSS_TABLE);\n const add = onAdd(styles.tableChildAdded, () => process(tables));\n BOUND.set(el, add);\n add.observe(el);\n}\n\nexport function unobserve (el: Element | Document) {\n BOUND.get(el)?.disconnect(el);\n}\n"],"names":["CSS_TABLE","styles","BOUND","process","tables","table","ths","_b","_a","el","tbody","row","cell","IS_BROWSER","observe","add","onAdd","unobserve"],"mappings":";;AAEA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC,GACrCC,wBAAY,QAAsD;AAExE,SAASC,EAAQC,GAAmC;;AAClD,aAAUC,KAASD,EAAY,KAAAC,aAAiB,kBAAkB;AAChE,UAAMC,IAAM,MAAM,OAAKC,KAAAC,IAAAH,EAAM,UAAN,gBAAAG,EAAa,KAAK,OAAlB,gBAAAD,EAAsB,UAAS,IAAI,CAACE,MAAO;;AAAA,cAAAD,IAAAC,EAAG,cAAH,gBAAAD,EAAc;AAAA,KAAM;AAC3E,eAAAE,KAASL,EAAM;AACb,iBAAAM,KAAOD,EAAM;AACX,mBAAAE,KAAQD,EAAI;AACrB,UAAAC,EAAK,aAAa,WAAWN,EAAIM,EAAK,SAAS,KAAK,EAAE;AAAA,EAG5D;AAEJ;AAEIC,OAAoB,QAAQ;AAEzB,SAASC,EAASL,GAAwB;AACzC,QAAAL,IAASK,EAAG,uBAAuBT,CAAS,GAC5Ce,IAAMC,EAAMf,EAAO,iBAAiB,MAAME,EAAQC,CAAM,CAAC;AACzD,EAAAF,EAAA,IAAIO,GAAIM,CAAG,GACjBA,EAAI,QAAQN,CAAE;AAChB;AAEO,SAASQ,EAAWR,GAAwB;;AACjD,GAAAD,IAAAN,EAAM,IAAIO,CAAE,MAAZ,QAAAD,EAAe,WAAWC;AAC5B;"}
1
+ {"version":3,"file":"table.js","sources":["../../designsystem/table/table.ts"],"sourcesContent":["import styles from '../styles.module.css';\nimport { onAdd } from '../utils';\nconst CSS_TABLE = styles.table.split(' ')[0];\nconst BOUND = new WeakMap<Element | Document, ReturnType<typeof onAdd>>();\n\nfunction process(tables: HTMLCollectionOf<Element>) {\n for(const table of tables) if (table instanceof HTMLTableElement) {\n const ths = Array.from(table.tHead?.rows[0]?.cells || [], (el) => el.innerText?.trim()); // Using innerText to only include visible text\n for (const tbody of table.tBodies) {\n for (const row of tbody.rows) {\n for (const cell of row.cells) {\n cell.setAttribute('data-th', ths[cell.cellIndex] || '');\n }\n }\n }\n }\n}\n\nexport function observe (el: Element | Document) {\n const tables = el.getElementsByClassName(CSS_TABLE);\n const add = onAdd(styles.tableChildAdded, () => process(tables));\n BOUND.set(el, add);\n add.observe(el);\n}\n\nexport function unobserve (el: Element | Document) {\n BOUND.get(el)?.disconnect(el);\n}\n"],"names":["CSS_TABLE","styles","BOUND","process","tables","table","ths","_b","_a","el","tbody","row","cell","observe","add","onAdd","unobserve"],"mappings":";;AAEA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC,GACrCC,wBAAY,QAAsD;AAExE,SAASC,EAAQC,GAAmC;;AAClD,aAAUC,KAASD,EAAY,KAAAC,aAAiB,kBAAkB;AAChE,UAAMC,IAAM,MAAM,OAAKC,KAAAC,IAAAH,EAAM,UAAN,gBAAAG,EAAa,KAAK,OAAlB,gBAAAD,EAAsB,UAAS,IAAI,CAACE,MAAO;;AAAA,cAAAD,IAAAC,EAAG,cAAH,gBAAAD,EAAc;AAAA,KAAM;AAC3E,eAAAE,KAASL,EAAM;AACb,iBAAAM,KAAOD,EAAM;AACX,mBAAAE,KAAQD,EAAI;AACrB,UAAAC,EAAK,aAAa,WAAWN,EAAIM,EAAK,SAAS,KAAK,EAAE;AAAA,EAG5D;AAEJ;AAEO,SAASC,EAASJ,GAAwB;AACzC,QAAAL,IAASK,EAAG,uBAAuBT,CAAS,GAC5Cc,IAAMC,EAAMd,EAAO,iBAAiB,MAAME,EAAQC,CAAM,CAAC;AACzD,EAAAF,EAAA,IAAIO,GAAIK,CAAG,GACjBA,EAAI,QAAQL,CAAE;AAChB;AAEO,SAASO,EAAWP,GAAwB;;AACjD,GAAAD,IAAAN,EAAM,IAAIO,CAAE,MAAZ,QAAAD,EAAe,WAAWC;AAC5B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattilsynet/design",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "./mtds/index.js",
6
6
  "types": "./mtds/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "scripts": {
29
29
  "build": "vite build && rm -rf mtds/docs/",
30
30
  "lint": "npx @biomejs/biome lint",
31
- "publish:clojure": "cd ./clojure && ./publish.sh",
31
+ "publish:clojure": "npm run build && cd ./clojure && ./publish.sh",
32
32
  "publish:minor": "npm run build && npm version minor --message 'Release %s' && git push --tags && npm publish --access public",
33
33
  "publish:patch": "npm run build && npm version patch --message 'Release %s' && git push --tags && npm publish --access public",
34
34
  "start": "vite",