@mattilsynet/design 2.2.6 → 2.2.8
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-observer.js +1 -1
- package/mtds/app/app-toggle.js +10 -26
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +26 -10
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.d.ts +1 -1
- package/mtds/app/app.js +11 -42
- 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-observer.js +20 -19
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js +1 -1
- package/mtds/dialog/dialog.stories.d.ts +3 -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.d.ts +0 -1
- package/mtds/index.iife.js +14 -15
- 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 +47 -0
- package/mtds/map/map-element.js +74 -0
- package/mtds/map/map-element.js.map +1 -0
- package/mtds/map/map.css.js +46 -0
- package/mtds/map/map.css.js.map +1 -0
- package/mtds/map.d.ts +1 -0
- package/mtds/map.iife.js +722 -0
- package/mtds/map.js +8 -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 +29 -26
- package/mtds/popover/popover-observer.js.map +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 +41 -42
- package/mtds/styles.module.css.js +86 -88
- package/mtds/styles.module.css.js.map +1 -1
- 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 +17 -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/alert/alert.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import f from "clsx";
|
|
3
3
|
import { forwardRef as s } from "react";
|
|
4
4
|
import a from "../styles.module.css.js";
|
|
5
5
|
const x = s(function({ as: t, className: e, ...o }, l) {
|
package/mtds/app/app-observer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import S from "../styles.module.css.js";
|
|
2
2
|
import { onLoaded as _, onMutation as P, on as r, QUICK_EVENT as p, debounce as E } from "../utils.js";
|
|
3
|
-
import "./app-
|
|
3
|
+
import "./app-toggle.js";
|
|
4
4
|
const g = S.app.split(" ")[0], h = S.sticky.split(" ")[0], I = '[data-command="toggle-app-expanded"]', y = `.${g} > dialog,.${g} dialog ~ main`, C = (t) => {
|
|
5
5
|
document.startViewTransition ? document.startViewTransition(t) : t();
|
|
6
6
|
}, x = (t) => (
|
package/mtds/app/app-toggle.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
document.adoptedStyleSheets.push(sheet);
|
|
12
|
-
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
-
try {
|
|
14
|
-
const next = force ?? !prev();
|
|
15
|
-
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
-
window.localStorage.setItem(key, next);
|
|
17
|
-
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Set and store initial state
|
|
21
|
-
window.mtdsToggleAppExpanded(prev());
|
|
22
|
-
})();
|
|
23
|
-
`;
|
|
24
|
-
export {
|
|
25
|
-
t as default
|
|
26
|
-
};
|
|
1
|
+
typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets && (() => {
|
|
2
|
+
const e = "--mtds-app-expanded", d = new CSSStyleSheet(), o = () => !window.localStorage.getItem(e)?.includes("false");
|
|
3
|
+
document.adoptedStyleSheets.push(d), window.mtdsToggleAppExpanded = (n) => {
|
|
4
|
+
try {
|
|
5
|
+
const t = n ?? !o();
|
|
6
|
+
d.replaceSync?.(`:root { ${e}: var(${e}--${t})}`), window.localStorage.setItem(e, t);
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
}, window.mtdsToggleAppExpanded(o());
|
|
10
|
+
})();
|
|
27
11
|
//# sourceMappingURL=app-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js
|
|
1
|
+
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets\n)\n\t(() => {\n\t\tconst key = \"--mtds-app-expanded\";\n\t\tconst sheet = new CSSStyleSheet();\n\t\tconst prev = () => !window.localStorage.getItem(key)?.includes(\"false\");\n\n\t\tdocument.adoptedStyleSheets.push(sheet);\n\t\twindow.mtdsToggleAppExpanded = (force) => {\n\t\t\ttry {\n\t\t\t\tconst next = force ?? !prev();\n\t\t\t\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\n\t\t\t\twindow.localStorage.setItem(key, next);\n\t\t\t} catch (_err) {} // localStorage is full or replaceSync is not supported\n\t\t};\n\n\t\t// Set and store initial state\n\t\twindow.mtdsToggleAppExpanded(prev());\n\t})();\n"],"names":["key","sheet","prev","force","next"],"mappings":"AACC,OAAO,SAAW,OAClB,OAAO,iBACP,SAAS,uBAER,MAAM;AACN,QAAMA,IAAM,uBACNC,IAAQ,IAAI,cAAa,GACzBC,IAAO,MAAM,CAAC,OAAO,aAAa,QAAQF,CAAG,GAAG,SAAS,OAAO;AAEtE,WAAS,mBAAmB,KAAKC,CAAK,GACtC,OAAO,wBAAwB,CAACE,MAAU;AACzC,QAAI;AACH,YAAMC,IAAOD,KAAS,CAACD,EAAI;AAC3B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACtC,QAAe;AAAA,IAAC;AAAA,EACjB,GAGA,OAAO,sBAAsBF,GAAM;AACpC,GAAC;"}
|
package/mtds/app/app-toggle2.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const t = `if (
|
|
2
|
+
typeof window !== "undefined" &&
|
|
3
|
+
window.CSSStyleSheet &&
|
|
4
|
+
document.adoptedStyleSheets
|
|
5
|
+
)
|
|
6
|
+
(() => {
|
|
7
|
+
const key = "--mtds-app-expanded";
|
|
8
|
+
const sheet = new CSSStyleSheet();
|
|
9
|
+
const prev = () => !window.localStorage.getItem(key)?.includes("false");
|
|
10
|
+
|
|
11
|
+
document.adoptedStyleSheets.push(sheet);
|
|
12
|
+
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
+
try {
|
|
14
|
+
const next = force ?? !prev();
|
|
15
|
+
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
+
window.localStorage.setItem(key, next);
|
|
17
|
+
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Set and store initial state
|
|
21
|
+
window.mtdsToggleAppExpanded(prev());
|
|
22
|
+
})();
|
|
23
|
+
`;
|
|
24
|
+
export {
|
|
25
|
+
t as default
|
|
26
|
+
};
|
|
11
27
|
//# sourceMappingURL=app-toggle2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (
|
|
1
|
+
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js?raw"],"sourcesContent":["export default \"if (\\n\\ttypeof window !== \\\"undefined\\\" &&\\n\\twindow.CSSStyleSheet &&\\n\\tdocument.adoptedStyleSheets\\n)\\n\\t(() => {\\n\\t\\tconst key = \\\"--mtds-app-expanded\\\";\\n\\t\\tconst sheet = new CSSStyleSheet();\\n\\t\\tconst prev = () => !window.localStorage.getItem(key)?.includes(\\\"false\\\");\\n\\n\\t\\tdocument.adoptedStyleSheets.push(sheet);\\n\\t\\twindow.mtdsToggleAppExpanded = (force) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst next = force ?? !prev();\\n\\t\\t\\t\\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\\n\\t\\t\\t\\twindow.localStorage.setItem(key, next);\\n\\t\\t\\t} catch (_err) {} // localStorage is full or replaceSync is not supported\\n\\t\\t};\\n\\n\\t\\t// Set and store initial state\\n\\t\\twindow.mtdsToggleAppExpanded(prev());\\n\\t})();\\n\""],"names":["script"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/mtds/app/app.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { ButtonProps } from '../
|
|
2
|
+
import { ButtonProps } from '../button/button';
|
|
3
3
|
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
4
4
|
export type AppHeaderProps = React.ComponentPropsWithoutRef<"header">;
|
|
5
5
|
export type AppSidebarProps = React.ComponentPropsWithoutRef<"dialog">;
|
package/mtds/app/app.js
CHANGED
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import a from "clsx";
|
|
3
3
|
import { forwardRef as p } from "react";
|
|
4
|
-
import "../alert/alert.js";
|
|
5
|
-
import "../avatar/avatar.js";
|
|
6
|
-
import "../badge/badge.js";
|
|
7
|
-
import "../breadcrumbs/breadcrumbs.js";
|
|
8
4
|
import { Button as s } from "../button/button.js";
|
|
9
|
-
import "../
|
|
10
|
-
import "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import "../field/field.js";
|
|
17
|
-
import "../fieldset/fieldset.js";
|
|
18
|
-
import "../helptext/helptext.js";
|
|
19
|
-
import "../input/input.js";
|
|
20
|
-
import "../layout/layout.js";
|
|
21
|
-
import "../link/link.js";
|
|
22
|
-
import "../logo/logo.js";
|
|
23
|
-
import "../pagination/pagination.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";
|
|
36
|
-
import a from "../styles.module.css.js";
|
|
37
|
-
import d from "./app-toggle.js";
|
|
38
|
-
const f = p(function({ as: t, className: r, ...m }, n) {
|
|
39
|
-
return /* @__PURE__ */ o(t || "div", { className: e(a.app, r), ref: n, ...m });
|
|
40
|
-
}), u = p(function({ as: t, className: r, ...m }, n) {
|
|
41
|
-
return /* @__PURE__ */ o(t || "div", { className: e(a.sticky, r), ref: n, ...m });
|
|
42
|
-
}), Z = Object.assign(f, {
|
|
5
|
+
import c from "../styles.module.css.js";
|
|
6
|
+
import d from "./app-toggle2.js";
|
|
7
|
+
const f = p(function({ as: t, className: r, ...i }, e) {
|
|
8
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.app, r), ref: e, ...i });
|
|
9
|
+
}), u = p(function({ as: t, className: r, ...i }, e) {
|
|
10
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.sticky, r), ref: e, ...i });
|
|
11
|
+
}), k = Object.assign(f, {
|
|
43
12
|
Header: p(
|
|
44
13
|
function(t, r) {
|
|
45
14
|
return /* @__PURE__ */ o("header", { ref: r, ...t });
|
|
@@ -52,13 +21,13 @@ const f = p(function({ as: t, className: r, ...m }, n) {
|
|
|
52
21
|
),
|
|
53
22
|
Sticky: u,
|
|
54
23
|
Toggle: p(
|
|
55
|
-
function({ children: t, ...r },
|
|
24
|
+
function({ children: t, ...r }, i) {
|
|
56
25
|
return /* @__PURE__ */ o(
|
|
57
26
|
s,
|
|
58
27
|
{
|
|
59
28
|
"data-command": "toggle-app-expanded",
|
|
60
29
|
"data-tooltip": "Vis meny",
|
|
61
|
-
ref:
|
|
30
|
+
ref: i,
|
|
62
31
|
...r,
|
|
63
32
|
children: t ?? "Skjul meny"
|
|
64
33
|
}
|
|
@@ -77,6 +46,6 @@ const f = p(function({ as: t, className: r, ...m }, n) {
|
|
|
77
46
|
Script: () => /* @__PURE__ */ o("script", { id: "mtds-app-script", children: d })
|
|
78
47
|
});
|
|
79
48
|
export {
|
|
80
|
-
|
|
49
|
+
k as App
|
|
81
50
|
};
|
|
82
51
|
//# sourceMappingURL=app.js.map
|
package/mtds/app/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn <dialog role=\"navigation\" ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSticky: AppSticky,\n\tToggle: forwardRef<HTMLButtonElement, ButtonProps<\"button\">>(\n\t\tfunction AppToggle({ children, ...rest }: ButtonProps<\"button\">, ref) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tdata-command=\"toggle-app-expanded\"\n\t\t\t\t\tdata-tooltip=\"Vis meny\"\n\t\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{children ?? \"Skjul meny\"}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t},\n\t),\n\tMain: forwardRef<HTMLElement, AppMainProps>(function AppMain(rest, ref) {\n\t\treturn <main ref={ref} {...rest} />;\n\t}),\n\tFooter: forwardRef<HTMLElement, AppFooterProps>(\n\t\tfunction AppFooter(rest, ref) {\n\t\t\treturn <footer ref={ref} {...rest} />;\n\t\t},\n\t),\n\t// Needed to avoid flash of unstyled content and still be Next.js hydration compatible\n\tScript: () => <script id=\"mtds-app-script\">{script}</script>,\n});\n"],"names":["AppComp","forwardRef","as","className","rest","ref","jsx","clsx","styles","AppSticky","App","children","Button","script"],"mappings":";;;;;;AAsBA,MAAMA,IAAUC,EAAiB,SAE/B,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SA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A,EAAA;AAAA;AAAA,EAGD,QAAQ,MAAM,gBAAAE,EAAC,UAAA,EAAO,IAAG,mBAAmB,UAAAO,EAAA,CAAO;AACpD,CAAC;"}
|
package/mtds/avatar/avatar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import s from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import p from "../styles.module.css.js";
|
|
5
5
|
const x = n(function({ as: a, className: o, ...r }, t) {
|
package/mtds/badge/badge.js
CHANGED
package/mtds/button/button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as a } from "react";
|
|
4
4
|
import s from "../styles.module.css.js";
|
|
5
5
|
const l = a(function({ as: r, className: n, type: u, ...t }, f) {
|
package/mtds/card/card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
5
|
const g = n(function({ as: o, className: t, ...r }, a) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MTDSElement } from '../utils';
|
|
2
2
|
export type ChartData = ReturnType<typeof toData>;
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class MTDSChartElement extends MTDSElement {
|
|
4
4
|
_observer?: MutationObserver;
|
|
5
5
|
static get observedAttributes(): string[];
|
|
6
6
|
constructor();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import g from "../styles.module.css.js";
|
|
2
|
-
import { IS_BROWSER as b, tag as c, MTDSElement as
|
|
2
|
+
import { IS_BROWSER as b, tag as c, MTDSElement as E, on as C, off as k, attr as d } from "../utils.js";
|
|
3
3
|
import T from "./chart.css.js";
|
|
4
4
|
import { toAxis as w } from "./chart-axis.js";
|
|
5
5
|
import { toBars as S } from "./chart-bars.js";
|
|
6
6
|
import { toLines as _ } from "./chart-lines.js";
|
|
7
7
|
import { toPies as O } from "./chart-pies.js";
|
|
8
8
|
const h = "click,keydown,mousemove,mouseout", p = "mtds-chart-tooltip", a = b ? document.getElementById(p) || c("div", { class: g._tooltip, id: p, hidden: "" }) : null;
|
|
9
|
-
class $ extends
|
|
9
|
+
class $ extends E {
|
|
10
10
|
_observer;
|
|
11
11
|
// Using underscore instead of # for backwards compatibility
|
|
12
12
|
static get observedAttributes() {
|
|
@@ -24,7 +24,7 @@ class $ extends C {
|
|
|
24
24
|
characterData: !0,
|
|
25
25
|
childList: !0,
|
|
26
26
|
subtree: !0
|
|
27
|
-
}), this.attributeChangedCallback(),
|
|
27
|
+
}), this.attributeChangedCallback(), C(this, h, this);
|
|
28
28
|
}
|
|
29
29
|
disconnectedCallback() {
|
|
30
30
|
a && (a.hidden = !0), k(this, h, this), this._observer?.disconnect(), this._observer = void 0;
|
|
@@ -68,6 +68,6 @@ const i = (o) => o?.textContent?.trim() || "", x = (o) => Array.from(
|
|
|
68
68
|
);
|
|
69
69
|
b && !window.customElements.get("mtds-chart") && window.customElements.define("mtds-chart", $);
|
|
70
70
|
export {
|
|
71
|
-
$ as
|
|
71
|
+
$ as MTDSChartElement
|
|
72
72
|
};
|
|
73
73
|
//# sourceMappingURL=chart-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, IS_BROWSER, MTDSElement, off, on, tag } from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\nconst EVENTS = \"click,keydown,mousemove,mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = IS_BROWSER\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", { class: styles._tooltip, id: TOOLTIP_ID, hidden: \"\" })\n\t: null;\nexport class
|
|
1
|
+
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, IS_BROWSER, MTDSElement, off, on, tag } from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\nconst EVENTS = \"click,keydown,mousemove,mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = IS_BROWSER\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", { class: styles._tooltip, id: TOOLTIP_ID, hidden: \"\" })\n\t: null;\n\nexport class MTDSChartElement extends MTDSElement {\n\t_observer?: MutationObserver; // Using underscore instead of # for backwards compatibility\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-variant\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\tconnectedCallback() {\n\t\tthis._observer = new MutationObserver(\n\t\t\tthis.attributeChangedCallback.bind(this),\n\t\t);\n\t\tthis._observer.observe(this, {\n\t\t\tattributeFilter: [\"data-tooltip\"],\n\t\t\tattributes: true,\n\t\t\tcharacterData: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\tthis.attributeChangedCallback(); // Initial setup\n\t\ton(this, EVENTS, this);\n\t}\n\tdisconnectedCallback() {\n\t\tif (TOOLTIP) TOOLTIP.hidden = true;\n\t\toff(this, EVENTS, this);\n\t\tthis._observer?.disconnect();\n\t\tthis._observer = undefined;\n\t}\n\tattributeChangedCallback() {\n\t\tArray.from(this.shadowRoot?.children || []).map((el) => el.remove()); // Clear shadowRoot\n\n\t\tconst data = toData(this.querySelector(\"table\"));\n\t\tconst [variant, type] = (attr(this, \"data-variant\") || \"bar\").split(\"-\");\n\t\tconst style = tag(\"style\", {}, css);\n\t\tconst legend = tag(\"div\", { class: \"legends\" });\n\t\tdata.slice(1).forEach(([{ value, style }]) => {\n\t\t\tlegend.appendChild(tag(\"div\", { class: \"legend\", style }, value));\n\t\t});\n\n\t\tconst { axis, groups, total } = toAxis(data, { type });\n\t\tif (variant === \"bar\" || variant === \"column\")\n\t\t\tgroups.append(...toBars(data));\n\t\tif (variant === \"line\" || variant === \"area\")\n\t\t\tgroups.append(toLines(data, { total, variant, type }));\n\t\tif (variant === \"doughnut\" || variant === \"pie\")\n\t\t\tthis.shadowRoot?.append(toPies(data, { variant }));\n\n\t\tthis.shadowRoot?.append(style, axis, legend);\n\t}\n\thandleEvent(e: Event) {\n\t\tif (e.type === \"click\" || e.type === \"keydown\") onClick(e, this);\n\t\telse onMoveTooltip(e as MouseEvent);\n\t}\n}\n\nfunction onClick(event: Event, self: MTDSChartElement) {\n\tif (event instanceof KeyboardEvent && event.key !== \"Enter\") return; // Only handle enter key\n\tconst el = event.composedPath()[0];\n\tconst table = self.querySelector(\"table\");\n\tconst [tr, td] =\n\t\t(el instanceof Element && attr(el, \"data-event\")?.split(\"-\").map(Number)) ||\n\t\t[];\n\n\ttable?.rows[tr]?.cells[td]?.querySelector<HTMLElement>(\"a,button\")?.click?.();\n}\n\nlet TOOLTIP_TEXT = \"\";\nfunction onMoveTooltip(event: MouseEvent) {\n\tif (!TOOLTIP) return;\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\n\tconst el = event.composedPath()[0];\n\tconst tip = (el instanceof Element && el.getAttribute(\"aria-label\")) || \"\";\n\n\tif (tip)\n\t\tTOOLTIP.style.transform = `translate(${event.pageX}px, ${event.pageY}px)`;\n\tif (tip !== TOOLTIP_TEXT) {\n\t\tif (tip) TOOLTIP.textContent = tip;\n\t\tTOOLTIP_TEXT = tip;\n\t\tTOOLTIP.hidden = !tip;\n\t}\n}\n\nconst text = (el?: Element | null) => el?.textContent?.trim() || \"\"; // Helper to get trimmed text\nconst toData = (table?: HTMLTableElement | null) =>\n\tArray.from(table?.rows || [], (row, rowIndex) =>\n\t\tArray.from(row.cells, (cell, cellIndex) => ({\n\t\t\tnumber: (cellIndex && rowIndex && Number.parseFloat(text(cell))) || 0, // First row and column is not a number\n\t\t\tevent: cell.querySelector(\"a,button\") && `${rowIndex}-${cellIndex}`, // Reference to proxy events\n\t\t\tstyle: `--color: var(--mtdsc-chart-color-${rowIndex}, var(--mtdsc-chart-color-base))`,\n\t\t\tvalue: text(cell),\n\t\t\ttooltip:\n\t\t\t\tattr(cell, \"data-tooltip\") ||\n\t\t\t\t`${text(row.cells[0])}: ${text(cell)} (${text(table?.rows[0].cells[cellIndex])})`,\n\t\t})),\n\t);\n\nif (IS_BROWSER && !window.customElements.get(\"mtds-chart\"))\n\twindow.customElements.define(\"mtds-chart\", MTDSChartElement);\n"],"names":["EVENTS","TOOLTIP_ID","TOOLTIP","IS_BROWSER","tag","styles","MTDSChartElement","MTDSElement","on","off","el","data","toData","variant","type","attr","style","css","legend","value","axis","groups","total","toAxis","toBars","toLines","toPies","onClick","event","self","table","tr","td","TOOLTIP_TEXT","onMoveTooltip","tip","text","row","rowIndex","cell","cellIndex"],"mappings":";;;;;;;AAUA,MAAMA,IAAS,oCACTC,IAAa,sBACbC,IAAUC,IACb,SAAS,eAAeF,CAAU,KACnCG,EAAI,OAAO,EAAE,OAAOC,EAAO,UAAU,IAAIJ,GAAY,QAAQ,GAAA,CAAI,IAChE;AAEI,MAAMK,UAAyBC,EAAY;AAAA,EACjD;AAAA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,cAAc;AAAA,EACvB;AAAA,EACA,cA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O,QAAQ,CAAA;AAAA,EAAI,CAACO,GAAKC,MACnC,MAAM,KAAKD,EAAI,OAAO,CAACE,GAAMC,OAAe;AAAA,IAC3C,QAASA,KAAaF,KAAY,OAAO,WAAWF,EAAKG,CAAI,CAAC,KAAM;AAAA;AAAA,IACpE,OAAOA,EAAK,cAAc,UAAU,KAAK,GAAGD,CAAQ,IAAIE,CAAS;AAAA;AAAA,IACjE,OAAO,oCAAoCF,CAAQ;AAAA,IACnD,OAAOF,EAAKG,CAAI;AAAA,IAChB,SACCxB,EAAKwB,GAAM,cAAc,KACzB,GAAGH,EAAKC,EAAI,MAAM,CAAC,CAAC,CAAC,KAAKD,EAAKG,CAAI,CAAC,KAAKH,EAAKN,GAAO,KAAK,CAAC,EAAE,MAAMU,CAAS,CAAC,CAAC;AAAA,EAAA,EAC9E;AACH;AAEGrC,KAAc,CAAC,OAAO,eAAe,IAAI,YAAY,KACxD,OAAO,eAAe,OAAO,cAAcG,CAAgB;"}
|
package/mtds/chip/chip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import p from "clsx";
|
|
3
3
|
import { forwardRef as e } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
5
|
const h = e(function({ as: r, className: t, ...o }, m) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type DetailsProps = React.ComponentPropsWithoutRef<"details"> & {
|
|
2
|
+
"data-align"?: "start" | "center";
|
|
2
3
|
"data-variant"?: "default" | "card";
|
|
3
4
|
};
|
|
4
5
|
export type SummaryProps = React.ComponentPropsWithoutRef<"summary">;
|
|
5
6
|
export declare const Details: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "ref"> & {
|
|
7
|
+
"data-align"?: "start" | "center";
|
|
6
8
|
"data-variant"?: "default" | "card";
|
|
7
9
|
} & React.RefAttributes<HTMLDetailsElement>> & {
|
|
8
10
|
Summary: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"details.js","sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details(props, ref) {\n\t\treturn (\n\t\t\t<u-details ref={ref} {...toCustomElementProps(props, styles.details)} />\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(props, ref) {\n\t\treturn <u-summary ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"names":["DetailsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","DetailsSummary","Details"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"details.js","sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details(props, ref) {\n\t\treturn (\n\t\t\t<u-details ref={ref} {...toCustomElementProps(props, styles.details)} />\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(props, ref) {\n\t\treturn <u-summary ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"names":["DetailsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","DetailsSummary","Details"],"mappings":";;;;AAQA,MAAMA,IAAcC;AAAA,EACnB,SAAiBC,GAAOC,GAAK;AAC5B,WACC,gBAAAC,EAAC,eAAU,KAAAD,GAAW,GAAGE,EAAqBH,GAAOI,EAAO,OAAO,GAAG;AAAA,EAExE;AACD,GAGMC,IAAiBN;AAAA,EACtB,SAAwBC,GAAOC,GAAK;AACnC,6BAAQ,aAAA,EAAU,KAAAA,GAAW,GAAGE,EAAqBH,CAAK,GAAG;AAAA,EAC9D;AACD,GAEaM,IAAU,OAAO,OAAOR,GAAa,EAAE,SAASO,GAAgB;"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IS_BROWSER as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
) : [],
|
|
6
|
-
for (const
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
clientX:
|
|
10
|
-
clientY:
|
|
11
|
-
target:
|
|
1
|
+
import m from "../styles.module.css.js";
|
|
2
|
+
import { IS_BROWSER as f, onLoaded as u, on as g, QUICK_EVENT as p, createOptimizedMutationObserver as h, attr as e } from "../utils.js";
|
|
3
|
+
const b = m.dialog.split(" ")[0], c = f ? document.getElementsByClassName(
|
|
4
|
+
b
|
|
5
|
+
) : [], C = () => {
|
|
6
|
+
for (const o of c)
|
|
7
|
+
o.isConnected && o.showModal && o.close && (o.matches('[open]:not([data-modal="false"]):not(:modal)') ? (e(o, "open", null), o.showModal()) : o.matches(":modal:not([open])") && (e(o, "open", ""), o.close()));
|
|
8
|
+
}, I = ({
|
|
9
|
+
clientX: o,
|
|
10
|
+
clientY: s,
|
|
11
|
+
target: n
|
|
12
12
|
}) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
for (const t of c)
|
|
14
|
+
if (t.open && e(t, "data-closedby") === "any") {
|
|
15
|
+
const { top: i, right: a, bottom: d, left: r } = t.getBoundingClientRect();
|
|
16
|
+
if (!(i <= s && s <= d && r <= o && o <= a)) return t.close();
|
|
17
|
+
}
|
|
18
|
+
const l = n?.closest?.("dialog");
|
|
19
|
+
l && n?.closest?.('[data-command="close"]') && l.close();
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
u(() => {
|
|
22
|
+
g(document, "click", I, p), h(C).observe(
|
|
22
23
|
document.documentElement,
|
|
23
24
|
{
|
|
24
25
|
attributeFilter: ["open"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tcreateOptimizedMutationObserver,\n\tIS_BROWSER,\n\ton,\n\tonLoaded,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst CSS_DIALOG = styles.dialog.split(\" \")[0];\nconst DIALOGS = IS_BROWSER\n\t? (document.getElementsByClassName(\n\t\t\tCSS_DIALOG,\n\t\t) as HTMLCollectionOf<HTMLDialogElement>)\n\t: [];\n\nconst handleModal = () => {\n\tfor (const dialog of DIALOGS)\n\t\tif (dialog.isConnected && dialog.showModal && dialog.close) {\n\t\t\tif (dialog.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\tattr(dialog, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tdialog.showModal();\n\t\t\t} else if (dialog.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(dialog, \"open\", \"\"); // Set as open\n\t\t\t\tdialog.close(); // So we correclty can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n};\n\nconst handleDialogClick = ({\n\tclientX: x,\n\tclientY: y,\n\ttarget: el,\n}: MouseEvent) => {\n\
|
|
1
|
+
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tcreateOptimizedMutationObserver,\n\tIS_BROWSER,\n\ton,\n\tonLoaded,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst CSS_DIALOG = styles.dialog.split(\" \")[0];\nconst DIALOGS = IS_BROWSER\n\t? (document.getElementsByClassName(\n\t\t\tCSS_DIALOG,\n\t\t) as HTMLCollectionOf<HTMLDialogElement>)\n\t: [];\n\nconst handleModal = () => {\n\tfor (const dialog of DIALOGS)\n\t\tif (dialog.isConnected && dialog.showModal && dialog.close) {\n\t\t\tif (dialog.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\tattr(dialog, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tdialog.showModal();\n\t\t\t} else if (dialog.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(dialog, \"open\", \"\"); // Set as open\n\t\t\t\tdialog.close(); // So we correclty can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n};\n\nconst handleDialogClick = ({\n\tclientX: x,\n\tclientY: y,\n\ttarget: el,\n}: MouseEvent) => {\n\tfor (const dialog of DIALOGS)\n\t\tif (dialog.open && attr(dialog, \"data-closedby\") === \"any\") {\n\t\t\tconst { top, right, bottom, left } = dialog.getBoundingClientRect();\n\t\t\tconst isInside = top <= y && y <= bottom && left <= x && x <= right;\n\t\t\tif (!isInside) return dialog.close();\n\t\t}\n\tconst dialog = (el as Element)?.closest?.(\"dialog\");\n\tconst close = dialog && (el as Element)?.closest?.('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\nonLoaded(() => {\n\ton(document, \"click\", handleDialogClick as EventListener, QUICK_EVENT);\n\tcreateOptimizedMutationObserver(handleModal).observe(\n\t\tdocument.documentElement,\n\t\t{\n\t\t\tattributeFilter: [\"open\"],\n\t\t\tattributes: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t},\n\t);\n});\n"],"names":["CSS_DIALOG","styles","DIALOGS","IS_BROWSER","handleModal","dialog","attr","handleDialogClick","x","y","el","top","right","bottom","left","onLoaded","on","QUICK_EVENT","createOptimizedMutationObserver"],"mappings":";;AAUA,MAAMA,IAAaC,EAAO,OAAO,MAAM,GAAG,EAAE,CAAC,GACvCC,IAAUC,IACZ,SAAS;AAAA,EACVH;AACD,IACC,CAAA,GAEGI,IAAc,MAAM;AACzB,aAAWC,KAAUH;AACpB,IAAIG,EAAO,eAAeA,EAAO,aAAaA,EAAO,UAChDA,EAAO,QAAQ,8CAA8C,KAChEC,EAAKD,GAAQ,QAAQ,IAAI,GACzBA,EAAO,UAAA,KACGA,EAAO,QAAQ,oBAAoB,MAC7CC,EAAKD,GAAQ,QAAQ,EAAE,GACvBA,EAAO,MAAA;AAGX,GAEME,IAAoB,CAAC;AAAA,EAC1B,SAASC;AAAA,EACT,SAASC;AAAA,EACT,QAAQC;AACT,MAAkB;AACjB,aAAWL,KAAUH;AACpB,QAAIG,EAAO,QAAQC,EAAKD,GAAQ,eAAe,MAAM,OAAO;AAC3D,YAAM,EAAE,KAAAM,GAAK,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAA,IAAST,EAAO,sBAAA;AAE5C,UAAI,EADaM,KAAOF,KAAKA,KAAKI,KAAUC,KAAQN,KAAKA,KAAKI,GAC/C,QAAOP,EAAO,MAAA;AAAA,IAC9B;AACD,QAAMA,IAAUK,GAAgB,UAAU,QAAQ;AAElD,EADcL,KAAWK,GAAgB,UAAU,wBAAwB,OACzD,MAAA;AACnB;AAEAK,EAAS,MAAM;AACd,EAAAC,EAAG,UAAU,SAAST,GAAoCU,CAAW,GACrEC,EAAgCd,CAAW,EAAE;AAAA,IAC5C,SAAS;AAAA,IACT;AAAA,MACC,iBAAiB,CAAC,MAAM;AAAA,MACxB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAAA,EACV;AAEF,CAAC;"}
|
package/mtds/dialog/dialog.js
CHANGED
|
@@ -8,5 +8,7 @@ export declare const Default: Story;
|
|
|
8
8
|
export declare const React: Story;
|
|
9
9
|
export declare const WithClose: Story;
|
|
10
10
|
export declare const WithBackdropClose: Story;
|
|
11
|
+
export declare const WithStickyFooter: Story;
|
|
11
12
|
export declare const WithoutBackdrop: Story;
|
|
12
|
-
export declare const
|
|
13
|
+
export declare const VariantDrawer: Story;
|
|
14
|
+
export declare const VariantDrawerWithoutBackdrop: Story;
|
package/mtds/divider/divider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { flip as C, shift as E, size as I } from "
|
|
2
|
-
import { UHTMLComboboxElement as M } from "
|
|
3
|
-
import { UHTMLDataListElement as A } from "
|
|
1
|
+
import { flip as C, shift as E, size as I } from "@floating-ui/dom";
|
|
2
|
+
import { UHTMLComboboxElement as M } from "@u-elements/u-combobox";
|
|
3
|
+
import { UHTMLDataListElement as A } from "@u-elements/u-datalist";
|
|
4
4
|
import h from "../styles.module.css.js";
|
|
5
5
|
import { onLoaded as H, onMutation as $, on as m, QUICK_EVENT as b, isInputLike as v, attr as a, useId as u, anchorPosition as g } from "../utils.js";
|
|
6
6
|
const p = h.field.split(" ")[0], x = h.validation.split(" "), w = x[0], l = (t, o) => t.getPropertyValue(`--mtds-text-${o}`)?.slice(1, -1) || "";
|
package/mtds/field/field.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/dom';
|
|
2
2
|
import { ReactUcombobox, UHTMLComboboxElement } from '@u-elements/u-combobox';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
|
-
import { InputProps } from '../
|
|
4
|
+
import { InputProps } from '../input/input';
|
|
5
5
|
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
6
6
|
type FieldBaseProps = {
|
|
7
7
|
count?: number;
|
|
@@ -15,8 +15,6 @@ type FieldBaseProps = {
|
|
|
15
15
|
readOnly?: boolean;
|
|
16
16
|
suffix?: string;
|
|
17
17
|
validation?: React.ReactNode;
|
|
18
|
-
value?: React.ComponentPropsWithRef<"input">["value"];
|
|
19
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
|
|
20
18
|
};
|
|
21
19
|
export type FieldProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, FieldBaseProps>;
|
|
22
20
|
type FieldComponent = <As extends React.ElementType = "div">(props: FieldProps<As>) => JSX.Element;
|
|
@@ -32,7 +30,7 @@ export type FieldComboboxSelected = {
|
|
|
32
30
|
value: string;
|
|
33
31
|
children?: React.ReactNode;
|
|
34
32
|
}[];
|
|
35
|
-
export type FieldComboboxProps = ReactUcombobox & {
|
|
33
|
+
export type FieldComboboxProps = Omit<ReactUcombobox, "onChange" | "onInput"> & {
|
|
36
34
|
"data-creatable"?: boolean;
|
|
37
35
|
"data-multiple"?: boolean;
|
|
38
36
|
onAfterChange?: (e: CustomEvent<HTMLDataElement>) => void;
|
|
@@ -43,7 +41,7 @@ export type FieldComboboxProps = ReactUcombobox & {
|
|
|
43
41
|
onSelectedChange?: (selected: FieldComboboxSelected) => void;
|
|
44
42
|
options?: FieldComboboxSelected;
|
|
45
43
|
selected?: FieldComboboxSelected;
|
|
46
|
-
} & Pick<InputProps, "disabled" | "
|
|
44
|
+
} & Pick<InputProps, "disabled" | "name" | "onChange" | "onInput" | "placeholder" | "readOnly" | "type" | "value"> & // Allow input props to be passed down
|
|
47
45
|
Pick<FieldDatalistProps, "data-position" | "data-nofilter">;
|
|
48
46
|
export type FieldLabelProps = React.ComponentPropsWithoutRef<"label">;
|
|
49
47
|
export declare const Field: FieldComponent & {
|