@mattilsynet/design 2.2.6 → 2.2.7
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.js +1 -1
- package/mtds/app/app.d.ts +1 -1
- package/mtds/app/app.js +10 -41
- package/mtds/app/app.js.map +1 -1
- package/mtds/avatar/avatar.js +1 -1
- package/mtds/badge/badge.js +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +1 -1
- package/mtds/button/button.js +1 -1
- package/mtds/card/card.js +1 -1
- package/mtds/chart/chart-element.d.ts +1 -1
- package/mtds/chart/chart-element.js +4 -4
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chip/chip.js +1 -1
- package/mtds/details/details.d.ts +2 -0
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog.js +1 -1
- package/mtds/divider/divider.js +1 -1
- package/mtds/errorsummary/errorsummary.js +1 -1
- package/mtds/field/field-observer.js +3 -3
- package/mtds/field/field.d.ts +3 -5
- package/mtds/field/field.js +69 -99
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset.js +1 -1
- package/mtds/helptext/helptext.js +1 -1
- package/mtds/index.iife.js +7 -8
- package/mtds/index.js +5 -5
- package/mtds/input/input.js +1 -1
- package/mtds/layout/layout.js +1 -1
- package/mtds/link/link.js +1 -1
- package/mtds/logo/logo.js +1 -1
- package/mtds/map/map-element.d.ts +43 -0
- package/mtds/map/map-element.js +66 -0
- package/mtds/map/map-element.js.map +1 -0
- package/mtds/map/map.css.js +22 -0
- package/mtds/map/map.css.js.map +1 -0
- package/mtds/map.d.ts +1 -0
- package/mtds/map.iife.js +683 -0
- package/mtds/map.js +6 -0
- package/mtds/map.js.map +1 -0
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.d.ts +1 -1
- package/mtds/pagination/pagination.js +20 -51
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +1 -1
- package/mtds/popover/popover.d.ts +2 -2
- package/mtds/popover/popover.js +1 -1
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/react-types.d.ts +2 -3
- package/mtds/skeleton/skeleton.js +1 -1
- package/mtds/spinner/spinner.js +1 -1
- package/mtds/steps/steps.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +20 -20
- package/mtds/styles.module.css.js +41 -41
- package/mtds/table/table.js +1 -1
- package/mtds/tag/tag.js +1 -1
- package/mtds/toast/toast-helper.js +1 -1
- package/mtds/toast/toast.js +1 -1
- package/mtds/togglegroup/togglegroup.js +1 -1
- package/mtds/tooltip/tooltip-observer.js +1 -1
- package/mtds/typography/typography.js +1 -1
- package/mtds/utils.js +2 -2
- package/mtds/validation/validation.js +1 -1
- package/package.json +15 -9
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js +0 -342
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js +0 -399
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -137
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +0 -266
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +0 -1
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +0 -231
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +0 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +0 -89
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +0 -1
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js +0 -94
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js.map +0 -1
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -186
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
- package/mtds/external/clsx/dist/clsx.js +0 -18
- package/mtds/external/clsx/dist/clsx.js.map +0 -1
- package/mtds/map/map.d.ts +0 -14
package/mtds/map.js
ADDED
package/mtds/map.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/mtds/package.json.js
CHANGED
|
@@ -1,71 +1,40 @@
|
|
|
1
1
|
import { jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import x from "clsx";
|
|
3
3
|
import { forwardRef as b } from "react";
|
|
4
|
-
import "../
|
|
5
|
-
import "../app/app.js";
|
|
6
|
-
import "../avatar/avatar.js";
|
|
7
|
-
import "../badge/badge.js";
|
|
8
|
-
import "../breadcrumbs/breadcrumbs.js";
|
|
9
|
-
import { Button as o } from "../button/button.js";
|
|
10
|
-
import "../card/card.js";
|
|
11
|
-
import "../chart/chart.js";
|
|
12
|
-
import "../chip/chip.js";
|
|
13
|
-
import "../details/details.js";
|
|
14
|
-
import "../dialog/dialog.js";
|
|
15
|
-
import "../divider/divider.js";
|
|
16
|
-
import "../errorsummary/errorsummary.js";
|
|
17
|
-
import "../field/field.js";
|
|
18
|
-
import "../fieldset/fieldset.js";
|
|
19
|
-
import "../helptext/helptext.js";
|
|
20
|
-
import "../input/input.js";
|
|
21
|
-
import "../layout/layout.js";
|
|
22
|
-
import "../link/link.js";
|
|
23
|
-
import "../logo/logo.js";
|
|
24
|
-
import "../popover/popover.js";
|
|
25
|
-
import "../progress/progress.js";
|
|
26
|
-
import "../skeleton/skeleton.js";
|
|
27
|
-
import "../spinner/spinner.js";
|
|
28
|
-
import "../steps/steps.js";
|
|
29
|
-
import "../table/table.js";
|
|
30
|
-
import "../tabs/tabs.js";
|
|
31
|
-
import "../tag/tag.js";
|
|
32
|
-
import "../toast/toast.js";
|
|
33
|
-
import "../togglegroup/togglegroup.js";
|
|
34
|
-
import "../typography/typography.js";
|
|
35
|
-
import "../validation/validation.js";
|
|
4
|
+
import { Button as n } from "../button/button.js";
|
|
36
5
|
import y from "../styles.module.css.js";
|
|
37
6
|
import { pagination as v } from "./pagination-helper.js";
|
|
38
|
-
const
|
|
39
|
-
function({ children:
|
|
40
|
-
const { pages: f, next:
|
|
7
|
+
const q = b(
|
|
8
|
+
function({ children: l, className: m, current: c, total: p, show: d = 7, props: a, ...e }, s) {
|
|
9
|
+
const { pages: f, next: t, prev: o } = v({ current: c, total: p, show: d });
|
|
41
10
|
return /* @__PURE__ */ i(
|
|
42
11
|
"nav",
|
|
43
12
|
{
|
|
44
|
-
"aria-label":
|
|
45
|
-
className: x(y.pagination,
|
|
13
|
+
"aria-label": e["aria-label"] || "Pagination",
|
|
14
|
+
className: x(y.pagination, m),
|
|
46
15
|
ref: s,
|
|
47
|
-
...
|
|
48
|
-
children:
|
|
16
|
+
...e,
|
|
17
|
+
children: l || /* @__PURE__ */ u("ul", { children: [
|
|
49
18
|
/* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
50
|
-
|
|
19
|
+
n,
|
|
51
20
|
{
|
|
52
|
-
"aria-disabled": !
|
|
53
|
-
...
|
|
21
|
+
"aria-disabled": !o,
|
|
22
|
+
...a?.({ page: o, type: "prev" })
|
|
54
23
|
}
|
|
55
24
|
) }),
|
|
56
|
-
f.map(({ key: g, page:
|
|
57
|
-
|
|
25
|
+
f.map(({ key: g, page: r, current: h }) => /* @__PURE__ */ i("li", { children: !!r && /* @__PURE__ */ i(
|
|
26
|
+
n,
|
|
58
27
|
{
|
|
59
28
|
"aria-current": h,
|
|
60
|
-
children:
|
|
61
|
-
...
|
|
29
|
+
children: r,
|
|
30
|
+
...a?.({ page: r, type: "page" })
|
|
62
31
|
}
|
|
63
32
|
) }, g)),
|
|
64
33
|
/* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
65
|
-
|
|
34
|
+
n,
|
|
66
35
|
{
|
|
67
|
-
"aria-disabled": !
|
|
68
|
-
...
|
|
36
|
+
"aria-disabled": !t,
|
|
37
|
+
...a?.({ page: t, type: "next" })
|
|
69
38
|
}
|
|
70
39
|
) })
|
|
71
40
|
] })
|
|
@@ -74,6 +43,6 @@ const pi = b(
|
|
|
74
43
|
}
|
|
75
44
|
);
|
|
76
45
|
export {
|
|
77
|
-
|
|
46
|
+
q as Pagination
|
|
78
47
|
};
|
|
79
48
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../button/button\";\nimport styles from \"../styles.module.css\";\nimport { pagination } from \"./pagination-helper\";\n\nexport type PaginationProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"nav\">,\n\t\"children\"\n> &\n\t(\n\t\t| {\n\t\t\t\tchildren?: never;\n\t\t\t\tcurrent: number;\n\t\t\t\tshow?: number;\n\t\t\t\ttotal: number;\n\t\t\t\tprops: (props: {\n\t\t\t\t\tpage: number;\n\t\t\t\t\ttype: \"prev\" | \"next\" | \"page\";\n\t\t\t\t}) => Parameters<typeof Button>[0];\n\t\t }\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcurrent?: never;\n\t\t\t\tshow?: never;\n\t\t\t\ttotal?: never;\n\t\t\t\tprops?: never;\n\t\t }\n\t);\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, className, current, total, show = 7, props, ...rest },\n\t\tref,\n\t) {\n\t\tconst { pages, next, prev } = pagination({ current, total, show });\n\n\t\treturn (\n\t\t\t<nav\n\t\t\t\taria-label={rest[\"aria-label\"] || \"Pagination\"}\n\t\t\t\tclassName={clsx(styles.pagination, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children || (\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!prev}\n\t\t\t\t\t\t\t\t{...props?.({ page: prev, type: \"prev\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{pages.map(({ key, page, current }) => (\n\t\t\t\t\t\t\t<li key={key}>\n\t\t\t\t\t\t\t\t{!!page && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\taria-current={current}\n\t\t\t\t\t\t\t\t\t\t{...{ children: page }}\n\t\t\t\t\t\t\t\t\t\t{...props?.({ page, type: \"page\" })}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!next}\n\t\t\t\t\t\t\t\t{...props?.({ page: next, type: \"next\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t</nav>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","className","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","clsx","styles","Button","key","page"],"mappings":";;;;;;AA8BO,MAAMA,IAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,WAAAC,GAAW,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAC3DC,GACC;AACD,UAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM,MAAAC,EAAA,IAASC,EAAW,EAAE,SAAAT,GAAS,OAAAC,GAAO,MAAAC,GAAM;AAEjE,WACC,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,cAAYN,EAAK,YAAY,KAAK;AAAA,QAClC,WAAWO,EAAKC,EAAO,YAAYb,CAAS;AAAA,QAC5C,KAAAM;AAAA,QACC,GAAGD;AAAA,QAEH,UAAAN,uBACC,MAAA,EACA,UAAA;AAAA,UAAA,gBAAAY,EAAC,MAAA,EACA,UAAA,gBAAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACL;AAAA,cACf,GAAGL,IAAQ,EAAE,MAAMK,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,GAE1C;AAAA,UACCF,EAAM,IAAI,CAAC,EAAE,KAAAQ,GAAK,MAAAC,GAAM,SAAAf,QACxB,gBAAAU,EAAC,MAAA,EACC,UAAA,CAAC,CAACK,KACF,gBAAAL;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,gBAAcb;AAAAA,cACR,UAAUe;AAAA,cACf,GAAGZ,IAAQ,EAAE,MAAAY,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACnC,GANOD,CAQT,CACA;AAAA,4BACA,MAAA,EACA,UAAA,gBAAAJ;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACN;AAAA,cACf,GAAGJ,IAAQ,EAAE,MAAMI,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACzC,CACD;AAAA,QAAA,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flip as f, shift as g, size as m } from "
|
|
1
|
+
import { flip as f, shift as g, size as m } from "@floating-ui/dom";
|
|
2
2
|
import u from "../styles.module.css.js";
|
|
3
3
|
import { onLoaded as v, on as c, QUICK_EVENT as p, attr as a, anchorPosition as d } from "../utils.js";
|
|
4
4
|
const r = u.popover.split(" ")[0], l = "_mtds-popover-auto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/dom';
|
|
2
2
|
import { JSX } from 'react';
|
|
3
|
-
import { PolymorphicComponentPropWithRef
|
|
3
|
+
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
4
4
|
export type PopoverProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, {
|
|
5
5
|
"data-position"?: Placement;
|
|
6
6
|
"data-overscroll"?: "contain";
|
|
7
|
-
popover?:
|
|
7
|
+
popover?: React.HTMLAttributes<HTMLElement>["popover"];
|
|
8
8
|
}>;
|
|
9
9
|
type PopoverComponent = <As extends React.ElementType = "div">(props: PopoverProps<As>) => JSX.Element;
|
|
10
10
|
export declare const Popover: PopoverComponent;
|
package/mtds/popover/popover.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as s } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
5
|
const u = s(function({ as: o, className: r, ...p }, t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.tsx"],"sourcesContent":["import type { Placement } from \"@floating-ui/dom\";\nimport clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.tsx"],"sourcesContent":["import type { Placement } from \"@floating-ui/dom\";\nimport clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type PopoverProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-position\"?: Placement;\n\t\t\t\"data-overscroll\"?: \"contain\";\n\t\t\tpopover?: React.HTMLAttributes<HTMLElement>[\"popover\"];\n\t\t}\n\t>;\n\ntype PopoverComponent = <As extends React.ElementType = \"div\">(\n\tprops: PopoverProps<As>,\n) => JSX.Element;\n\nexport const Popover: PopoverComponent = forwardRef<null>(function Popover<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: PopoverProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn (\n\t\t<Tag\n\t\t\tpopover=\"auto\"\n\t\t\tclassName={clsx(styles.popover, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as PopoverComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Popover","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAuBO,MAAMA,IAA4BC,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA0BC,GAA0B;AAGzE,SACC,gBAAAC;AAAA,IAHWJ,KAAM;AAAA,IAGhB;AAAA,MACA,SAAQ;AAAA,MACR,WAAWK,EAAKC,EAAO,SAASL,CAAS;AAAA,MACzC,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
package/mtds/react-types.d.ts
CHANGED
|
@@ -7,12 +7,11 @@ export type PolymorphicComponentPropWithRef<As extends React.ElementType, Props
|
|
|
7
7
|
ref?: PolymorphicRef<As>;
|
|
8
8
|
};
|
|
9
9
|
export type PolymorphicRef<As extends React.ElementType> = React.ComponentPropsWithRef<As>["ref"];
|
|
10
|
-
export type PopoverValues = "" | "auto" | "manual" | undefined;
|
|
11
10
|
export type Sizes = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "18" | "22" | "26" | "30" | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 22 | 26 | 30;
|
|
12
11
|
declare global {
|
|
13
12
|
namespace React {
|
|
14
13
|
interface HTMLAttributes<T> {
|
|
15
|
-
popover?:
|
|
14
|
+
popover?: React.HTMLAttributes<HTMLElement>["popover"];
|
|
16
15
|
popovertarget?: string;
|
|
17
16
|
"data-color"?: "main" | "neutral" | "success" | "danger" | "info" | "warning" | "inverted";
|
|
18
17
|
"data-size"?: "sm" | "md" | "lg" | (string & {});
|
|
@@ -22,7 +21,7 @@ declare global {
|
|
|
22
21
|
}
|
|
23
22
|
namespace React.JSX {
|
|
24
23
|
interface IntrinsicAttributes {
|
|
25
|
-
popover?:
|
|
24
|
+
popover?: React.HTMLAttributes<HTMLElement>["popover"];
|
|
26
25
|
popovertarget?: string;
|
|
27
26
|
popovertargetaction?: string;
|
|
28
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import s from "clsx";
|
|
3
3
|
import { forwardRef as f } from "react";
|
|
4
4
|
import i from "../styles.module.css.js";
|
|
5
5
|
const x = f(function({ as: r, className: t, ...o }, e) {
|
package/mtds/spinner/spinner.js
CHANGED
package/mtds/steps/steps.js
CHANGED