@mattilsynet/design 1.2.3 → 1.3.1
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/alert/alert.stories.d.ts +2 -2
- package/mtds/analytics/analytics.d.ts +30 -0
- package/mtds/analytics/analytics.js +36 -0
- package/mtds/analytics/analytics.js.map +1 -0
- package/mtds/app/app.stories.d.ts +2 -2
- package/mtds/avatar/avatar.stories.d.ts +2 -2
- package/mtds/badge/badge.stories.d.ts +2 -2
- package/mtds/breadcrumbs/breadcrumbs.stories.d.ts +2 -2
- package/mtds/button/button.stories.d.ts +2 -2
- package/mtds/card/card.stories.d.ts +2 -2
- package/mtds/chip/chip.stories.d.ts +2 -2
- package/mtds/details/details.stories.d.ts +1 -1
- package/mtds/dialog/dialog.stories.d.ts +1 -1
- package/mtds/divider/divider.stories.d.ts +1 -1
- package/mtds/errorsummary/errorsummary.stories.d.ts +2 -2
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +151 -152
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +55 -57
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +1 -1
- package/mtds/field/field-observer.js +22 -22
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.js +4 -3
- package/mtds/field/field.js.map +1 -1
- package/mtds/field/field.stories.d.ts +3 -2
- package/mtds/fieldset/fieldset-observer.js +20 -15
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.stories.d.ts +1 -1
- package/mtds/helptext/helptext.stories.d.ts +1 -1
- package/mtds/index.d.ts +2 -0
- package/mtds/index.iife.js +9 -8
- package/mtds/index.js +8 -6
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.stories.d.ts +2 -2
- package/mtds/layout/layout.d.ts +5 -1
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/layout/layout.stories.d.ts +2 -2
- package/mtds/link/link.stories.d.ts +1 -1
- package/mtds/logo/logo.stories.d.ts +2 -2
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.stories.d.ts +1 -1
- package/mtds/popover/popover.stories.d.ts +1 -1
- package/mtds/progress/progress.stories.d.ts +2 -2
- package/mtds/react.d.ts +2 -1
- package/mtds/react.js +48 -46
- package/mtds/react.js.map +1 -1
- package/mtds/skeleton/skeleton.stories.d.ts +1 -1
- package/mtds/spinner/spinner.stories.d.ts +2 -2
- package/mtds/steps/steps-observer.d.ts +1 -0
- package/mtds/steps/steps.d.ts +9 -0
- package/mtds/steps/steps.js +11 -0
- package/mtds/steps/steps.js.map +1 -0
- package/mtds/steps/steps.stories.d.ts +22 -0
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +40 -39
- package/mtds/styles.module.css.js +40 -38
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/table/table.stories.d.ts +2 -2
- package/mtds/tabs/tabs.stories.d.ts +3 -1
- package/mtds/tag/tag.stories.d.ts +2 -2
- package/mtds/tailwind.css +10 -0
- package/mtds/togglegroup/togglegroup.stories.d.ts +1 -1
- package/mtds/tooltip/tooltip.stories.d.ts +2 -2
- package/mtds/typography/typography.d.ts +1 -0
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/typography/typography.stories.d.ts +2 -2
- package/mtds/validation/validation.stories.d.ts +1 -1
- package/package.json +11 -14
- package/mtds/matomo.d.ts +0 -6
- /package/mtds/illustrations/{illustrations.json → index.json} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type Matomo = (string | number | boolean)[];
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
_paq?: Matomo[];
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export type AnalyticsActions = {
|
|
8
|
+
init: {
|
|
9
|
+
matomoId: number | string;
|
|
10
|
+
enabled?: boolean | "debug";
|
|
11
|
+
};
|
|
12
|
+
pageview: {
|
|
13
|
+
url?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
};
|
|
16
|
+
event: {
|
|
17
|
+
category: string;
|
|
18
|
+
action: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
value?: number;
|
|
21
|
+
};
|
|
22
|
+
search: {
|
|
23
|
+
query: string;
|
|
24
|
+
category?: string;
|
|
25
|
+
results?: number;
|
|
26
|
+
};
|
|
27
|
+
matomo: Matomo;
|
|
28
|
+
};
|
|
29
|
+
export declare function analytics<Action extends keyof AnalyticsActions>(action: Action, args?: AnalyticsActions[Action]): void;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IS_BROWSER as r } from "../utils.js";
|
|
2
|
+
const a = "mattilsynet.matomo.cloud";
|
|
3
|
+
let s = !0;
|
|
4
|
+
function d(o, n = {}) {
|
|
5
|
+
if (r) {
|
|
6
|
+
if (window._paq || (window._paq = [], window._paq.push(["HeatmapSessionRecording::disable"]), window._paq.push(["enableLinkTracking"]), window._paq.push(["setTrackerUrl", `https://${a}/matomo.php`]), document.querySelector('script[src*="matomo.js"]') || document.documentElement.append(
|
|
7
|
+
Object.assign(document.createElement("script"), {
|
|
8
|
+
async: !0,
|
|
9
|
+
src: `https://cdn.matomo.cloud/${a}/matomo.js`
|
|
10
|
+
})
|
|
11
|
+
)), o === "init") {
|
|
12
|
+
const { matomoId: e, enabled: t = !0 } = n;
|
|
13
|
+
s = t, window._paq.push(["setSiteId", e]);
|
|
14
|
+
}
|
|
15
|
+
if (s === "debug") return console.info(`Analytics: "${o}"`, n);
|
|
16
|
+
if (!(s === !1 || window.location.hostname === "localhost"))
|
|
17
|
+
if (o === "pageview") {
|
|
18
|
+
const { url: e, title: t } = n;
|
|
19
|
+
window._paq.push(["setCustomUrl", e || location.href]), window._paq.push(["setDocumentTitle", t || document.title]), window._paq.push(["trackPageView"]);
|
|
20
|
+
} else if (o === "event") {
|
|
21
|
+
const { category: e, action: t, name: i, value: c } = n, p = ["trackEvent", e, t, i, c];
|
|
22
|
+
window._paq.push(p.filter((l) => l !== void 0));
|
|
23
|
+
} else if (o === "search") {
|
|
24
|
+
const {
|
|
25
|
+
query: e,
|
|
26
|
+
category: t = !1,
|
|
27
|
+
results: i = !1
|
|
28
|
+
} = n;
|
|
29
|
+
window._paq.push(["trackSiteSearch", e, t, i]);
|
|
30
|
+
} else o === "matomo" && window._paq.push(n);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
d as analytics
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sources":["../../designsystem/analytics/analytics.ts"],"sourcesContent":["import { IS_BROWSER } from \"../utils\";\n\nconst MATOMO = \"mattilsynet.matomo.cloud\";\nlet ENABLED: AnalyticsActions[\"init\"][\"enabled\"] = true;\n\ntype Matomo = (string | number | boolean)[];\ndeclare global {\n\tinterface Window {\n\t\t_paq?: Matomo[];\n\t}\n}\n\nexport type AnalyticsActions = {\n\tinit: {\n\t\tmatomoId: number | string;\n\t\tenabled?: boolean | \"debug\";\n\t};\n\tpageview: {\n\t\turl?: string;\n\t\ttitle?: string;\n\t};\n\tevent: {\n\t\tcategory: string;\n\t\taction: string;\n\t\tname?: string;\n\t\tvalue?: number;\n\t};\n\tsearch: {\n\t\tquery: string;\n\t\tcategory?: string;\n\t\tresults?: number;\n\t};\n\tmatomo: Matomo;\n};\n\nexport function analytics<Action extends keyof AnalyticsActions>(\n\taction: Action,\n\targs = {} as AnalyticsActions[Action],\n) {\n\tif (!IS_BROWSER) return;\n\tif (!window._paq) {\n\t\twindow._paq = [];\n\t\twindow._paq.push([\"HeatmapSessionRecording::disable\"]); // Disable heatmaps by default as this require cookies\n\t\twindow._paq.push([\"enableLinkTracking\"]);\n\t\twindow._paq.push([\"setTrackerUrl\", `https://${MATOMO}/matomo.php`]);\n\t\tdocument.querySelector('script[src*=\"matomo.js\"]') ||\n\t\t\tdocument.documentElement.append(\n\t\t\t\tObject.assign(document.createElement(\"script\"), {\n\t\t\t\t\tasync: true,\n\t\t\t\t\tsrc: `https://cdn.matomo.cloud/${MATOMO}/matomo.js`,\n\t\t\t\t}),\n\t\t\t);\n\t}\n\tif (action === \"init\") {\n\t\tconst { matomoId, enabled = true } = args as AnalyticsActions[\"init\"];\n\t\tENABLED = enabled;\n\t\twindow._paq.push([\"setSiteId\", matomoId]);\n\t}\n\n\tif (ENABLED === \"debug\") return console.info(`Analytics: \"${action}\"`, args);\n\tif (ENABLED === false || window.location.hostname === \"localhost\") return;\n\n\tif (action === \"pageview\") {\n\t\tconst { url, title } = args as AnalyticsActions[\"pageview\"];\n\t\twindow._paq.push([\"setCustomUrl\", url || location.href]);\n\t\twindow._paq.push([\"setDocumentTitle\", title || document.title]);\n\t\twindow._paq.push([\"trackPageView\"]);\n\t} else if (action === \"event\") {\n\t\tconst { category, action, name, value } = args as AnalyticsActions[\"event\"];\n\t\tconst event = [\"trackEvent\", category, action, name, value];\n\t\twindow._paq.push(event.filter((v) => v !== undefined));\n\t} else if (action === \"search\") {\n\t\tconst {\n\t\t\tquery,\n\t\t\tcategory = false,\n\t\t\tresults = false,\n\t\t} = args as AnalyticsActions[\"search\"];\n\t\twindow._paq.push([\"trackSiteSearch\", query, category, results]);\n\t} else if (action === \"matomo\") {\n\t\twindow._paq.push(args as AnalyticsActions[\"matomo\"]);\n\t}\n}\n"],"names":["MATOMO","ENABLED","analytics","action","args","IS_BROW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AAM,OAAO,CAACC,MAAMA,MAAM,MAAS,CAAC;AAAA,MAAA,WAC3CX,MAAW,UAAU;AACzB,cAAA;AAAA,UACL,OAAAY;AAAA,UACA,UAAAL,IAAW;AAAA,UACX,SAAAM,IAAU;AAAA,QAAA,IACPZ;AACJ,eAAO,KAAK,KAAK,CAAC,mBAAmBW,GAAOL,GAAUM,CAAO,CAAC;AAAA,MAAA,MAC/D,CAAWb,MAAW,YACd,OAAA,KAAK,KAAKC,CAAkC;AAAA;AAErD;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
parameters: {
|
|
5
5
|
layout: string;
|
|
6
6
|
};
|
|
7
|
-
decorators: ((Story: import('
|
|
7
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
8
8
|
[x: string]: any;
|
|
9
9
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
id: string;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
8
|
-
decorators: ((Story: import('
|
|
8
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
11
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: ((Story: import('
|
|
4
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|