@mattilsynet/design 3.3.4 → 3.3.5

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/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import "@u-elements/u-progress";
2
2
  export * from "@digdir/designsystemet-web";
3
- import { UHTMLComboboxElement as h, UHTMLComboboxShadowRoot as S, UHTMLComboboxStyle as T } from "./external/@u-elements/u-combobox/dist/u-combobox.js";
4
- import { version as y } from "./package.json.js";
5
- import { analytics as M } from "./analytics/analytics.js";
6
- import { toggleAppExpanded as I } from "./app/app-observer.js";
7
- import { fixLawHtml as B, getLawChecked as D, parseLawIds as R, parseLawMeta as v, setLawChecked as A, toggleLawChecked as N } from "./law/law-helper.js";
8
- import * as i from "./styles.module.css.js";
3
+ import { UHTMLComboboxElement as d, UHTMLComboboxShadowRoot as w, UHTMLComboboxStyle as H } from "./external/@u-elements/u-combobox/dist/u-combobox.js";
4
+ import { UHTMLDetailsElement as T, UHTMLDetailsShadowRoot as U, UHTMLDetailsStyle as b, UHTMLSummaryElement as n } from "./external/@u-elements/u-details/dist/u-details.js";
5
+ import { version as C } from "./package.json.js";
6
+ import { analytics as h } from "./analytics/analytics.js";
7
+ import { toggleAppExpanded as c } from "./app/app-observer.js";
8
+ import { fixLawHtml as k, getLawChecked as D, parseLawIds as u, parseLawMeta as R, setLawChecked as v, toggleLawChecked as A } from "./law/law-helper.js";
9
+ import * as t from "./styles.module.css.js";
9
10
  import { toast as _ } from "./toast/toast-helper.js";
10
11
  import "./chart/chart-element.js";
11
12
  import "./deprecations.js";
@@ -15,31 +16,24 @@ import "./table/table-observer.js";
15
16
  import "./toast/toast-observer.js";
16
17
  import "./tooltip/tooltip-element.js";
17
18
  import "./validation/validation-observer.js";
18
- import { isBrowser as e, onHotReload as r, onMutation as s } from "./utils.js";
19
- const a = e() ? document.getElementsByTagName("u-datalist") : [], t = /* @__PURE__ */ new WeakSet(), m = () => {
20
- for (const o of a)
21
- t.has(o) || (o.closest("ds-suggestion")?.connectedCallback(), t.add(o));
22
- };
23
- r("deprecations", () => [
24
- s(document, m, {
25
- childList: !0,
26
- subtree: !0
27
- })
28
- ]);
29
19
  export {
30
- h as UHTMLComboboxElement,
31
- S as UHTMLComboboxShadowRoot,
32
- T as UHTMLComboboxStyle,
33
- M as analytics,
34
- B as fixLawHtml,
20
+ d as UHTMLComboboxElement,
21
+ w as UHTMLComboboxShadowRoot,
22
+ H as UHTMLComboboxStyle,
23
+ T as UHTMLDetailsElement,
24
+ U as UHTMLDetailsShadowRoot,
25
+ b as UHTMLDetailsStyle,
26
+ n as UHTMLSummaryElement,
27
+ h as analytics,
28
+ k as fixLawHtml,
35
29
  D as getLawChecked,
36
- R as parseLawIds,
37
- v as parseLawMeta,
38
- A as setLawChecked,
39
- i as styles,
30
+ u as parseLawIds,
31
+ R as parseLawMeta,
32
+ v as setLawChecked,
33
+ t as styles,
40
34
  _ as toast,
41
- I as toggleAppExpanded,
42
- N as toggleLawChecked,
43
- y as version
35
+ c as toggleAppExpanded,
36
+ A as toggleLawChecked,
37
+ C as version
44
38
  };
45
39
  //# sourceMappingURL=index.js.map
package/mtds/index.js.map CHANGED
@@ -1 +1 @@
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 LISTED = new WeakSet();\nconst handleDatalistConnect = () => {\n\tfor (const list of LISTS)\n\t\tif (!LISTED.has(list)) {\n\t\t\tlist.closest(\"ds-suggestion\")?.connectedCallback();\n\t\t\tLISTED.add(list);\n\t\t}\n};\n\nonHotReload(\"deprecations\", () => [\n\tonMutation(document, handleDatalistConnect, {\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["LISTS","isBrowser","LISTED","handleDatalistConnect","list","onHotReload","onMutation"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,IAAQC,EAAA,IAAc,SAAS,qBAAqB,YAAY,IAAI,CAAA,GACpEC,wBAAa,QAAA,GACbC,IAAwB,MAAM;AACnC,aAAWC,KAAQJ;AAClB,IAAKE,EAAO,IAAIE,CAAI,MACnBA,EAAK,QAAQ,eAAe,GAAG,kBAAA,GAC/BF,EAAO,IAAIE,CAAI;AAElB;AAEAC,EAAY,gBAAgB,MAAM;AAAA,EACjCC,EAAW,UAAUH,GAAuB;AAAA,IAC3C,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- const o = "3.3.4";
1
+ const o = "3.3.5";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,28 +1,41 @@
1
1
  import { jsx as i, jsxs as u } from "react/jsx-runtime";
2
2
  import { forwardRef as h } from "react";
3
- import "../index.js";
4
- import { Button as n } from "../button/button.js";
5
- import x from "../styles.module.css.js";
3
+ import "@u-elements/u-progress";
4
+ import { pagination as x } from "@digdir/designsystemet-web";
5
+ import "../external/@u-elements/u-combobox/dist/u-combobox.js";
6
+ import "../external/@u-elements/u-details/dist/u-details.js";
7
+ import "../analytics/analytics.js";
8
+ import "../app/app-observer.js";
6
9
  import { toCustomElementProps as y } from "../utils.js";
7
- import { pagination as P } from "@digdir/designsystemet-web";
8
- const k = h(
9
- function({ children: a, current: m, total: p, show: l = 7, props: r, ...d }, c) {
10
- const { pages: s, next: e, prev: o } = P({ current: m, total: p, show: l });
10
+ import P from "../styles.module.css.js";
11
+ import "../toast/toast-helper.js";
12
+ import "../chart/chart-element.js";
13
+ import "../deprecations.js";
14
+ import "../logo/logo-observer.js";
15
+ import "../popover/popover-observer.js";
16
+ import "../table/table-observer.js";
17
+ import "../toast/toast-observer.js";
18
+ import "../tooltip/tooltip-element.js";
19
+ import "../validation/validation-observer.js";
20
+ import { Button as o } from "../button/button.js";
21
+ const N = h(
22
+ function({ children: n, current: e, total: a, show: l = 7, props: r, ...d }, c) {
23
+ const { pages: s, next: m, prev: p } = x({ current: e, total: a, show: l });
11
24
  return /* @__PURE__ */ i(
12
25
  "ds-pagination",
13
26
  {
14
27
  ref: c,
15
- ...y(d, x.pagination),
16
- children: a || /* @__PURE__ */ u("ul", { children: [
28
+ ...y(d, P.pagination),
29
+ children: n || /* @__PURE__ */ u("ul", { children: [
17
30
  /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
18
- n,
31
+ o,
19
32
  {
20
- "aria-disabled": !o,
21
- ...r?.({ page: o, type: "prev" })
33
+ "aria-disabled": !p,
34
+ ...r?.({ page: p, type: "prev" })
22
35
  }
23
36
  ) }),
24
37
  s.map(({ key: f, page: t, current: g }) => /* @__PURE__ */ i("li", { children: !!t && /* @__PURE__ */ i(
25
- n,
38
+ o,
26
39
  {
27
40
  "aria-current": g,
28
41
  children: t,
@@ -30,10 +43,10 @@ const k = h(
30
43
  }
31
44
  ) }, f)),
32
45
  /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
33
- n,
46
+ o,
34
47
  {
35
- "aria-disabled": !e,
36
- ...r?.({ page: e, type: "next" })
48
+ "aria-disabled": !m,
49
+ ...r?.({ page: m, type: "next" })
37
50
  }
38
51
  ) })
39
52
  ] })
@@ -42,6 +55,6 @@ const k = h(
42
55
  }
43
56
  );
44
57
  export {
45
- k as Pagination
58
+ N as Pagination
46
59
  };
47
60
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
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;"}
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;"}