@mattilsynet/design 0.3.4 → 0.3.6

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.
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,8 +1,16 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ parameters: {
5
+ layout: string;
6
+ };
7
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
8
+ [x: string]: any;
9
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
10
  };
5
11
  export default meta;
6
12
  type Story = StoryObj<typeof meta>;
7
13
  export declare const Default: Story;
14
+ export declare const Sizes: Story;
15
+ export declare const AsLink: Story;
8
16
  export declare const Tableish: Story;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,18 +1,19 @@
1
- import { on as d, QUICK_EVENT as c, attr as a, off as r } from "../utils.js";
2
- const e = ({ clientX: n, clientY: i, target: o }) => {
3
- if (o instanceof HTMLDialogElement && a(o, "data-closedby") === "any") {
4
- const { top: t, right: l, bottom: s, left: f } = o.getBoundingClientRect();
5
- t <= i && i <= s && f <= n && n <= l || o.close();
6
- }
1
+ import { on as l, QUICK_EVENT as i, attr as r, off as m } from "../utils.js";
2
+ const s = ({ clientX: o, clientY: n, target: t }) => {
3
+ var c;
4
+ if (t instanceof HTMLDialogElement && r(t, "data-closedby") === "any") {
5
+ const { top: e, right: a, bottom: f, left: d } = t.getBoundingClientRect();
6
+ e <= n && n <= f && d <= o && o <= a || t.close();
7
+ } else t instanceof Element && t.closest('button[data-command="close"]') && ((c = t == null ? void 0 : t.closest("dialog")) == null || c.close());
7
8
  };
8
- function m(n) {
9
- d(n, "click", e, c);
9
+ function u(o) {
10
+ l(o, "click", s, i);
10
11
  }
11
- function p(n) {
12
- r(n, "click", e, c);
12
+ function E(o) {
13
+ m(o, "click", s, i);
13
14
  }
14
15
  export {
15
- m as observe,
16
- p as unobserve
16
+ u as observe,
17
+ E as unobserve
17
18
  };
18
19
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.ts"],"sourcesContent":["import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleBackdropClick = ({ clientX: x, clientY: y, target }: MouseEvent) => {\n if (target instanceof HTMLDialogElement && attr(target, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = target.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n\n if (!isInside) target.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleBackdropClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleBackdropClick as EventListener, QUICK_EVENT);\n}"],"names":["handleBackdropClick","x","y","target","attr","top","right","bottom","left","observe","el","on","QUICK_EVENT","unobserve","off"],"mappings":";AAEA,MAAMA,IAAsB,CAAC,EAAE,SAASC,GAAG,SAASC,GAAG,QAAAC,QAAyB;AAC9E,MAAIA,aAAkB,qBAAqBC,EAAKD,GAAQ,eAAe,MAAM,OAAO;AAClF,UAAM,EAAE,KAAAE,GAAK,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAK,IAAIL,EAAO,sBAAsB;AAG9D,IAFaE,KAAOH,KAAKA,KAAKK,KAAUC,KAAQP,KAAKA,KAAKK,KAE/CH,EAAO,MAAM;AAAA,EAAA;AAEhC;AAEO,SAASM,EAAQC,GAAa;AAChC,EAAAC,EAAAD,GAAI,SAASV,GAAsCY,CAAW;AACnE;AAEO,SAASC,EAAUH,GAAa;AACjC,EAAAI,EAAAJ,GAAI,SAASV,GAAsCY,CAAW;AACpE;"}
1
+ {"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.ts"],"sourcesContent":["import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleClick = ({ clientX: x, clientY: y, target: el }: MouseEvent) => {\n if (el instanceof HTMLDialogElement && attr(el, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = el.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n \n if (!isInside) el.close();\n } else if (el instanceof Element && el.closest('button[data-command=\"close\"]')) {\n el?.closest('dialog')?.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}"],"names":["handleClick","x","y","el","attr","top","right","bottom","left","_a","observe","on","QUICK_EVENT","unobserve","off"],"mappings":";AAEA,MAAMA,IAAc,CAAC,EAAE,SAASC,GAAG,SAASC,GAAG,QAAQC,QAAqB;;AAC1E,MAAIA,aAAc,qBAAqBC,EAAKD,GAAI,eAAe,MAAM,OAAO;AAC1E,UAAM,EAAE,KAAAE,GAAK,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAK,IAAIL,EAAG,sBAAsB;AAG1D,IAFaE,KAAOH,KAAKA,KAAKK,KAAUC,KAAQP,KAAKA,KAAKK,KAE/CH,EAAG,MAAM;AAAA,EAAA,OACfA,aAAc,WAAWA,EAAG,QAAQ,8BAA8B,OACvEM,IAAAN,KAAA,gBAAAA,EAAA,QAAQ,cAAR,QAAAM,EAAmB;AAE3B;AAEO,SAASC,EAAQP,GAAa;AAChC,EAAAQ,EAAAR,GAAI,SAASH,GAA8BY,CAAW;AAC3D;AAEO,SAASC,EAAUV,GAAa;AACjC,EAAAW,EAAAX,GAAI,SAASH,GAA8BY,CAAW;AAC5D;"}
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,40 +1,44 @@
1
- import f from "../styles.module.css.js";
2
- import { onMutation as c, on as I, QUICK_EVENT as u, isInputLike as d, attr as r, off as g, useId as l } from "../utils.js";
3
- const m = f.field.split(" ")[0], b = f.validation.split(" "), L = b[0];
4
- function h(t) {
5
- for (const i of t) {
6
- const s = [], o = [];
7
- let n = null, a = !0;
8
- for (const e of i.getElementsByTagName("*"))
9
- e instanceof HTMLLabelElement ? s.push(e) : d(e) ? n = e : e.classList.contains(L) ? (a = e.getAttribute("data-color") === "success", o.unshift(l(e))) : e instanceof HTMLParagraphElement && o.push(l(e));
10
- if (n) {
11
- for (const e of s) e.htmlFor = l(n);
12
- p(n), r(n, "aria-describedby", o.join(" ")), r(n, "aria-invalid", `${!a}`);
1
+ import d from "../styles.module.css.js";
2
+ import { onMutation as v, on as c, QUICK_EVENT as m, isInputLike as b, attr as r, off as u, useId as l } from "../utils.js";
3
+ const f = d.field.split(" ")[0], p = d.validation.split(" "), L = p[0];
4
+ function A(t) {
5
+ for (const e of t) {
6
+ const o = [], s = [];
7
+ let i = null, a = !0;
8
+ for (const n of e.getElementsByTagName("*"))
9
+ n instanceof HTMLLabelElement ? o.push(n) : b(n) ? i = n : n.classList.contains(L) ? (a = n.getAttribute("data-color") === "success", s.unshift(l(n))) : n instanceof HTMLParagraphElement && s.push(l(n));
10
+ if (i) {
11
+ for (const n of o) n.htmlFor = l(i);
12
+ g(i), r(i, "aria-describedby", s.join(" ")), r(i, "aria-invalid", `${!a}`);
13
13
  }
14
14
  }
15
15
  }
16
- function v({ target: t }) {
17
- d(t) && p(t);
16
+ function I({ target: t }) {
17
+ b(t) && g(t);
18
18
  }
19
- function p(t) {
20
- const i = t == null ? void 0 : t.nextElementSibling, s = i == null ? void 0 : i.getAttribute("data-count");
21
- if (i && s) {
22
- const o = Number(s) - t.value.length, n = o < 0;
23
- if (i.getAttribute("aria-live") === "polite" !== n) {
24
- r(i, "aria-live", n ? "polite" : "off");
25
- for (const e of b) i.classList.toggle(e, n);
19
+ function g(t) {
20
+ const e = t == null ? void 0 : t.nextElementSibling, o = e == null ? void 0 : e.getAttribute("data-count");
21
+ if (e && o) {
22
+ const s = Number(o) - t.value.length, i = s < 0;
23
+ if (e.getAttribute("aria-live") === "polite" !== i) {
24
+ r(e, "aria-live", i ? "polite" : "off");
25
+ for (const n of p) e.classList.toggle(n, i);
26
26
  }
27
- i.textContent = `${Math.abs(o)} tegn ${n ? "for mye" : "igjen"}`;
27
+ e.textContent = `${Math.abs(s)} tegn ${i ? "for mye" : "igjen"}`;
28
28
  }
29
29
  }
30
- function E(t) {
31
- c(t, m, h), I(t, "input", v, u);
30
+ function h(t) {
31
+ var e, o;
32
+ (o = (e = t.target) == null ? void 0 : e.closest) != null && o.call(e, `.${f}`) && t.preventDefault();
32
33
  }
33
34
  function C(t) {
34
- c(t, m, !1), g(t, "input", v, u);
35
+ v(t, f, A), c(t, "input", I, m), c(t, "invalid", h, !0);
36
+ }
37
+ function T(t) {
38
+ v(t, f, !1), u(t, "input", I, m), u(t, "invalid", h, !0);
35
39
  }
36
40
  export {
37
- E as observe,
38
- C as unobserve
41
+ C as observe,
42
+ T as unobserve
39
43
  };
40
44
  //# sourceMappingURL=field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sources":["../../designsystem/field/field.ts"],"sourcesContent":["import styles from '../styles.module.css';\nimport { QUICK_EVENT, attr, isInputLike, off, on, onMutation, useId } from '../utils';\n\nconst CSS_FIELD = styles.field.split(' ')[0];\nconst CSS_VALIDATIONS = styles.validation.split(' ');\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for(const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName('*')) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) { // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = el.getAttribute('data-color') === 'success';\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, 'aria-describedby', descs.join(' '));\n attr(input, 'aria-invalid', `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el?.getAttribute('data-count');\n\n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = el.getAttribute('aria-live') === 'polite';\n\n if (prevInvalid !== nextInvalid) {\n attr(el, 'aria-live', nextInvalid ? 'polite' : 'off');\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = `${Math.abs(remainder)} tegn ${nextInvalid ? 'for mye' : 'igjen'}`;\n }\n}\n\nexport function observe (el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, 'input', handleInput, QUICK_EVENT);\n}\n\nexport function unobserve (el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, 'input', handleInput, QUICK_EVENT);\n}\n"],"names":["CSS_FIELD","styles","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","el","isInputLike","useId","label","renderCounter","attr","handleInput","target","limit","remainder","nextInvalid","css","observe","onMutation","on","QUICK_EVENT","unobserve","off"],"mappings":";;AAGA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC,GACrCC,IAAkBD,EAAO,WAAW,MAAM,GAAG,GAC7CE,IAAiBD,EAAgB,CAAC;AAExC,SAASE,EAAWC,GAAmC;AACrD,aAAUC,KAASD,GAAQ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,EAAAa,EAAAb,GAAIX,GAAWI,CAAU,GACjCqB,EAAAd,GAAI,SAASM,GAAaS,CAAW;AAC1C;AAEO,SAASC,EAAWhB,GAAa;AAC3B,EAAAa,EAAAb,GAAIX,GAAW,EAAK,GAC3B4B,EAAAjB,GAAI,SAASM,GAAaS,CAAW;AAC3C;"}
1
+ {"version":3,"file":"field.js","sources":["../../designsystem/field/field.ts"],"sourcesContent":["import styles from '../styles.module.css';\nimport { QUICK_EVENT, attr, isInputLike, off, on, onMutation, useId } from '../utils';\n\nconst CSS_FIELD = styles.field.split(' ')[0];\nconst CSS_VALIDATIONS = styles.validation.split(' ');\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for(const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName('*')) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) { // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = el.getAttribute('data-color') === 'success';\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, 'aria-describedby', descs.join(' '));\n attr(input, 'aria-invalid', `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el?.getAttribute('data-count');\n\n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = el.getAttribute('aria-live') === 'polite';\n\n if (prevInvalid !== nextInvalid) {\n attr(el, 'aria-live', nextInvalid ? 'polite' : 'off');\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = `${Math.abs(remainder)} tegn ${nextInvalid ? 'for mye' : 'igjen'}`;\n }\n}\n\n// Prevent browsers from showing default validation bubbles\nfunction handleInvalid(event: Event) {\n if ((event.target as Element)?.closest?.(`.${CSS_FIELD}`)) event.preventDefault();\n}\n\nexport function observe (el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, 'input', handleInput, QUICK_EVENT);\n on(el, 'invalid', handleInvalid, true); // Use capture as invalid does noe buttle\n}\n\nexport function unobserve (el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, 'input', handleInput, QUICK_EVENT);\n off(el, 'invalid', handleInvalid, true);\n}\n"],"names":["CSS_FIELD","styles","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","el","isInputLike","useId","label","renderCounter","attr","handleInput","target","limit","remainder","nextInvalid","css","handleInvalid","event","_b","_a","observe","onMutation","on","QUICK_EVENT","unobserve","off"],"mappings":";;AAGA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC,GACrCC,IAAkBD,EAAO,WAAW,MAAM,GAAG,GAC7CE,IAAiBD,EAAgB,CAAC;AAExC,SAASE,EAAWC,GAAmC;AACrD,aAAUC,KAASD,GAAQ;AACzB,UAAME,IAA6B,CAAC,GAC9BC,IAAkB,CAAC;AACzB,QAAIC,IAAiC,MACjCC,IAAQ;AAEZ,eAAWC,KAAML,EAAM,qBAAqB,GAAG;AAC7C,MAAIK,aAAc,mBAAyBJ,EAAA,KAAKI,CAAE,IACzCC,EAAYD,CAAE,IAAWF,IAAAE,IACzBA,EAAG,UAAU,SAASR,CAAc,KACnCO,IAAAC,EAAG,aAAa,YAAY,MAAM,WACpCH,EAAA,QAAQK,EAAMF,CAAE,CAAC,KACdA,aAAc,0BAA4B,KAAKE,EAAMF,CAAE,CAAC;AAGrE,QAAIF,GAAO;AACT,iBAAWK,KAASP,EAAc,CAAAO,EAAA,UAAUD,EAAMJ,CAAK;AACvD,MAAAM,E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
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,2 +1,2 @@
1
- var mtds=function(p){"use strict";const y=typeof window<"u"&&typeof document<"u",c={capture:!0,passive:!0};function d(t,e,o){return o===void 0?t.getAttribute(e)??null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}let Ot=0;const kt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function S(t){return t.id||(t.id=`${kt}${++Ot}`),t.id}const O=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,e[`${t}EventListener`](...o)},r=(t,...e)=>O("add",t,e),h=(t,...e)=>O("remove",t,e),M=new Map,_=y?document.createElement("div"):null;_&&d(_,"style","position:absolute;padding:1px;top:0;left:0px"),y&&r(window,"load,resize,scroll",()=>{for(const[t,e]of M)e()},c);const b={top:0,right:1,bottom:2,left:3};function w(t,e,o){var Ct;if(!e||!e.isConnected||!t.isConnected)return M.delete(t);if(_!=null&&_.isConnected||document.body.append(_||""),!M.has(t)){const ge=b[o]??b.bottom;return(Ct=M.set(t,()=>w(t,e,ge)).get(t))==null?void 0:Ct()}const{offsetWidth:n,offsetHeight:s}=t,{offsetWidth:a,offsetHeight:i}=e,{width:g,height:C,left:ce,top:de}=e.getBoundingClientRect(),T=Math.round(ce-(a-g)/2),v=Math.round(de-(i-C)/2),le=T-n>0,re=a+a+n<window.innerWidth,_e=v-s>0,fe=v+i+s<window.innerHeight,ue=o===b.bottom&&re||!le,pe=o===b.bottom&&fe||!_e,be=Math.min(Math.max(10,T-(n-a)/2),window.innerWidth-n-10),me=Math.min(Math.max(10,v-(s-i)/2),window.innerHeight-s-10),$t=o===b.top||o===b.bottom;t.style.left=`${Math.round($t?be:ue?T+a:T-n)}px`,t.style.top=`${Math.round($t?pe?v+i:v-s:me)}px`,_==null||_.style.setProperty("translate",`${Math.round(window.scrollX+T+a+n+30)} ${Math.round(window.scrollY+v+i+s+30)}px`)}function Bt(t){let e=0;const o=()=>setTimeout(n,200),n=()=>{t([],s),e=0},s=new MutationObserver(()=>{e||(e=requestAnimationFrame(o))});return s}const L=new WeakMap,Pt=t=>{var o;const e=L.get(t);if(!e||!t.isConnected)(o=e==null?void 0:e.observer)==null||o.disconnect(),L.delete(t);else for(const[,n]of e.collections)n()},m=(t,e,o)=>{const n=t.getElementsByClassName(e);let s=L.get(t);s||(s={collections:new Map,observer:Bt(()=>Pt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),L.set(t,s)),o?s.collections.set(e,()=>o(n)):s.collections.delete(e)},I=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),k=({clientX:t,clientY:e,target:o})=>{if(o instanceof HTMLDialogElement&&d(o,"data-closedby")==="any"){const{top:n,right:s,bottom:a,left:i}=o.getBoundingClientRect();n<=e&&e<=a&&i<=t&&t<=s||o.close()}};function xt(t){r(t,"click",k,c)}function Dt(t){h(t,"click",k,c)}const B="_alert_1aace_1 _ds-alert_1w6ss_1",P="_avatar_1aace_1 _ds-avatar_1w6ss_1",x="_badge_1aace_1",D="_breadcrumbs_1aace_1 _ds-breadcrumbs_1w6ss_1",H="_button_1aace_1 _ds-button_1w6ss_1",N="_card_1aace_1",V="_chip_1aace_1 _ds-chip_1w6ss_1",Y="_details_1aace_1 _ds-details_1w6ss_1",R="_dialog_1aace_1 _ds-modal_1w6ss_1",U="__fadein_1aace_1",W="_divider_1aace_1",F="_errorsummary_1aace_1 _ds-error-summary_1w6ss_1",j="_field_1aace_1 _ds-field_1w6ss_1",G="_affixes_1aace_1 _ds-field-affixes_1w6ss_1",X="_count_1aace_1",q="_fieldset_1aace_1 _ds-fieldset_1w6ss_1",z="_heading_1aace_1 _ds-heading_1w6ss_1",K="_input_1aace_1 _ds-input_1w6ss_1",Q="_grid_1aace_1",J="_flex_1aace_1",Z="_app_1aace_1",tt="_link_1aace_1",et="_logo_1aace_1 _ds-focus_1w6ss_1",ot="_pagination_1aace_1 _ds-pagination_1w6ss_1",nt="_popover_1aace_1",st="_skeleton_1aace_1 _ds-skeleton_1w6ss_1",it="_spinner_1aace_1",at="_table_1aace_1 _ds-table_1w6ss_1",ct="__scrollShadow_1aace_1",dt="_tabs_1aace_1 _ds-tabs_1w6ss_1",lt="_tag_1aace_1 _ds-tag_1w6ss_1",rt="__tooltip_1aace_1",_t="_validation_1aace_1 _ds-validation-message_1w6ss_1",ft="_body_1aace_139",f={alert:B,avatar:P,badge:x,breadcrumbs:D,button:H,card:N,chip:V,details:Y,dialog:R,_fadein:U,divider:W,errorsummary:F,field:j,affixes:G,count:X,fieldset:q,heading:z,input:K,grid:Q,flex:J,app:Z,link:tt,logo:et,pagination:ot,popover:nt,skeleton:st,spinner:it,table:at,_scrollShadow:ct,tabs:dt,tag:lt,_tooltip:rt,validation:_t,body:ft},Ht=Object.freeze(Object.defineProperty({__proto__:null,_fadein:U,_scrollShadow:ct,_tooltip:rt,affixes:G,alert:B,app:Z,avatar:P,badge:x,body:ft,breadcrumbs:D,button:H,card:N,chip:V,count:X,default:f,details:Y,dialog:R,divider:W,errorsummary:F,field:j,fieldset:q,flex:J,grid:Q,heading:z,input:K,link:tt,logo:et,pagination:ot,popover:nt,skeleton:st,spinner:it,table:at,tabs:dt,tag:lt,validation:_t},Symbol.toStringTag,{value:"Module"})),ut=f.field.split(" ")[0],pt=f.validation.split(" "),Nt=pt[0];function Vt(t){for(const e of t){const o=[],n=[];let s=null,a=!0;for(const i of e.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):I(i)?s=i:i.classList.contains(Nt)?(a=i.getAttribute("data-color")==="success",n.unshift(S(i))):i instanceof HTMLParagraphElement&&n.push(S(i));if(s){for(const i of o)i.htmlFor=S(s);mt(s),d(s,"aria-describedby",n.join(" ")),d(s,"aria-invalid",`${!a}`)}}}function bt({target:t}){I(t)&&mt(t)}function mt(t){const e=t==null?void 0:t.nextElementSibling,o=e==null?void 0:e.getAttribute("data-count");if(e&&o){const n=Number(o)-t.value.length,s=n<0;if(e.getAttribute("aria-live")==="polite"!==s){d(e,"aria-live",s?"polite":"off");for(const i of pt)e.classList.toggle(i,s)}e.textContent=`${Math.abs(n)} tegn ${s?"for mye":"igjen"}`}}function Yt(t){m(t,ut,Vt),r(t,"input",bt,c)}function Rt(t){m(t,ut,!1),h(t,"input",bt,c)}const gt=f.fieldset.split(" ")[0],Ut=f.validation.split(" ")[0];function Wt(t){for(const e of t){const o=[];let n="";for(const s of e.getElementsByTagName("*"))s.classList.contains(Ut)?n=S(s):I(s)&&o.push(s);if(n)for(const s of o)d(s,"aria-describedby",n),d(s,"aria-invalid","true")}}const Ft=t=>m(t,gt,Wt),jt=t=>m(t,gt,!1),vt=f.app.split(" ")[0],Gt=`.${vt} > header + :not(main) > button:empty:first-child`,ht=({target:t})=>{const e=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(Gt));if(!e)return;const o=e.closest(`.${vt} > *`),n=()=>o==null?void 0:o.setAttribute("data-expanded",`${(o==null?void 0:o.getAttribute("data-expanded"))==="false"}`);document.startViewTransition?document.startViewTransition(()=>n()):n()};function Xt(t){r(t,"click",ht,c)}function qt(t){h(t,"click",ht,c)}function zt(t){r(t,"toggle",Tt,c),r(t,"click",yt)}function Kt(t){h(t,"toggle",Tt,c),h(t,"click",yt)}const wt=f.popover.split(" ")[0];function Tt({target:t,newState:e}){var o;if(t instanceof HTMLElement&&t.classList.contains(wt)){const n=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?w(t,!1):n&&w(t,n,t.getAttribute("data-position")||"bottom")}}function yt({target:t}){var o,n;const e=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(e){const s=e.getRootNode(),a=((n=s.getElementById)==null?void 0:n.call(s,d(e,"popovertarget")||""))||e.closest(`.${wt}`),i=d(e,"popovertargetaction")||"toggle";a==null||a.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const St=f.table.split(" ")[0];function Qt(t){var e,o;for(const n of t)if(n instanceof HTMLTableElement){const s=Array.from(((o=(e=n.tHead)==null?void 0:e.rows[0])==null?void 0:o.cells)||[],a=>{var i;return(i=a.innerText)==null?void 0:i.trim()});for(const a of n.tBodies)for(const i of a.rows)for(const g of i.cells)d(g,"data-th",s[g.cellIndex]||":empty")}}const Jt=t=>m(t,St,Qt),Zt=t=>m(t,St,!1),te=f._tooltip.split(" "),Mt="aria-describedby",Lt="Escape",A="aria-labelledby",ee="--mtds-tooltip-position",oe=100,E="mtds-tooltip";let u=null,At=Number.NEGATIVE_INFINITY,Et=0,l=null;function $({target:t,type:e,key:o}){if(e==="keydown"&&o!==Lt)return;const n=At+oe-Date.now();clearTimeout(Et),Et=setTimeout(ne,Math.max(n,0),o===Lt?null:t)}function ne(t){var a;if(At=Date.now(),!l||t===l)return;let e=((a=t==null?void 0:t.closest)==null?void 0:a.call(t,"[data-tooltip]"))||null;if(e===u)return;const o=(e==null?void 0:e.getAttribute("data-tooltip"))||"",n=(e==null?void 0:e.getAttribute("data-tooltip-position"))||window.getComputedStyle(e||document.body).getPropertyValue(ee)||"top",s=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(A))||(e==null?void 0:e.hasAttribute("aria-label"));(!o||o==="false"||o==="true"||n==="none")&&(e=null),e&&(l.textContent=o),u==null||u.removeAttribute(u.getAttribute(A)===E?A:Mt),w(l,!1),u=e,u==null||u.setAttribute(s?Mt:A,E),l.togglePopover(!!e),w(l,e,n)}y&&!document.getElementById(E)&&(l=document.body.appendChild(document.createElement("div")),l.classList.add(...te),l.id=E,d(l,"popover","manual"),r(document,"blur,focus,mouseout,mouseover",$,c),r(window,"keydown",$,c),r(window,"blur",$,c));const se=(t,e,o)=>{const n=(o-1)/2,s=Math.max(Math.min(t-Math.floor(n),e-o+1),1),a=Math.min(Math.max(t+Math.ceil(n),o),e),i=Array.from({length:a+1-s},(g,C)=>C+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&a<e&&i.splice(-2,2,0,e),i},ie=({current:t=1,total:e=10,show:o=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:se(t,e,o).map((n,s)=>({current:n===t&&"page",key:`key-${n}-${s}`,page:n}))});if(y){const t=document.readyState==="loading",e=()=>It(document.body);t?document.addEventListener("DOMContentLoaded",e):e()}function It(t){xt(t),Yt(t),Ft(t),Xt(t),zt(t),Jt(t)}function ae(t){Dt(t),Rt(t),jt(t),qt(t),Kt(t),Zt(t)}return p.observe=It,p.pagination=ie,p.styles=Ht,p.unobserve=ae,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
1
+ var mtds=function(b){"use strict";const y=typeof window<"u"&&typeof document<"u",c={capture:!0,passive:!0};function d(t,e,o){return o===void 0?t.getAttribute(e)??null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}let kt=0;const Pt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function S(t){return t.id||(t.id=`${Pt}${++kt}`),t.id}const k=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,e[`${t}EventListener`](...o)},l=(t,...e)=>k("add",t,e),m=(t,...e)=>k("remove",t,e),M=new Map,_=y?document.createElement("div"):null;_&&d(_,"style","position:absolute;padding:1px;top:0;left:0px"),y&&l(window,"load,resize,scroll",()=>{for(const[t,e]of M)e()},c);const g={top:0,right:1,bottom:2,left:3};function w(t,e,o){var Ot;if(!e||!e.isConnected||!t.isConnected)return M.delete(t);if(_!=null&&_.isConnected||document.body.append(_||""),!M.has(t)){const ve=g[o]??g.bottom;return(Ot=M.set(t,()=>w(t,e,ve)).get(t))==null?void 0:Ot()}const{offsetWidth:n,offsetHeight:s}=t,{offsetWidth:a,offsetHeight:i}=e,{width:p,height:A,left:de,top:le}=e.getBoundingClientRect(),T=Math.round(de-(a-p)/2),h=Math.round(le-(i-A)/2),re=T-n>0,_e=a+a+n<window.innerWidth,fe=h-s>0,ue=h+i+s<window.innerHeight,pe=o===g.bottom&&_e||!re,be=o===g.bottom&&ue||!fe,me=Math.min(Math.max(10,T-(n-a)/2),window.innerWidth-n-10),ge=Math.min(Math.max(10,h-(s-i)/2),window.innerHeight-s-10),Ct=o===g.top||o===g.bottom;t.style.left=`${Math.round(Ct?me:pe?T+a:T-n)}px`,t.style.top=`${Math.round(Ct?be?h+i:h-s:ge)}px`,_==null||_.style.setProperty("translate",`${Math.round(window.scrollX+T+a+n+30)} ${Math.round(window.scrollY+h+i+s+30)}px`)}function xt(t){let e=0;const o=()=>setTimeout(n,200),n=()=>{t([],s),e=0},s=new MutationObserver(()=>{e||(e=requestAnimationFrame(o))});return s}const L=new WeakMap,Bt=t=>{var o;const e=L.get(t);if(!e||!t.isConnected)(o=e==null?void 0:e.observer)==null||o.disconnect(),L.delete(t);else for(const[,n]of e.collections)n()},v=(t,e,o)=>{const n=t.getElementsByClassName(e);let s=L.get(t);s||(s={collections:new Map,observer:xt(()=>Bt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),L.set(t,s)),o?s.collections.set(e,()=>o(n)):s.collections.delete(e)},$=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),P=({clientX:t,clientY:e,target:o})=>{var n;if(o instanceof HTMLDialogElement&&d(o,"data-closedby")==="any"){const{top:s,right:a,bottom:i,left:p}=o.getBoundingClientRect();s<=e&&e<=i&&p<=t&&t<=a||o.close()}else o instanceof Element&&o.closest('button[data-command="close"]')&&((n=o==null?void 0:o.closest("dialog"))==null||n.close())};function Dt(t){l(t,"click",P,c)}function Ht(t){m(t,"click",P,c)}const x="_alert_1aace_1 _ds-alert_1w6ss_1",B="_avatar_1aace_1 _ds-avatar_1w6ss_1",D="_badge_1aace_1",H="_breadcrumbs_1aace_1 _ds-breadcrumbs_1w6ss_1",N="_button_1aace_1 _ds-button_1w6ss_1",V="_card_1aace_1",Y="_chip_1aace_1 _ds-chip_1w6ss_1",R="_details_1aace_1 _ds-details_1w6ss_1",U="_dialog_1aace_1 _ds-modal_1w6ss_1",W="__fadein_1aace_1",F="_divider_1aace_1",j="_errorsummary_1aace_1 _ds-error-summary_1w6ss_1",G="_field_1aace_1 _ds-field_1w6ss_1",X="_affixes_1aace_1 _ds-field-affixes_1w6ss_1",q="_count_1aace_1",z="_fieldset_1aace_1 _ds-fieldset_1w6ss_1",K="_heading_1aace_1 _ds-heading_1w6ss_1",Q="_input_1aace_1 _ds-input_1w6ss_1",J="_grid_1aace_1",Z="_flex_1aace_1",tt="_app_1aace_1",et="_link_1aace_1",ot="_logo_1aace_1 _ds-focus_1w6ss_1",nt="_pagination_1aace_1 _ds-pagination_1w6ss_1",st="_popover_1aace_1",it="_skeleton_1aace_1 _ds-skeleton_1w6ss_1",at="_spinner_1aace_1",ct="_table_1aace_1 _ds-table_1w6ss_1",dt="__scrollShadow_1aace_1",lt="_tabs_1aace_1 _ds-tabs_1w6ss_1",rt="_tag_1aace_1 _ds-tag_1w6ss_1",_t="__tooltip_1aace_1",ft="_validation_1aace_1 _ds-validation-message_1w6ss_1",ut="_body_1aace_139",f={alert:x,avatar:B,badge:D,breadcrumbs:H,button:N,card:V,chip:Y,details:R,dialog:U,_fadein:W,divider:F,errorsummary:j,field:G,affixes:X,count:q,fieldset:z,heading:K,input:Q,grid:J,flex:Z,app:tt,link:et,logo:ot,pagination:nt,popover:st,skeleton:it,spinner:at,table:ct,_scrollShadow:dt,tabs:lt,tag:rt,_tooltip:_t,validation:ft,body:ut},Nt=Object.freeze(Object.defineProperty({__proto__:null,_fadein:W,_scrollShadow:dt,_tooltip:_t,affixes:X,alert:x,app:tt,avatar:B,badge:D,body:ut,breadcrumbs:H,button:N,card:V,chip:Y,count:q,default:f,details:R,dialog:U,divider:F,errorsummary:j,field:G,fieldset:z,flex:Z,grid:J,heading:K,input:Q,link:et,logo:ot,pagination:nt,popover:st,skeleton:it,spinner:at,table:ct,tabs:lt,tag:rt,validation:ft},Symbol.toStringTag,{value:"Module"})),C=f.field.split(" ")[0],pt=f.validation.split(" "),Vt=pt[0];function Yt(t){for(const e of t){const o=[],n=[];let s=null,a=!0;for(const i of e.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):$(i)?s=i:i.classList.contains(Vt)?(a=i.getAttribute("data-color")==="success",n.unshift(S(i))):i instanceof HTMLParagraphElement&&n.push(S(i));if(s){for(const i of o)i.htmlFor=S(s);mt(s),d(s,"aria-describedby",n.join(" ")),d(s,"aria-invalid",`${!a}`)}}}function bt({target:t}){$(t)&&mt(t)}function mt(t){const e=t==null?void 0:t.nextElementSibling,o=e==null?void 0:e.getAttribute("data-count");if(e&&o){const n=Number(o)-t.value.length,s=n<0;if(e.getAttribute("aria-live")==="polite"!==s){d(e,"aria-live",s?"polite":"off");for(const i of pt)e.classList.toggle(i,s)}e.textContent=`${Math.abs(n)} tegn ${s?"for mye":"igjen"}`}}function gt(t){var e,o;(o=(e=t.target)==null?void 0:e.closest)!=null&&o.call(e,`.${C}`)&&t.preventDefault()}function Rt(t){v(t,C,Yt),l(t,"input",bt,c),l(t,"invalid",gt,!0)}function Ut(t){v(t,C,!1),m(t,"input",bt,c),m(t,"invalid",gt,!0)}const vt=f.fieldset.split(" ")[0],Wt=f.validation.split(" ")[0];function Ft(t){for(const e of t){const o=[];let n="";for(const s of e.getElementsByTagName("*"))s.classList.contains(Wt)?n=S(s):$(s)&&o.push(s);if(n)for(const s of o)d(s,"aria-describedby",n),d(s,"aria-invalid","true")}}const jt=t=>v(t,vt,Ft),Gt=t=>v(t,vt,!1),ht=f.app.split(" ")[0],Xt=`.${ht} > header + :not(main) > button:empty:first-child`,wt=({target:t})=>{const e=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(Xt));if(!e)return;const o=e.closest(`.${ht} > *`),n=()=>o==null?void 0:o.setAttribute("data-expanded",`${(o==null?void 0:o.getAttribute("data-expanded"))==="false"}`);document.startViewTransition?document.startViewTransition(()=>n()):n()};function qt(t){l(t,"click",wt,c)}function zt(t){m(t,"click",wt,c)}function Kt(t){l(t,"toggle",yt,c),l(t,"click",St)}function Qt(t){m(t,"toggle",yt,c),m(t,"click",St)}const Tt=f.popover.split(" ")[0];function yt({target:t,newState:e}){var o;if(t instanceof HTMLElement&&t.classList.contains(Tt)){const n=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?w(t,!1):n&&w(t,n,t.getAttribute("data-position")||"bottom")}}function St({target:t}){var o,n;const e=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(e){const s=e.getRootNode(),a=((n=s.getElementById)==null?void 0:n.call(s,d(e,"popovertarget")||""))||e.closest(`.${Tt}`),i=d(e,"popovertargetaction")||"toggle";a==null||a.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const Mt=f.table.split(" ")[0];function Jt(t){var e,o;for(const n of t)if(n instanceof HTMLTableElement){const s=Array.from(((o=(e=n.tHead)==null?void 0:e.rows[0])==null?void 0:o.cells)||[],a=>{var i;return(i=a.innerText)==null?void 0:i.trim()});for(const a of n.tBodies)for(const i of a.rows)for(const p of i.cells)d(p,"data-th",s[p.cellIndex]||":empty")}}const Zt=t=>v(t,Mt,Jt),te=t=>v(t,Mt,!1),ee=f._tooltip.split(" "),Lt="aria-describedby",Et="Escape",E="aria-labelledby",oe="--mtds-tooltip-position",ne=100,I="mtds-tooltip";let u=null,It=Number.NEGATIVE_INFINITY,At=0,r=null;function O({target:t,type:e,key:o}){if(e==="keydown"&&o!==Et)return;const n=It+ne-Date.now();clearTimeout(At),At=setTimeout(se,Math.max(n,0),o===Et?null:t)}function se(t){var a;if(It=Date.now(),!r||t===r)return;let e=((a=t==null?void 0:t.closest)==null?void 0:a.call(t,"[data-tooltip]"))||null;if(e===u)return;const o=(e==null?void 0:e.getAttribute("data-tooltip"))||"",n=(e==null?void 0:e.getAttribute("data-tooltip-position"))||window.getComputedStyle(e||document.body).getPropertyValue(oe)||"top",s=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(E))||(e==null?void 0:e.hasAttribute("aria-label"));(!o||o==="false"||o==="true"||n==="none")&&(e=null),e&&(r.textContent=o),u==null||u.removeAttribute(u.getAttribute(E)===I?E:Lt),w(r,!1),u=e,u==null||u.setAttribute(s?Lt:E,I),r.togglePopover(!!e),w(r,e,n)}y&&!document.getElementById(I)&&(r=document.body.appendChild(document.createElement("div")),r.classList.add(...ee),r.id=I,d(r,"popover","manual"),l(document,"blur,focus,mouseout,mouseover",O,c),l(window,"keydown",O,c),l(window,"blur",O,c));const ie=(t,e,o)=>{const n=(o-1)/2,s=Math.max(Math.min(t-Math.floor(n),e-o+1),1),a=Math.min(Math.max(t+Math.ceil(n),o),e),i=Array.from({length:a+1-s},(p,A)=>A+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&a<e&&i.splice(-2,2,0,e),i},ae=({current:t=1,total:e=10,show:o=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:ie(t,e,o).map((n,s)=>({current:n===t&&"page",key:`key-${n}-${s}`,page:n}))});if(y){const t=document.readyState==="loading",e=()=>$t(document.body);t?document.addEventListener("DOMContentLoaded",e):e()}function $t(t){Dt(t),Rt(t),jt(t),qt(t),Kt(t),Zt(t)}function ce(t){Ht(t),Ut(t),Gt(t),zt(t),Qt(t),te(t)}return b.observe=$t,b.pagination=ae,b.styles=Nt,b.unobserve=ce,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b}({});
2
2
  //# sourceMappingURL=index.iife.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.iife.js","sources":["../designsystem/utils.ts","../designsystem/dialog/dialog.ts","../designsystem/field/field.ts","../designsystem/fieldset/fieldset.ts","../designsystem/layout/layout.ts","../designsystem/popover/popover.ts","../designsystem/table/table.ts","../designsystem/tooltip/tooltip.ts","../designsystem/pagination/pagination.ts","../designsystem/index.ts"],"sourcesContent":["export const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\nexport const QUICK_EVENT = { capture: true, passive: true };\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to use as EventTarget\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport function attr(\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n}\n\n/**\n * useId\n * @return A generated unique ID\n */\nlet id = 0;\nconst UUID = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;\nexport function useId (el: Element) {\n if (!el.id) el.id = `${UUID}${++id}`;\n\treturn el.id;\n};\n\n// Internal helper for on / off\nconst events = (\n\taction: \"add\" | \"remove\",\n\telement: Node | Window,\n\trest: Parameters<typeof Element.prototype.addEventListener>,\n): void => {\n\tfor (const type of rest[0].split(\",\")) {\n\t\trest[0] = type;\n\t\telement[`${action}EventListener`](...rest);\n\t}\n};\n\n/**\n * on\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): void => events(\"add\", element, rest);\n\n/**\n * off\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => events(\"remove\", element, rest);\n\n\nconst TARGETS = new Map<Element, () => void>(); // Store current open poppers and their update functions\nconst SCROLLER = IS_BROWSER ? document.createElement('div') : null // Used to ensure we have scrollability under\nif (SCROLLER) attr(SCROLLER, 'style', 'position:absolute;padding:1px;top:0;left:0px');\n\nif (IS_BROWSER){\n\ton(window, 'load,resize,scroll', () => {\n\t\tfor (const [_, update] of TARGETS) update();\n\t}, QUICK_EVENT);}\n\t\n/**\n * anchorPosition\n * @param target The Element to position\n * @param anchor The Element to use as anchor\n */\nconst POSITION = { top: 0, right: 1, bottom: 2, left: 3 }; // Speed up by using a const map\n\nexport function anchorPosition (target: HTMLElement, anchor: HTMLElement | null | false, position?: string | number) {\n\tif (!anchor || !anchor.isConnected || !target.isConnected) return TARGETS.delete(target); // Stop watchning if anchor is removed from DOM\n\tif (!SCROLLER?.isConnected) document.body.append(SCROLLER || ''); // Ensure we have t´he scroller\n\tif (!TARGETS.has(target)) { // Setup new target or update position\n\t\tconst place = POSITION[position as keyof typeof POSITION] ?? POSITION.bottom; // Use CSS property to store position for more flexibility\n\t\treturn TARGETS.set(target, () => anchorPosition(target, anchor, place)).get(target)?.(); // Start watching if not already watching\n\t}\n\n const { offsetWidth: targetW, offsetHeight: targetH } = target;\n const { offsetWidth: anchorW, offsetHeight: anchorH } = anchor;\n const { width, height, left, top } = anchor.getBoundingClientRect();\n\tconst anchorX = Math.round(left - (anchorW - width) / 2); // Correct for CSS transform scale\n const anchorY = Math.round(top - (anchorH - height) / 2); // Correct for CSS transform scale\n\n\tconst hasSpaceLeft = anchorX - targetW > 0\n\tconst hasSpaceRight = anchorW + anchorW + targetW < window.innerWidth;\n\tconst hasSpaceOver = anchorY - targetH > 0\n\tconst hasSpaceUnder = anchorY + anchorH + targetH < window.innerHeight;\n\tconst positionRight = (position === POSITION.bottom && hasSpaceRight) || !hasSpaceLeft // Always position right when no hasSpaceLeft, as no OS scrolls further up than 0\n\tconst positionUnder = (position === POSITION.bottom && hasSpaceUnder) || !hasSpaceOver // Always position under when no hasSpaceOver, as no OS scrolls further up than 0\n\tconst centerX = Math.min(Math.max(10, anchorX - (targetW - anchorW) / 2), window.innerWidth - targetW - 10);\n\tconst centerY = Math.min(Math.max(10, anchorY - (targetH - anchorH) / 2), window.innerHeight - targetH - 10);\n\tconst isVertical = position === POSITION.top || position === POSITION.bottom;\n\n\ttarget.style.left = `${Math.round(isVertical ? centerX : (positionRight ? anchorX + anchorW : anchorX - targetW))}px`\n target.style.top = `${Math.round(isVertical ? (positionUnder ? anchorY + anchorH : anchorY - targetH) : centerY)}px`\n SCROLLER?.style.setProperty('translate', `${Math.round(window.scrollX + anchorX + anchorW + targetW + 30)} ${Math.round(window.scrollY + anchorY + anchorH + targetH + 30)}px`);\n}\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport function createOptimizedMutationObserver(callback: MutationCallback) {\n let queue = 0;\n\n\tconst onFrame = () => setTimeout(onTimer, 200); // Use both requestAnimationFrame and setTimeout to debounce and only run when visible\n\tconst onTimer = () => {\n\t\tcallback([], observer);\n\t\tqueue = 0;\n\t};\n const observer = new MutationObserver(() => {\n if (!queue) queue = requestAnimationFrame(onFrame);\n });\n\n return observer;\n}\n\ntype Mutator = { observer: MutationObserver, collections: Map<string, () => void> };\nconst MUTATORS = new WeakMap<Element, Mutator>();\nconst MUTATORS_CALLBACK = (element: Element) => {\n\tconst mutator = MUTATORS.get(element);\n\n\tif (!mutator || !element.isConnected) {\n\t\tmutator?.observer?.disconnect();\n\t\tMUTATORS.delete(element);\n\t} else for(const [, callback] of mutator.collections) callback();\n};\n\n/**\n * onMutation\n * @description Utility to quickly observe mutations on a specific class name\n * @param element The Element to use as EventTarget\n * @param className The class name to observe\n * @param callback The callback to run when mutations are detected or false to stop observing\n */\nexport const onMutation = (\n\telement: Element,\n\tclassName: string,\n\tcallback: ((collection: HTMLCollection) => void) | false\n) => {\n\tconst collection = element.getElementsByClassName(className);\n\tlet mutator = MUTATORS.get(element);\n\n\tif (!mutator) {\n\t\tmutator = { collections: new Map(), observer: createOptimizedMutationObserver(() => MUTATORS_CALLBACK(element)) };\n\t\tmutator.observer.observe(element, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n\t\tMUTATORS.set(element, mutator);\n\t}\n\tif (callback) mutator.collections.set(className, () => callback(collection));\n\telse mutator.collections.delete(className);\n}\n\nexport const isInputLike = (el: unknown): el is HTMLInputElement =>\n\tel instanceof HTMLElement && 'validity' in el && !(el instanceof HTMLButtonElement);\n\n// Make React support popover=\"\"target attribute\n// https://github.com/facebook/react/issues/27479\ntype Popover = \"\" | \"auto\" | \"manual\" | undefined;\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicAttributes {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n\tnamespace React {\n\t\tinterface HTMLAttributes<T> {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n}","import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleBackdropClick = ({ clientX: x, clientY: y, target }: MouseEvent) => {\n if (target instanceof HTMLDialogElement && attr(target, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = target.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n\n if (!isInside) target.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleBackdropClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleBackdropClick as EventListener, QUICK_EVENT);\n}","import styles from '../styles.module.css';\nimport { QUICK_EVENT, attr, isInputLike, off, on, onMutation, useId } from '../utils';\n\nconst CSS_FIELD = styles.field.split(' ')[0];\nconst CSS_VALIDATIONS = styles.validation.split(' ');\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for(const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName('*')) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) { // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = el.getAttribute('data-color') === 'success';\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, 'aria-describedby', descs.join(' '));\n attr(input, 'aria-invalid', `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el?.getAttribute('data-count');\n\n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = el.getAttribute('aria-live') === 'polite';\n\n if (prevInvalid !== nextInvalid) {\n attr(el, 'aria-live', nextInvalid ? 'polite' : 'off');\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = `${Math.abs(remainder)} tegn ${nextInvalid ? 'for mye' : 'igjen'}`;\n }\n}\n\nexport function observe (el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, 'input', handleInput, QUICK_EVENT);\n}\n\nexport function unobserve (el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, 'input', handleInput, QUICK_EVENT);\n}\n","import styles from '../styles.module.css';\nimport { attr, isInputLike, onMutation, useId } from '../utils';\nconst CSS_FIELDSET = styles.fieldset.split(' ')[0];\nconst CSS_VALIDATION = styles.validation.split(' ')[0];\n\nfunction process(fieldsets: HTMLCollectionOf<Element>) {\n for(const fieldset of fieldsets) {\n const inputs: HTMLInputElement[] = [];\n let validationId = '';\n\n for (const el of fieldset.getElementsByTagName('*')) {\n if (el.classList.contains(CSS_VALIDATION)) validationId = useId(el);\n else if (isInputLike(el)) inputs.push(el);\n }\n\n if (validationId) \n for(const input of inputs) {\n attr(input, 'aria-describedby', validationId);\n attr(input, 'aria-invalid', 'true');\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_FIELDSET, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_FIELDSET, false);\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, off, on } from '../utils';\n\nconst CSS_APP = styles.app.split(' ')[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn = (el as Element)?.nodeName === 'BUTTON' && (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav?.setAttribute(\n \"data-expanded\",\n `${nav?.getAttribute(\"data-expanded\") === \"false\"}`,\n );\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, anchorPosition, attr, off, on } from '../utils';\n\nexport function observe(el: Node) {\n on(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n on(el, 'click', handleLinkClick); // Allow `<a>` to use `popovertarget` as well\n}\nexport function unobserve(el: Node) {\n off(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n off(el, 'click', handleLinkClick);\n}\n\nconst CSS_POPOVER = styles.popover.split(' ')[0];\n\nfunction handleToggle ({ target: el, newState }: Event & { newState?: string }){\n if (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n const anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(`[popovertarget=\"${el.id}\"]`);\n \n if (newState === 'closed') anchorPosition(el, false);\n else if (anchor) anchorPosition(el, anchor, el.getAttribute('data-position') || 'bottom');\n }\n}\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handleLinkClick ({ target }: Event){\n const link = (target as Element )?.closest?.('a');\n if (link) {\n const root = link.getRootNode() as ShadowRoot;\n const target = root.getElementById?.(attr(link, 'popovertarget') || '') || link.closest(`.${CSS_POPOVER}`);\n const action = attr(link, 'popovertargetaction') || 'toggle';\n\n target?.togglePopover(action === 'show' || (action === 'hide' ? false : undefined));\n }\n}","import styles from '../styles.module.css';\nimport { attr, onMutation } from '../utils';\nconst CSS_TABLE = styles.table.split(' ')[0];\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 attr(cell, 'data-th', ths[cell.cellIndex] || ':empty');\n }\n }\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_TABLE, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_TABLE, false);\n","import styles from '../styles.module.css';\nimport { IS_BROWSER, QUICK_EVENT, anchorPosition, attr, on } from \"../utils\";\n\nconst CSS_TOOLTIP = styles._tooltip.split(' ');\nconst DESCRIBEDBY = 'aria-describedby';\nconst ESC = 'Escape';\nconst LABELLEDBY = 'aria-labelledby';\nconst POSITION_CSS_PROPERTY = '--mtds-tooltip-position';\nconst THROTTLE_DELAY = 100;\nconst TOOLTIP_ID = 'mtds-tooltip';\n\nlet ANCHOR: HTMLElement | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\nlet TOOLTIP: HTMLElement | null = null;\n\nfunction handleMove({ target, type, key }: Event & { key?: string }) {\n if (type === 'keydown' && key !== ESC) return; // Allow ESC dismiss to follow https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n const wait = LAST_CALL + THROTTLE_DELAY - Date.now();\n clearTimeout(THROTTLE);\n THROTTLE = setTimeout(handleMoveThrottled, Math.max(wait, 0), key === ESC ? null : target);\n}\n\n// Using a throttled function to avoid performance issues\nfunction handleMoveThrottled(target: Element | null) {\n LAST_CALL = Date.now();\n\n if (!TOOLTIP || target === TOOLTIP) return; // Allow tooltip to be hovered, following https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus\n let anchor = target?.closest?.<HTMLElement>('[data-tooltip]') || null;\n \n // No need to update\n if (anchor === ANCHOR) return;\n\n const content = anchor?.getAttribute('data-tooltip') || '';\n const position = anchor?.getAttribute('data-tooltip-position') || window.getComputedStyle(anchor || document.body).getPropertyValue(POSITION_CSS_PROPERTY) || 'top';\n const hasLabel = Boolean(anchor?.innerText.trim()) || anchor?.hasAttribute(LABELLEDBY) || anchor?.hasAttribute('aria-label');\n\n if (!content || content === 'false' || content === 'true' || position === 'none') anchor = null; // Do not show tooltip if boolish value\n if (anchor) TOOLTIP.textContent = content; // Only update content if new anchor\n\n ANCHOR?.removeAttribute(ANCHOR.getAttribute(LABELLEDBY) === TOOLTIP_ID ? LABELLEDBY : DESCRIBEDBY); // Unlink previous anchor\n anchorPosition(TOOLTIP, false); // Reset anchor position\n\n ANCHOR = anchor; // Store new anchor - might be null if no new anchor\n ANCHOR?.setAttribute(hasLabel ? DESCRIBEDBY : LABELLEDBY, TOOLTIP_ID); // Use tooltip as description if allready has label\n TOOLTIP.togglePopover(!!anchor);\n anchorPosition(TOOLTIP, anchor, position);\n}\n\n// Initialize if in browser and not already initialized\nif (IS_BROWSER && !document.getElementById(TOOLTIP_ID)) {\n TOOLTIP = document.body.appendChild(document.createElement('div'));\n TOOLTIP.classList.add(...CSS_TOOLTIP);\n TOOLTIP.id = TOOLTIP_ID;\n attr(TOOLTIP, 'popover', 'manual');\n on(document, 'blur,focus,mouseout,mouseover', handleMove, QUICK_EVENT);\n on(window, 'keydown', handleMove, QUICK_EVENT);\n on(window, 'blur', handleMove, QUICK_EVENT);\n}","const getSteps = (now: number, max: number, show: number) => {\n const offset = (show - 1) / 2;\n const start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n const end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n const pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n if (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n if (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n return pages;\n};\n\nexport const pagination = ({\n current = 1,\n total = 10,\n show = 7,\n}) => ({\n prev: current > 1 ? current - 1 : 0,\n next: current < total ? current + 1 : 0,\n pages: getSteps(current, total, show).map((page, index) => ({\n current: page === current && 'page' as const,\n key: `key-${page}-${index}`,\n page,\n })),\n});\n","import * as dialog from './dialog/dialog';\nimport * as field from './field/field';\nimport * as fieldset from './fieldset/fieldset';\nimport * as layout from './layout/layout';\nimport * as popover from './popover/popover';\nimport * as table from './table/table';\nimport './tooltip/tooltip'; // Load data-tooltip behaviour\nimport { IS_BROWSER } from './utils';\nexport { pagination } from './pagination/pagination';\nexport * as styles from './styles.module.css';\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n \n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}"],"names":["IS_BROWSER","QUICK_EVENT","attr","el","name","value","id","UUID","useId","events","action","element","rest","type","on","off","TARGETS","SCROLLER","_","update","POSITION","anchorPosition","target","anchor","position","place","_a","targetW","targetH","anchorW","anchorH","width","height","left","top","anchorX","anchorY","hasSpaceLeft","hasSpaceRight","hasSpaceOver","hasSpaceUnder","positionRight","positionUnder","centerX","centerY","isVertical","createOptimizedMutationObserver","callback","queue","onFrame","onTimer","observer","MUTATORS","MUTATORS_CALLBACK","mutator","onMutation","className","collection","isInputLike","handleBackdropClick","x","y","right","bottom","observe","unobserve","CSS_FIELD","styles","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","label","renderCounter","handleInput","limit","remainder","nextInvalid","css","CSS_FIELDSET","process","fieldsets","fieldset","inputs","validationId","CSS_APP","CSS_TOGGLE","handleToggleClick","btn","nav","toggle","handleToggle","handleLinkClick","CSS_POPOVER","newState","link","root","_b","CSS_TABLE","tables","table","ths","tbody","row","cell","CSS_TOOLTIP","DESCRIBEDBY","ESC","LABELLEDBY","POSITION_CSS_PROPERTY","THROTTLE_DELAY","TOOLTIP_ID","ANCHOR","LAST_CALL","THROTTLE","TOOLTIP","handleMove","key","wait","handleMoveThrottled","content","hasLabel","getSteps","now","max","show","offset","start","end","pages","i","pagination","current","total","page","index","isLoading","onLoaded","dialog.observe","field.observe","fieldset.observe","layout.observe","popover.observe","table.observe","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","popover.unobserve","table.unobserve"],"mappings":"kCAAO,MAAMA,EAAa,OAAO,OAAW,KAAe,OAAO,SAAa,IAClEC,EAAc,CAAE,QAAS,GAAM,QAAS,EAAK,EAS1C,SAAAC,EACfC,EACAC,EACAC,EACgB,CAChB,OAAIA,IAAU,OAAkBF,EAAG,aAAaC,CAAI,GAAK,MACrDC,IAAU,KAASF,EAAA,gBAAgBC,CAAI,EAClCD,EAAG,aAAaC,CAAI,IAAMC,GAAUF,EA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Q,SAAS,IAAI,EAExC6E,EAAW,SAAS,iBAAiB,mBAAoBC,CAAQ,EACvDA,EAAA,CAChB,CAEO,SAAS9E,GAAQ7D,EAAa,CACnC4I,GAAe5I,CAAE,EACjB6I,GAAc7I,CAAE,EAChB8I,GAAiB9I,CAAE,EACnB+I,GAAe/I,CAAE,EACjBgJ,GAAgBhJ,CAAE,EAClBiJ,GAAcjJ,CAAE,CAClB,CAEO,SAAS8D,GAAU9D,EAAa,CACrCkJ,GAAiBlJ,CAAE,EACnBmJ,GAAgBnJ,CAAE,EAClBoJ,GAAmBpJ,CAAE,EACrBqJ,GAAiBrJ,CAAE,EACnBsJ,GAAkBtJ,CAAE,EACpBuJ,GAAgBvJ,CAAE,CACpB"}
1
+ {"version":3,"file":"index.iife.js","sources":["../designsystem/utils.ts","../designsystem/dialog/dialog.ts","../designsystem/field/field.ts","../designsystem/fieldset/fieldset.ts","../designsystem/layout/layout.ts","../designsystem/popover/popover.ts","../designsystem/table/table.ts","../designsystem/tooltip/tooltip.ts","../designsystem/pagination/pagination.ts","../designsystem/index.ts"],"sourcesContent":["export const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\nexport const QUICK_EVENT = { capture: true, passive: true };\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to use as EventTarget\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport function attr(\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n}\n\n/**\n * useId\n * @return A generated unique ID\n */\nlet id = 0;\nconst UUID = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;\nexport function useId (el: Element) {\n if (!el.id) el.id = `${UUID}${++id}`;\n\treturn el.id;\n};\n\n// Internal helper for on / off\nconst events = (\n\taction: \"add\" | \"remove\",\n\telement: Node | Window,\n\trest: Parameters<typeof Element.prototype.addEventListener>,\n): void => {\n\tfor (const type of rest[0].split(\",\")) {\n\t\trest[0] = type;\n\t\telement[`${action}EventListener`](...rest);\n\t}\n};\n\n/**\n * on\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): void => events(\"add\", element, rest);\n\n/**\n * off\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => events(\"remove\", element, rest);\n\n\nconst TARGETS = new Map<Element, () => void>(); // Store current open poppers and their update functions\nconst SCROLLER = IS_BROWSER ? document.createElement('div') : null // Used to ensure we have scrollability under\nif (SCROLLER) attr(SCROLLER, 'style', 'position:absolute;padding:1px;top:0;left:0px');\n\nif (IS_BROWSER){\n\ton(window, 'load,resize,scroll', () => {\n\t\tfor (const [_, update] of TARGETS) update();\n\t}, QUICK_EVENT);}\n\t\n/**\n * anchorPosition\n * @param target The Element to position\n * @param anchor The Element to use as anchor\n */\nconst POSITION = { top: 0, right: 1, bottom: 2, left: 3 }; // Speed up by using a const map\n\nexport function anchorPosition (target: HTMLElement, anchor: HTMLElement | null | false, position?: string | number) {\n\tif (!anchor || !anchor.isConnected || !target.isConnected) return TARGETS.delete(target); // Stop watchning if anchor is removed from DOM\n\tif (!SCROLLER?.isConnected) document.body.append(SCROLLER || ''); // Ensure we have t´he scroller\n\tif (!TARGETS.has(target)) { // Setup new target or update position\n\t\tconst place = POSITION[position as keyof typeof POSITION] ?? POSITION.bottom; // Use CSS property to store position for more flexibility\n\t\treturn TARGETS.set(target, () => anchorPosition(target, anchor, place)).get(target)?.(); // Start watching if not already watching\n\t}\n\n const { offsetWidth: targetW, offsetHeight: targetH } = target;\n const { offsetWidth: anchorW, offsetHeight: anchorH } = anchor;\n const { width, height, left, top } = anchor.getBoundingClientRect();\n\tconst anchorX = Math.round(left - (anchorW - width) / 2); // Correct for CSS transform scale\n const anchorY = Math.round(top - (anchorH - height) / 2); // Correct for CSS transform scale\n\n\tconst hasSpaceLeft = anchorX - targetW > 0\n\tconst hasSpaceRight = anchorW + anchorW + targetW < window.innerWidth;\n\tconst hasSpaceOver = anchorY - targetH > 0\n\tconst hasSpaceUnder = anchorY + anchorH + targetH < window.innerHeight;\n\tconst positionRight = (position === POSITION.bottom && hasSpaceRight) || !hasSpaceLeft // Always position right when no hasSpaceLeft, as no OS scrolls further up than 0\n\tconst positionUnder = (position === POSITION.bottom && hasSpaceUnder) || !hasSpaceOver // Always position under when no hasSpaceOver, as no OS scrolls further up than 0\n\tconst centerX = Math.min(Math.max(10, anchorX - (targetW - anchorW) / 2), window.innerWidth - targetW - 10);\n\tconst centerY = Math.min(Math.max(10, anchorY - (targetH - anchorH) / 2), window.innerHeight - targetH - 10);\n\tconst isVertical = position === POSITION.top || position === POSITION.bottom;\n\n\ttarget.style.left = `${Math.round(isVertical ? centerX : (positionRight ? anchorX + anchorW : anchorX - targetW))}px`\n target.style.top = `${Math.round(isVertical ? (positionUnder ? anchorY + anchorH : anchorY - targetH) : centerY)}px`\n SCROLLER?.style.setProperty('translate', `${Math.round(window.scrollX + anchorX + anchorW + targetW + 30)} ${Math.round(window.scrollY + anchorY + anchorH + targetH + 30)}px`);\n}\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport function createOptimizedMutationObserver(callback: MutationCallback) {\n let queue = 0;\n\n\tconst onFrame = () => setTimeout(onTimer, 200); // Use both requestAnimationFrame and setTimeout to debounce and only run when visible\n\tconst onTimer = () => {\n\t\tcallback([], observer);\n\t\tqueue = 0;\n\t};\n const observer = new MutationObserver(() => {\n if (!queue) queue = requestAnimationFrame(onFrame);\n });\n\n return observer;\n}\n\ntype Mutator = { observer: MutationObserver, collections: Map<string, () => void> };\nconst MUTATORS = new WeakMap<Element, Mutator>();\nconst MUTATORS_CALLBACK = (element: Element) => {\n\tconst mutator = MUTATORS.get(element);\n\n\tif (!mutator || !element.isConnected) {\n\t\tmutator?.observer?.disconnect();\n\t\tMUTATORS.delete(element);\n\t} else for(const [, callback] of mutator.collections) callback();\n};\n\n/**\n * onMutation\n * @description Utility to quickly observe mutations on a specific class name\n * @param element The Element to use as EventTarget\n * @param className The class name to observe\n * @param callback The callback to run when mutations are detected or false to stop observing\n */\nexport const onMutation = (\n\telement: Element,\n\tclassName: string,\n\tcallback: ((collection: HTMLCollection) => void) | false\n) => {\n\tconst collection = element.getElementsByClassName(className);\n\tlet mutator = MUTATORS.get(element);\n\n\tif (!mutator) {\n\t\tmutator = { collections: new Map(), observer: createOptimizedMutationObserver(() => MUTATORS_CALLBACK(element)) };\n\t\tmutator.observer.observe(element, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n\t\tMUTATORS.set(element, mutator);\n\t}\n\tif (callback) mutator.collections.set(className, () => callback(collection));\n\telse mutator.collections.delete(className);\n}\n\nexport const isInputLike = (el: unknown): el is HTMLInputElement =>\n\tel instanceof HTMLElement && 'validity' in el && !(el instanceof HTMLButtonElement);\n\n// Make React support popover=\"\"target attribute\n// https://github.com/facebook/react/issues/27479\ntype Popover = \"\" | \"auto\" | \"manual\" | undefined;\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicAttributes {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n\tnamespace React {\n\t\tinterface HTMLAttributes<T> {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n}","import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleClick = ({ clientX: x, clientY: y, target: el }: MouseEvent) => {\n if (el instanceof HTMLDialogElement && attr(el, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = el.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n \n if (!isInside) el.close();\n } else if (el instanceof Element && el.closest('button[data-command=\"close\"]')) {\n el?.closest('dialog')?.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}","import styles from '../styles.module.css';\nimport { QUICK_EVENT, attr, isInputLike, off, on, onMutation, useId } from '../utils';\n\nconst CSS_FIELD = styles.field.split(' ')[0];\nconst CSS_VALIDATIONS = styles.validation.split(' ');\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for(const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName('*')) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) { // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = el.getAttribute('data-color') === 'success';\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, 'aria-describedby', descs.join(' '));\n attr(input, 'aria-invalid', `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el?.getAttribute('data-count');\n\n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = el.getAttribute('aria-live') === 'polite';\n\n if (prevInvalid !== nextInvalid) {\n attr(el, 'aria-live', nextInvalid ? 'polite' : 'off');\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = `${Math.abs(remainder)} tegn ${nextInvalid ? 'for mye' : 'igjen'}`;\n }\n}\n\n// Prevent browsers from showing default validation bubbles\nfunction handleInvalid(event: Event) {\n if ((event.target as Element)?.closest?.(`.${CSS_FIELD}`)) event.preventDefault();\n}\n\nexport function observe (el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, 'input', handleInput, QUICK_EVENT);\n on(el, 'invalid', handleInvalid, true); // Use capture as invalid does noe buttle\n}\n\nexport function unobserve (el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, 'input', handleInput, QUICK_EVENT);\n off(el, 'invalid', handleInvalid, true);\n}\n","import styles from '../styles.module.css';\nimport { attr, isInputLike, onMutation, useId } from '../utils';\nconst CSS_FIELDSET = styles.fieldset.split(' ')[0];\nconst CSS_VALIDATION = styles.validation.split(' ')[0];\n\nfunction process(fieldsets: HTMLCollectionOf<Element>) {\n for(const fieldset of fieldsets) {\n const inputs: HTMLInputElement[] = [];\n let validationId = '';\n\n for (const el of fieldset.getElementsByTagName('*')) {\n if (el.classList.contains(CSS_VALIDATION)) validationId = useId(el);\n else if (isInputLike(el)) inputs.push(el);\n }\n\n if (validationId) \n for(const input of inputs) {\n attr(input, 'aria-describedby', validationId);\n attr(input, 'aria-invalid', 'true');\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_FIELDSET, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_FIELDSET, false);\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, off, on } from '../utils';\n\nconst CSS_APP = styles.app.split(' ')[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn = (el as Element)?.nodeName === 'BUTTON' && (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav?.setAttribute(\n \"data-expanded\",\n `${nav?.getAttribute(\"data-expanded\") === \"false\"}`,\n );\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, anchorPosition, attr, off, on } from '../utils';\n\nexport function observe(el: Node) {\n on(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n on(el, 'click', handleLinkClick); // Allow `<a>` to use `popovertarget` as well\n}\nexport function unobserve(el: Node) {\n off(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n off(el, 'click', handleLinkClick);\n}\n\nconst CSS_POPOVER = styles.popover.split(' ')[0];\n\nfunction handleToggle ({ target: el, newState }: Event & { newState?: string }){\n if (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n const anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(`[popovertarget=\"${el.id}\"]`);\n \n if (newState === 'closed') anchorPosition(el, false);\n else if (anchor) anchorPosition(el, anchor, el.getAttribute('data-position') || 'bottom');\n }\n}\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handleLinkClick ({ target }: Event){\n const link = (target as Element )?.closest?.('a');\n if (link) {\n const root = link.getRootNode() as ShadowRoot;\n const target = root.getElementById?.(attr(link, 'popovertarget') || '') || link.closest(`.${CSS_POPOVER}`);\n const action = attr(link, 'popovertargetaction') || 'toggle';\n\n target?.togglePopover(action === 'show' || (action === 'hide' ? false : undefined));\n }\n}","import styles from '../styles.module.css';\nimport { attr, onMutation } from '../utils';\nconst CSS_TABLE = styles.table.split(' ')[0];\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 attr(cell, 'data-th', ths[cell.cellIndex] || ':empty');\n }\n }\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_TABLE, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_TABLE, false);\n","import styles from '../styles.module.css';\nimport { IS_BROWSER, QUICK_EVENT, anchorPosition, attr, on } from \"../utils\";\n\nconst CSS_TOOLTIP = styles._tooltip.split(' ');\nconst DESCRIBEDBY = 'aria-describedby';\nconst ESC = 'Escape';\nconst LABELLEDBY = 'aria-labelledby';\nconst POSITION_CSS_PROPERTY = '--mtds-tooltip-position';\nconst THROTTLE_DELAY = 100;\nconst TOOLTIP_ID = 'mtds-tooltip';\n\nlet ANCHOR: HTMLElement | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\nlet TOOLTIP: HTMLElement | null = null;\n\nfunction handleMove({ target, type, key }: Event & { key?: string }) {\n if (type === 'keydown' && key !== ESC) return; // Allow ESC dismiss to follow https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n const wait = LAST_CALL + THROTTLE_DELAY - Date.now();\n clearTimeout(THROTTLE);\n THROTTLE = setTimeout(handleMoveThrottled, Math.max(wait, 0), key === ESC ? null : target);\n}\n\n// Using a throttled function to avoid performance issues\nfunction handleMoveThrottled(target: Element | null) {\n LAST_CALL = Date.now();\n\n if (!TOOLTIP || target === TOOLTIP) return; // Allow tooltip to be hovered, following https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus\n let anchor = target?.closest?.<HTMLElement>('[data-tooltip]') || null;\n \n // No need to update\n if (anchor === ANCHOR) return;\n\n const content = anchor?.getAttribute('data-tooltip') || '';\n const position = anchor?.getAttribute('data-tooltip-position') || window.getComputedStyle(anchor || document.body).getPropertyValue(POSITION_CSS_PROPERTY) || 'top';\n const hasLabel = Boolean(anchor?.innerText.trim()) || anchor?.hasAttribute(LABELLEDBY) || anchor?.hasAttribute('aria-label');\n\n if (!content || content === 'false' || content === 'true' || position === 'none') anchor = null; // Do not show tooltip if boolish value\n if (anchor) TOOLTIP.textContent = content; // Only update content if new anchor\n\n ANCHOR?.removeAttribute(ANCHOR.getAttribute(LABELLEDBY) === TOOLTIP_ID ? LABELLEDBY : DESCRIBEDBY); // Unlink previous anchor\n anchorPosition(TOOLTIP, false); // Reset anchor position\n\n ANCHOR = anchor; // Store new anchor - might be null if no new anchor\n ANCHOR?.setAttribute(hasLabel ? DESCRIBEDBY : LABELLEDBY, TOOLTIP_ID); // Use tooltip as description if allready has label\n TOOLTIP.togglePopover(!!anchor);\n anchorPosition(TOOLTIP, anchor, position);\n}\n\n// Initialize if in browser and not already initialized\nif (IS_BROWSER && !document.getElementById(TOOLTIP_ID)) {\n TOOLTIP = document.body.appendChild(document.createElement('div'));\n TOOLTIP.classList.add(...CSS_TOOLTIP);\n TOOLTIP.id = TOOLTIP_ID;\n attr(TOOLTIP, 'popover', 'manual');\n on(document, 'blur,focus,mouseout,mouseover', handleMove, QUICK_EVENT);\n on(window, 'keydown', handleMove, QUICK_EVENT);\n on(window, 'blur', handleMove, QUICK_EVENT);\n}","const getSteps = (now: number, max: number, show: number) => {\n const offset = (show - 1) / 2;\n const start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n const end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n const pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n if (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n if (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n return pages;\n};\n\nexport const pagination = ({\n current = 1,\n total = 10,\n show = 7,\n}) => ({\n prev: current > 1 ? current - 1 : 0,\n next: current < total ? current + 1 : 0,\n pages: getSteps(current, total, show).map((page, index) => ({\n current: page === current && 'page' as const,\n key: `key-${page}-${index}`,\n page,\n })),\n});\n","import * as dialog from './dialog/dialog';\nimport * as field from './field/field';\nimport * as fieldset from './fieldset/fieldset';\nimport * as layout from './layout/layout';\nimport * as popover from './popover/popover';\nimport * as table from './table/table';\nimport './tooltip/tooltip'; // Load data-tooltip behaviour\nimport { IS_BROWSER } from './utils';\nexport { pagination } from './pagination/pagination';\nexport * as styles from './styles.module.css';\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n \n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}"],"names":["IS_BROWSER","QUICK_EVENT","attr","el","name","value","id","UUID","useId","events","action","element","rest","type","on","off","TARGETS","SCROLLER","_","update","POSITION","anchorPosition","target","anchor","position","place","_a","targetW","targetH","anchorW","anchorH","width","height","left","top","anchorX","anchorY","hasSpaceLeft","hasSpaceRight","hasSpaceOver","hasSpaceUnder","positionRight","positionUnder","centerX","centerY","isVertical","createOptimizedMutationObserver","callback","queue","onFrame","onTimer","observer","MUTATORS","MUTATORS_CALLBACK","mutator","onMutation","className","collection","isInputLike","handleClick","x","y","right","bottom","observe","unobserve","CSS_FIELD","styles","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","label","renderCounter","handleInput","limit","remainder","nextInvalid","css","handleInvalid","event","_b","CSS_FIELDSET","process","fieldsets","fieldset","inputs","validationId","CSS_APP","CSS_TOGGLE","handleToggleClick","btn","nav","toggle","handleToggle","handleLinkClick","CSS_POPOVER","newState","link","root","CSS_TABLE","tables","table","ths","tbody","row","cell","CSS_TOOLTIP","DESCRIBEDBY","ESC","LABELLEDBY","POSITION_CSS_PROPERTY","THROTTLE_DELAY","TOOLTIP_ID","ANCHOR","LAST_CALL","THROTTLE","TOOLTIP","handleMove","key","wait","handleMoveThrottled","content","hasLabel","getSteps","now","max","show","offset","start","end","pages","i","pagination","current","total","page","index","isLoading","onLoaded","dialog.observe","field.observe","fieldset.observe","layout.observe","popover.observe","table.observe","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","popover.unobserve","table.unobserve"],"mappings":"kCAAO,MAAMA,EAAa,OAAO,OAAW,KAAe,OAAO,SAAa,IAClEC,EAAc,CAAE,QAAS,GAAM,QAAS,EAAK,EAS1C,SAAAC,EACfC,EACAC,EACAC,EACgB,CAChB,OAAIA,IAAU,OAAkBF,EAAG,aAAaC,CAAI,GAAK,MACrDC,IAAU,KAASF,EAAA,gBAAgBC,CAAI,EAClCD,EAAG,aAAaC,CAAI,IAAMC,GAAUF,EAAA,aAAaC,EAAMC,CAAK,EAC9D,KACR,CAMA,IAAIC,GAAK,EACT,MAAMC,GAAO,GAAG,KAAK,IAAM,EAAA,SAAS,EAAE,CAAC,GAAG,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,EAAG,CAAC,CAAC,GACzE,SAASC,EAAOL,EAAa,CAC9B,OAACA,EAAG,KAAIA,EAAG,GAAK,GAAGI,EAAI,GAAG,EAAED,EAAE,IAC5BH,EAAG,EACX,CAGA,MAAMM,EAAS,CACdC,EACAC,EACAC,IACU,CACV,UAAWC,KAAQD,EAAK,CAAC,EAAE,MAAM,GAAG,EACnCA,EAAK,CAAC,EAAIC,EACVF,EAAQ,GAAGD,CAAM,eAAe,EAAE,GAAGE,CAAI,CAE3C,EAQaE,EAAK,CACjBH,KACGC,IACOH,EAAO,MAAOE,EAASC,CAAI,EAQzBG,EAAM,CAClBJ,KACGC,IACOH,EAAO,SAAUE,EAASC,CAAI,EAGnCI,MAAc,IACdC,EAAWjB,EAAa,SAAS,cAAc,KAAK,EAAI,KAC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E,EACnBqJ,GAAgBrJ,CAAE,EAClBsJ,GAAmBtJ,CAAE,EACrBuJ,GAAiBvJ,CAAE,EACnBwJ,GAAkBxJ,CAAE,EACpByJ,GAAgBzJ,CAAE,CACpB"}
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -4,6 +4,9 @@ declare const meta: {
4
4
  parameters: {
5
5
  layout: string;
6
6
  };
7
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
8
+ [x: string]: any;
9
+ }>) => import("react/jsx-runtime").JSX.Element)[];
7
10
  };
8
11
  export default meta;
9
12
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
+ decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
+ [x: string]: any;
6
+ }>) => import("react/jsx-runtime").JSX.Element)[];
4
7
  };
5
8
  export default meta;
6
9
  type Story = StoryObj<typeof meta>;