@mattilsynet/design 3.2.7 → 3.2.9

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.
Files changed (37) hide show
  1. package/mtds/analytics/analytics.js +44 -44
  2. package/mtds/analytics/analytics.js.map +1 -1
  3. package/mtds/atlas/atlas-element.js +1 -1
  4. package/mtds/breadcrumbs/breadcrumbs.d.ts +1 -1
  5. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  6. package/mtds/deprecations.js +6 -5
  7. package/mtds/deprecations.js.map +1 -1
  8. package/mtds/errorsummary/errorsummary.d.ts +1 -1
  9. package/mtds/errorsummary/errorsummary.js.map +1 -1
  10. package/mtds/field/field.d.ts +1 -1
  11. package/mtds/field/field.js.map +1 -1
  12. package/mtds/illustrations/flagg-uk.svg +1 -0
  13. package/mtds/illustrations/index.json +4 -0
  14. package/mtds/index.d.ts +1 -2
  15. package/mtds/index.iife.js +19 -23
  16. package/mtds/index.js +32 -37
  17. package/mtds/index.js.map +1 -1
  18. package/mtds/package.json.js +1 -1
  19. package/mtds/pagination/pagination.d.ts +1 -1
  20. package/mtds/pagination/pagination.js +9 -8
  21. package/mtds/pagination/pagination.js.map +1 -1
  22. package/mtds/print/print.stories.d.ts +1 -0
  23. package/mtds/styles.css +1 -1
  24. package/mtds/styles.json +23 -23
  25. package/mtds/styles.module.css.js +33 -33
  26. package/mtds/tabs/tabs.d.ts +1 -1
  27. package/mtds/tabs/tabs.js.map +1 -1
  28. package/mtds/tailwind.css +0 -1
  29. package/mtds/tooltip/tooltip-element.js +7 -6
  30. package/mtds/tooltip/tooltip-element.js.map +1 -1
  31. package/package.json +14 -14
  32. package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +0 -238
  33. package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +0 -1
  34. package/mtds/external/@u-elements/u-details/dist/u-details.js +0 -101
  35. package/mtds/external/@u-elements/u-details/dist/u-details.js.map +0 -1
  36. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -235
  37. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
package/mtds/index.js CHANGED
@@ -1,13 +1,12 @@
1
- import { UHTMLComboboxElement as M, UHTMLComboboxShadowRoot as U, UHTMLComboboxStyle as x } from "./external/@u-elements/u-combobox/dist/u-combobox.js";
2
- import { UHTMLTabElement as n, UHTMLTabListElement as w, UHTMLTabListShadowRoot as f, UHTMLTabListStyle as S, UHTMLTabPanelElement as h, UHTMLTabPanelShadowRoot as y, UHTMLTabPanelStyle as C, UHTMLTabShadowRoot as E, UHTMLTabStyle as g, UHTMLTabsElement as R, UHTMLTabsShadowRoot as c, UHTMLTabsStyle as k } from "./external/@u-elements/u-tabs/dist/u-tabs.js";
3
- import "./external/@u-elements/u-details/dist/u-details.js";
1
+ import "@u-elements/u-progress";
4
2
  export * from "@digdir/designsystemet-web";
5
- import { version as v } from "./package.json.js";
6
- import { analytics as I } from "./analytics/analytics.js";
7
- import { toggleAppExpanded as j } from "./app/app-observer.js";
8
- import { fixLawHtml as z, getLawChecked as B, parseLawIds as D, parseLawMeta as F, setLawChecked as G, toggleLawChecked as J } from "./law/law-helper.js";
9
- import * as t from "./styles.module.css.js";
10
- import { toast as N } from "./toast/toast-helper.js";
3
+ import { UHTMLComboboxElement as C, UHTMLComboboxShadowRoot as h, UHTMLComboboxStyle as y } from "./external/@u-elements/u-combobox/dist/u-combobox.js";
4
+ import { version as M } from "./package.json.js";
5
+ import { analytics as k } from "./analytics/analytics.js";
6
+ import { toggleAppExpanded as E } from "./app/app-observer.js";
7
+ import { fixLawHtml as B, getLawChecked as I, parseLawIds as R, parseLawMeta as v, setLawChecked as A, toggleLawChecked as D } from "./law/law-helper.js";
8
+ import * as p from "./styles.module.css.js";
9
+ import { toast as _ } from "./toast/toast-helper.js";
11
10
  import "./chart/chart-element.js";
12
11
  import "./deprecations.js";
13
12
  import "./logo/logo-observer.js";
@@ -16,34 +15,30 @@ import "./table/table-observer.js";
16
15
  import "./toast/toast-observer.js";
17
16
  import "./tooltip/tooltip-element.js";
18
17
  import "./validation/validation-observer.js";
19
- import "./external/@u-elements/u-datalist/dist/u-datalist.js";
20
- import "@u-elements/u-progress";
18
+ import { isBrowser as t, onHotReload as e, onMutation as r } from "./utils.js";
19
+ const m = t() ? document.getElementsByTagName("u-datalist") : [], s = () => {
20
+ for (const o of m) o.closest("ds-suggestion")?.connectedCallback();
21
+ };
22
+ e("deprecations", () => [
23
+ r(document, s, {
24
+ childList: !0,
25
+ subtree: !0
26
+ })
27
+ ]);
21
28
  export {
22
- M as UHTMLComboboxElement,
23
- U as UHTMLComboboxShadowRoot,
24
- x as UHTMLComboboxStyle,
25
- n as UHTMLTabElement,
26
- w as UHTMLTabListElement,
27
- f as UHTMLTabListShadowRoot,
28
- S as UHTMLTabListStyle,
29
- h as UHTMLTabPanelElement,
30
- y as UHTMLTabPanelShadowRoot,
31
- C as UHTMLTabPanelStyle,
32
- E as UHTMLTabShadowRoot,
33
- g as UHTMLTabStyle,
34
- R as UHTMLTabsElement,
35
- c as UHTMLTabsShadowRoot,
36
- k as UHTMLTabsStyle,
37
- I as analytics,
38
- z as fixLawHtml,
39
- B as getLawChecked,
40
- D as parseLawIds,
41
- F as parseLawMeta,
42
- G as setLawChecked,
43
- t as styles,
44
- N as toast,
45
- j as toggleAppExpanded,
46
- J as toggleLawChecked,
47
- v as version
29
+ C as UHTMLComboboxElement,
30
+ h as UHTMLComboboxShadowRoot,
31
+ y as UHTMLComboboxStyle,
32
+ k as analytics,
33
+ B as fixLawHtml,
34
+ I as getLawChecked,
35
+ R as parseLawIds,
36
+ v as parseLawMeta,
37
+ A as setLawChecked,
38
+ p as styles,
39
+ _ as toast,
40
+ E as toggleAppExpanded,
41
+ D as toggleLawChecked,
42
+ M as version
48
43
  };
49
44
  //# sourceMappingURL=index.js.map
package/mtds/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../designsystem/index.ts"],"sourcesContent":["// Expose u-progress, which is not used in @digdir/designsystemet-web, but is used by Mattilsynet\nimport \"@u-elements/u-progress\";\n\n// Expose API\nexport * from \"@digdir/designsystemet-web\"; // Import and expose Digdir web functionality\nexport * from \"@u-elements/u-combobox\"; // Kept for backward compatibility\nexport { version } from \"../package.json\"; // Expose version to make it easier to debug\nexport * from \"./analytics/analytics\";\nexport * from \"./app/app-observer\";\nexport * from \"./law/law-helper\";\nexport * as styles from \"./styles.module.css\";\nexport * from \"./toast/toast-helper\";\n\n// Load behaviors\nimport \"./chart/chart-element\";\nimport \"./deprecations\";\nimport \"./logo/logo-observer\";\nimport \"./popover/popover-observer\";\nimport \"./table/table-observer\";\nimport \"./toast/toast-observer\";\nimport \"./tooltip/tooltip-element\";\nimport \"./validation/validation-observer\";\nimport { isBrowser, onHotReload, onMutation } from \"./utils\";\n\n// Expose types\nexport type Size = \"sm\" | \"md\" | \"lg\";\nexport type HeadingSize = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n\n// Fix ds-suggestion while waiting for https://github.com/digdir/designsystemet/pull/4933\nconst LISTS = isBrowser() ? document.getElementsByTagName(\"u-datalist\") : [];\nconst handleDatalistConnect = () => {\n\tfor (const list of LISTS) list.closest(\"ds-suggestion\")?.connectedCallback();\n};\n\nonHotReload(\"deprecations\", () => [\n\tonMutation(document, handleDatalistConnect, {\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["LISTS","isBrowser","handleDatalistConnect","list","onHotReload","onMutation"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,IAAQC,EAAA,IAAc,SAAS,qBAAqB,YAAY,IAAI,CAAA,GACpEC,IAAwB,MAAM;AACnC,aAAWC,KAAQH,EAAO,CAAAG,EAAK,QAAQ,eAAe,GAAG,kBAAA;AAC1D;AAEAC,EAAY,gBAAgB,MAAM;AAAA,EACjCC,EAAW,UAAUH,GAAuB;AAAA,IAC3C,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
@@ -1,4 +1,4 @@
1
- const o = "3.2.7";
1
+ const o = "3.2.9";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,4 +1,4 @@
1
- import { DSPaginationElement } from '@digdir/designsystemet-web';
1
+ import { DSPaginationElement } from '../';
2
2
  import { Button } from '../button/button';
3
3
  import { CustomReactElementProps } from '../react-types';
4
4
  export type PaginationProps = Omit<CustomReactElementProps<DSPaginationElement>, "children"> & {
@@ -1,17 +1,18 @@
1
1
  import { jsx as i, jsxs as u } from "react/jsx-runtime";
2
- import { pagination as h } from "@digdir/designsystemet-web";
3
- import { forwardRef as x } from "react";
2
+ import { forwardRef as h } from "react";
3
+ import "../index.js";
4
4
  import { Button as n } from "../button/button.js";
5
- import y from "../styles.module.css.js";
6
- import { toCustomElementProps as P } from "../utils.js";
7
- const R = x(
5
+ import x from "../styles.module.css.js";
6
+ import { toCustomElementProps as y } from "../utils.js";
7
+ import { pagination as P } from "@digdir/designsystemet-web";
8
+ const k = h(
8
9
  function({ children: a, current: m, total: p, show: l = 7, props: r, ...d }, c) {
9
- const { pages: s, next: e, prev: o } = h({ current: m, total: p, show: l });
10
+ const { pages: s, next: e, prev: o } = P({ current: m, total: p, show: l });
10
11
  return /* @__PURE__ */ i(
11
12
  "ds-pagination",
12
13
  {
13
14
  ref: c,
14
- ...P(d, y.pagination),
15
+ ...y(d, x.pagination),
15
16
  children: a || /* @__PURE__ */ u("ul", { children: [
16
17
  /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
17
18
  n,
@@ -41,6 +42,6 @@ const R = x(
41
42
  }
42
43
  );
43
44
  export {
44
- R as Pagination
45
+ k as Pagination
45
46
  };
46
47
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import type { DSPaginationElement } from \"@digdir/designsystemet-web\";\nimport { pagination } from \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../button/button\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type PaginationProps = Omit<\n\tCustomReactElementProps<DSPaginationElement>,\n\t\"children\"\n> & {\n\t\"data-variant\"?: \"primary\" | \"secondary\";\n} & (\n\t\t| {\n\t\t\t\tchildren?: never;\n\t\t\t\tcurrent: number;\n\t\t\t\tshow?: number;\n\t\t\t\ttotal: number;\n\t\t\t\tprops: (props: {\n\t\t\t\t\tpage: number;\n\t\t\t\t\ttype: \"prev\" | \"next\" | \"page\";\n\t\t\t\t}) => Parameters<typeof Button>[0];\n\t\t }\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcurrent?: never;\n\t\t\t\tshow?: never;\n\t\t\t\ttotal?: never;\n\t\t\t\tprops?: never;\n\t\t }\n\t);\n\nexport const Pagination = forwardRef<DSPaginationElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, current, total, show = 7, props, ...rest },\n\t\tref,\n\t) {\n\t\tconst { pages, next, prev } = pagination({ current, total, show });\n\n\t\treturn (\n\t\t\t<ds-pagination\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest, styles.pagination)}\n\t\t\t>\n\t\t\t\t{children || (\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!prev}\n\t\t\t\t\t\t\t\t{...props?.({ page: prev, type: \"prev\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{pages.map(({ key, page, current }) => (\n\t\t\t\t\t\t\t<li key={key}>\n\t\t\t\t\t\t\t\t{!!page && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\taria-current={current}\n\t\t\t\t\t\t\t\t\t\t{...{ children: page }}\n\t\t\t\t\t\t\t\t\t\t{...props?.({ page, type: \"page\" })}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!next}\n\t\t\t\t\t\t\t\t{...props?.({ page: next, type: \"next\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t</ds-pagination>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","toCustomElementProps","styles","Button","key","page"],"mappings":";;;;;;AAiCO,MAAMA,IAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAChDC,GACC;AACD,UAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM,MAAAC,EAAA,IAASC,EAAW,EAAE,SAAAT,GAAS,OAAAC,GAAO,MAAAC,GAAM;AAEjE,WACC,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAL;AAAA,QACC,GAAGM,EAAqBP,GAAMQ,EAAO,UAAU;AAAA,QAE/C,UAAAb,uBACC,MAAA,EACA,UAAA;AAAA,UAAA,gBAAAW,EAAC,MAAA,EACA,UAAA,gBAAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACL;AAAA,cACf,GAAGL,IAAQ,EAAE,MAAMK,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,GAE1C;AAAA,UACCF,EAAM,IAAI,CAAC,EAAE,KAAAQ,GAAK,MAAAC,GAAM,SAAAf,QACxB,gBAAAU,EAAC,MAAA,EACC,UAAA,CAAC,CAACK,KACF,gBAAAL;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,gBAAcb;AAAAA,cACR,UAAUe;AAAA,cACf,GAAGZ,IAAQ,EAAE,MAAAY,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACnC,GANOD,CAQT,CACA;AAAA,4BACA,MAAA,EACA,UAAA,gBAAAJ;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACN;AAAA,cACf,GAAGJ,IAAQ,EAAE,MAAMI,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACzC,CACD;AAAA,QAAA,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;"}
1
+ {"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { pagination } from \"..\";\nimport type { DSPaginationElement } from \"../\";\nimport { Button } from \"../button/button\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type PaginationProps = Omit<\n\tCustomReactElementProps<DSPaginationElement>,\n\t\"children\"\n> & {\n\t\"data-variant\"?: \"primary\" | \"secondary\";\n} & (\n\t\t| {\n\t\t\t\tchildren?: never;\n\t\t\t\tcurrent: number;\n\t\t\t\tshow?: number;\n\t\t\t\ttotal: number;\n\t\t\t\tprops: (props: {\n\t\t\t\t\tpage: number;\n\t\t\t\t\ttype: \"prev\" | \"next\" | \"page\";\n\t\t\t\t}) => Parameters<typeof Button>[0];\n\t\t }\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcurrent?: never;\n\t\t\t\tshow?: never;\n\t\t\t\ttotal?: never;\n\t\t\t\tprops?: never;\n\t\t }\n\t);\n\nexport const Pagination = forwardRef<DSPaginationElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, current, total, show = 7, props, ...rest },\n\t\tref,\n\t) {\n\t\tconst { pages, next, prev } = pagination({ current, total, show });\n\n\t\treturn (\n\t\t\t<ds-pagination\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest, styles.pagination)}\n\t\t\t>\n\t\t\t\t{children || (\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!prev}\n\t\t\t\t\t\t\t\t{...props?.({ page: prev, type: \"prev\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{pages.map(({ key, page, current }) => (\n\t\t\t\t\t\t\t<li key={key}>\n\t\t\t\t\t\t\t\t{!!page && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\taria-current={current}\n\t\t\t\t\t\t\t\t\t\t{...{ children: page }}\n\t\t\t\t\t\t\t\t\t\t{...props?.({ page, type: \"page\" })}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!next}\n\t\t\t\t\t\t\t\t{...props?.({ page: next, type: \"next\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t</ds-pagination>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","toCustomElementProps","styles","Button","key","page"],"mappings":";;;;;;;AAiCO,MAAMA,IAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAChDC,GACC;AACD,UAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM,MAAAC,EAAA,IAASC,EAAW,EAAE,SAAAT,GAAS,OAAAC,GAAO,MAAAC,GAAM;AAEjE,WACC,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAL;AAAA,QACC,GAAGM,EAAqBP,GAAMQ,EAAO,UAAU;AAAA,QAE/C,UAAAb,uBACC,MAAA,EACA,UAAA;AAAA,UAAA,gBAAAW,EAAC,MAAA,EACA,UAAA,gBAAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACL;AAAA,cACf,GAAGL,IAAQ,EAAE,MAAMK,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,GAE1C;AAAA,UACCF,EAAM,IAAI,CAAC,EAAE,KAAAQ,GAAK,MAAAC,GAAM,SAAAf,QACxB,gBAAAU,EAAC,MAAA,EACC,UAAA,CAAC,CAACK,KACF,gBAAAL;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,gBAAcb;AAAAA,cACR,UAAUe;AAAA,cACf,GAAGZ,IAAQ,EAAE,MAAAY,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACnC,GANOD,CAQT,CACA;AAAA,4BACA,MAAA,EACA,UAAA,gBAAAJ;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACN;AAAA,cACf,GAAGJ,IAAQ,EAAE,MAAMI,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACzC,CACD;AAAA,QAAA,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;"}
@@ -15,3 +15,4 @@ export declare const Brevmal: Story;
15
15
  export declare const Rapportmal: Story;
16
16
  export declare const BrevmalReact: Story;
17
17
  export declare const RapportmalReact: Story;
18
+ export declare const Vedtak: Story;