@mattilsynet/design 1.0.6 → 1.0.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/avatar/avatar.stories.d.ts +1 -0
- package/mtds/badge/badge.d.ts +2 -2
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.d.ts +1 -0
- package/mtds/breadcrumbs/breadcrumbs-observer.js +12 -0
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -0
- package/mtds/breadcrumbs/breadcrumbs.js +13 -21
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.d.ts +1 -1
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.d.ts +9 -1
- package/mtds/card/card.js +22 -8
- package/mtds/card/card.js.map +1 -1
- package/mtds/card/card.stories.d.ts +1 -1
- package/mtds/dialog/dialog-observer.d.ts +1 -2
- package/mtds/dialog/dialog-observer.js +19 -17
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.d.ts +4 -2
- package/mtds/dialog/dialog.js +11 -15
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/dialog/dialog.stories.d.ts +1 -0
- package/mtds/divider/divider.d.ts +2 -2
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.d.ts +1 -0
- package/mtds/errorsummary/errorsummary-observer.js +10 -0
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -0
- package/mtds/errorsummary/errorsummary.js +11 -17
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +47 -48
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +1 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +9 -8
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
- package/mtds/external/@u-elements/u-tags/dist/u-tags.js +160 -162
- package/mtds/external/@u-elements/u-tags/dist/u-tags.js.map +1 -1
- package/mtds/field/field-helper.d.ts +1 -0
- package/mtds/field/field-observer.d.ts +1 -2
- package/mtds/field/field-observer.js +32 -41
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.d.ts +7 -0
- package/mtds/field/field.js +49 -34
- package/mtds/field/field.js.map +1 -1
- package/mtds/field/field.stories.d.ts +4 -2
- package/mtds/fieldset/fieldset-observer.d.ts +1 -2
- package/mtds/fieldset/fieldset-observer.js +12 -16
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/index.d.ts +3 -3
- package/mtds/index.iife.js +6 -5
- package/mtds/index.iife.js.map +1 -1
- package/mtds/index.js +13 -24
- package/mtds/index.js.map +1 -1
- package/mtds/layout/app-observer.d.ts +1 -2
- package/mtds/layout/app-observer.js +11 -16
- package/mtds/layout/app-observer.js.map +1 -1
- package/mtds/layout/layout.d.ts +17 -6
- package/mtds/layout/layout.js +12 -9
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/logo/logo-observer.d.ts +1 -2
- package/mtds/logo/logo-observer.js +14 -18
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/popover/popover-observer.d.ts +1 -2
- package/mtds/popover/popover-observer.js +12 -21
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/react-types.d.ts +11 -0
- package/mtds/react.js +42 -40
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +34 -34
- package/mtds/styles.module.css.js +58 -56
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/table/table-observer.d.ts +1 -2
- package/mtds/table/table-observer.js +10 -14
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/tag/tag.d.ts +2 -6
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +27 -20
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/utils.d.ts +2 -19
- package/mtds/utils.js +32 -26
- package/mtds/utils.js.map +1 -1
- package/package.json +18 -18
package/mtds/badge/badge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type BadgeProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
2
|
-
"data-badge"?: string | number;
|
|
2
|
+
"data-badge"?: string | number | boolean;
|
|
3
3
|
};
|
|
4
4
|
export declare const Badge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
5
|
-
"data-badge"?: string | number;
|
|
5
|
+
"data-badge"?: string | number | boolean;
|
|
6
6
|
} & React.RefAttributes<HTMLSpanElement>>;
|
package/mtds/badge/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../designsystem/badge/badge.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type BadgeProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-badge\"?: string | number;\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn <span className={clsx(styles.badge, className)} ref={ref} {...rest} />;\n});\n"],"names":["Badge","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAQa,MAAAA,IAAQC,EAAwC,SAC5D,EAAE,WAAAC,GAAW,GAAGC,EAAK,GACrBC,GACC;AACM,SAAA,gBAAAC,EAAC,QAAK,EAAA,WAAWC,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC5E,CAAC;"}
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../designsystem/badge/badge.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type BadgeProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-badge\"?: string | number | boolean;\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn <span className={clsx(styles.badge, className)} ref={ref} {...rest} />;\n});\n"],"names":["Badge","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAQa,MAAAA,IAAQC,EAAwC,SAC5D,EAAE,WAAAC,GAAW,GAAGC,EAAK,GACrBC,GACC;AACM,SAAA,gBAAAC,EAAC,QAAK,EAAA,WAAWC,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC5E,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import n from "../styles.module.css.js";
|
|
2
|
+
import { IS_BROWSER as t, on as i, QUICK_EVENT as l, debounce as s, attr as u } from "../utils.js";
|
|
3
|
+
const f = n.breadcrumbs.split(" ")[0], e = t && document.getElementsByClassName(f);
|
|
4
|
+
function d(o) {
|
|
5
|
+
if (!(!e || o.animationName !== n._onInjectCrumb))
|
|
6
|
+
for (const r of e)
|
|
7
|
+
r.querySelectorAll("li a").forEach((a, c, { length: m }) => {
|
|
8
|
+
u(a, "aria-current", c === m - 1 ? "page" : null);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
t && i(document, "animationend", s(d, 100), l);
|
|
12
|
+
//# sourceMappingURL=breadcrumbs-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs-observer.js","sources":["../../designsystem/breadcrumbs/breadcrumbs-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, QUICK_EVENT, attr, debounce, on } from \"../utils\";\n\nconst CSS_BREADCRUMBS = styles.breadcrumbs.split(\" \")[0];\nconst BREADCRUMBS = IS_BROWSER && document.getElementsByClassName(CSS_BREADCRUMBS);\n\nfunction handleInject(event: Event & { animationName?: string }) {\n if (!BREADCRUMBS || event.animationName !== styles._onInjectCrumb) return;\n for (const breadcumbs of BREADCRUMBS)\n breadcumbs.querySelectorAll('li a').forEach((crumb, index, { length }) => {\n attr(crumb, 'aria-current', index === length - 1 ? 'page' : null);\n });\n}\n\nif (IS_BROWSER)\n on(document, 'animationend', debounce(handleInject, 100), QUICK_EVENT);"],"names":["CSS_BREADCRUMBS","styles","BREADCRUMBS","IS_BROWSER","handleInject","event","breadcumbs","crumb","index","length","attr","on","debounce","QUICK_EVENT"],"mappings":";;AAGA,MAAMA,IAAkBC,EAAO,YAAY,MAAM,GAAG,EAAE,CAAC,GACjDC,IAAcC,KAAc,SAAS,uBAAuBH,CAAe;AAEjF,SAASI,EAAaC,GAA2C;AAC/D,MAAI,GAACH,KAAeG,EAAM,kBAAkBJ,EAAO;AACnD,eAAWK,KAAcJ;AACZ,MAAAI,EAAA,iBAAiB,MAAM,EAAE,QAAQ,CAACC,GAAOC,GAAO,EAAE,QAAAC,QAAa;AACxE,QAAAC,EAAKH,GAAO,gBAAgBC,MAAUC,IAAS,IAAI,SAAS,IAAI;AAAA,MAAA,CACjE;AACL;AAEIN,KACFQ,EAAG,UAAU,gBAAgBC,EAASR,GAAc,GAAG,GAAGS,CAAW;"}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return p(s, () => r.current), b(() => {
|
|
10
|
-
if (r.current instanceof HTMLElement) {
|
|
11
|
-
const e = r.current.querySelectorAll("li > :is(a,button)"), l = e[e.length - 1];
|
|
12
|
-
for (const n of e)
|
|
13
|
-
g(n, "aria-current", n === l ? "page" : null);
|
|
14
|
-
}
|
|
15
|
-
}), /* @__PURE__ */ m(
|
|
16
|
-
c,
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as s } from "../external/clsx/dist/clsx.js";
|
|
3
|
+
import { forwardRef as t } from "react";
|
|
4
|
+
import c from "../styles.module.css.js";
|
|
5
|
+
const p = t(
|
|
6
|
+
function({ as: a, className: o, ...r }, m) {
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
a || "nav",
|
|
17
9
|
{
|
|
18
|
-
"aria-label":
|
|
19
|
-
className:
|
|
20
|
-
ref:
|
|
21
|
-
...
|
|
10
|
+
"aria-label": r["aria-label"] || "Du er her:",
|
|
11
|
+
className: s(c.breadcrumbs, o),
|
|
12
|
+
ref: m,
|
|
13
|
+
...r
|
|
22
14
|
}
|
|
23
15
|
);
|
|
24
16
|
}
|
|
25
17
|
);
|
|
26
18
|
export {
|
|
27
|
-
|
|
19
|
+
p as Breadcrumbs
|
|
28
20
|
};
|
|
29
21
|
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.js","sources":["../../designsystem/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sources":["../../designsystem/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type BreadcrumbsProps<As extends React.ElementType = \"nav\"> =\n\tPolymorphicComponentPropWithRef<As, { \"aria-label\"?: string }>;\n\ntype BreadcrumbsComponent = <As extends React.ElementType = \"nav\">(\n\tprops: BreadcrumbsProps<As>,\n) => JSX.Element;\n\nexport const Breadcrumbs: BreadcrumbsComponent = forwardRef<null>(\n\tfunction Breadcrumbs<As extends React.ElementType = \"nav\">(\n\t\t{ as, className, ...rest }: BreadcrumbsProps<As>,\n\t\tref?: PolymorphicRef<As>,\n\t) {\n\t\tconst Tag = as || \"nav\";\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\taria-label={rest[\"aria-label\"] || \"Du er her:\"}\n\t\t\t\tclassName={clsx(styles.breadcrumbs, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n) as BreadcrumbsComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Breadcrumbs","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAeO,MAAMA,IAAoCC;AAAA,EAChD,SACC,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,KACpBC,GACC;AAIA,WAAA,gBAAAC;AAAA,MAHWJ,KAAM;AAAA,MAGhB;AAAA,QACA,cAAYE,EAAK,YAAY,KAAK;AAAA,QAClC,WAAWG,EAAKC,EAAO,aAAaL,CAAS;AAAA,QAC7C,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;"}
|
package/mtds/button/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { JSX } from 'react';
|
|
|
2
2
|
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
3
3
|
type ButtonBaseProps<Href> = {
|
|
4
4
|
"data-arrow"?: "left" | "right" | true;
|
|
5
|
-
"data-color"?: "
|
|
5
|
+
"data-color"?: "main" | "danger";
|
|
6
6
|
"data-justify"?: "start" | "center" | "right";
|
|
7
7
|
"data-nowrap"?: boolean;
|
|
8
8
|
"data-variant"?: "primary" | "secondary" | "tertiary";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../designsystem/button/button.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype ButtonBaseProps<Href> = {\n\t\"data-arrow\"?: \"left\" | \"right\" | true;\n\t\"data-color\"?: \"
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../designsystem/button/button.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype ButtonBaseProps<Href> = {\n\t\"data-arrow\"?: \"left\" | \"right\" | true;\n\t\"data-color\"?: \"main\" | \"danger\";\n\t\"data-justify\"?: \"start\" | \"center\" | \"right\";\n\t\"data-nowrap\"?: boolean;\n\t\"data-variant\"?: \"primary\" | \"secondary\" | \"tertiary\";\n\thref?: Href;\n};\n\nexport type ButtonProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n> = PolymorphicComponentPropWithRef<As, ButtonBaseProps<Href>>;\n\ntype ButtonComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>(\n\tprops: ButtonProps<Href, As>,\n) => JSX.Element;\n\nexport const Button: ButtonComponent = forwardRef<null>(function Button<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>({ as, className, ...rest }: ButtonProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"button\");\n\n\treturn <Tag className={clsx(styles.button, className)} ref={ref} {...rest} />;\n}) as ButtonComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Button","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;AA6Ba,MAAAA,IAA0BC,EAAiB,SAGtD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAA0BC,GAA0B;AAC9E,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,MAAM;AAE9B,SAAA,gBAAAG,EAACD,GAAI,EAAA,WAAWE,EAAKC,EAAO,QAAQN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC5E,CAAC;"}
|
package/mtds/card/card.d.ts
CHANGED
|
@@ -5,5 +5,13 @@ type CardBaseProps<Href> = {
|
|
|
5
5
|
};
|
|
6
6
|
export type CardProps<Href, As extends React.ElementType = Href extends string ? "a" : "div"> = PolymorphicComponentPropWithRef<As, CardBaseProps<Href>>;
|
|
7
7
|
type CardComponent = <Href, As extends React.ElementType = Href extends string ? "a" : "div">(props: CardProps<Href, As>) => JSX.Element;
|
|
8
|
-
export
|
|
8
|
+
export type GroupProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As>;
|
|
9
|
+
type GroupComponent = <As extends React.ElementType = "div">(props: GroupProps<As>) => JSX.Element;
|
|
10
|
+
export declare const Group: GroupComponent;
|
|
11
|
+
export type CardDetailsProps = React.ComponentPropsWithoutRef<"details">;
|
|
12
|
+
export type CardSummaryProps = React.ComponentPropsWithoutRef<"summary">;
|
|
13
|
+
export declare const Card: CardComponent & {
|
|
14
|
+
Details: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "ref"> & React.RefAttributes<HTMLDetailsElement>>;
|
|
15
|
+
Summary: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
};
|
|
9
17
|
export {};
|
package/mtds/card/card.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as m } from "../external/clsx/dist/clsx.js";
|
|
3
|
+
import { forwardRef as t } from "react";
|
|
4
|
+
import u from "../styles.module.css.js";
|
|
5
|
+
const e = t(function({ as: a, className: o, ...r }, c) {
|
|
6
|
+
const i = a || (r.href ? "a" : "div");
|
|
7
|
+
return /* @__PURE__ */ s(i, { className: m(u.card, o), ref: c, ...r });
|
|
8
|
+
}), y = t(function({ as: a, className: o, ...r }, c) {
|
|
9
|
+
return /* @__PURE__ */ s(a || "div", { className: m(u.group, o), ref: c, ...r });
|
|
10
|
+
}), d = t(
|
|
11
|
+
function({ className: a, ...o }, r) {
|
|
12
|
+
return /* @__PURE__ */ s("u-details", { class: m(u.card, a), ref: r, ...o });
|
|
13
|
+
}
|
|
14
|
+
), f = t(
|
|
15
|
+
function({ className: a, ...o }, r) {
|
|
16
|
+
return /* @__PURE__ */ s("u-summary", { class: a, ref: r, ...o });
|
|
17
|
+
}
|
|
18
|
+
), x = Object.assign(e, {
|
|
19
|
+
Details: d,
|
|
20
|
+
Summary: f
|
|
8
21
|
});
|
|
9
22
|
export {
|
|
10
|
-
x as Card
|
|
23
|
+
x as Card,
|
|
24
|
+
y as Group
|
|
11
25
|
};
|
|
12
26
|
//# sourceMappingURL=card.js.map
|
package/mtds/card/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../designsystem/card/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype CardBaseProps<Href> = {\n\thref?: Href;\n};\n\nexport type CardProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n> = PolymorphicComponentPropWithRef<As, CardBaseProps<Href>>;\n\ntype CardComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>(\n\tprops: CardProps<Href, As>,\n) => JSX.Element;\n\
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../designsystem/card/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype CardBaseProps<Href> = {\n\thref?: Href;\n};\n\nexport type CardProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n> = PolymorphicComponentPropWithRef<As, CardBaseProps<Href>>;\n\ntype CardComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>(\n\tprops: CardProps<Href, As>,\n) => JSX.Element;\n\nconst CardComp: CardComponent = forwardRef<null>(function Card<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>({ as, className, ...rest }: CardProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"div\");\n\n\treturn <Tag className={clsx(styles.card, className)} ref={ref} {...rest} />;\n}) as CardComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type GroupProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype GroupComponent = <As extends React.ElementType = \"div\">(\n\tprops: GroupProps<As>,\n) => JSX.Element;\n\nexport const Group: GroupComponent = forwardRef<null>(function Group<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GroupProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.group, className)} ref={ref} {...rest} />;\n}) as GroupComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type CardDetailsProps = React.ComponentPropsWithoutRef<\"details\">;\nconst CardDetails = forwardRef<HTMLDetailsElement, CardDetailsProps>(\n\tfunction CardDetails({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<u-details class={clsx(styles.card, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n\nexport type CardSummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst CardSummary = forwardRef<HTMLElement, CardSummaryProps>(\n\tfunction CardSummary({ className, ...rest }, ref) {\n\t\treturn <u-summary class={className} ref={ref} {...rest} />;\n\t},\n);\n\nexport const Card = Object.assign(CardComp, {\n\tDetails: CardDetails,\n\tSummary: CardSummary,\n});\n"],"names":["CardComp","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles","Group","CardDetails","CardSummary","Card"],"mappings":";;;;AAwBA,MAAMA,IAA0BC,EAAiB,SAG/C,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAwBC,GAA0B;AAC5E,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,MAAM;AAE9B,SAAA,gBAAAG,EAACD,GAAI,EAAA,WAAWE,EAAKC,EAAO,MAAMN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC1E,CAAC,GASYM,IAAwBT,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAmBC,GAA0B;AAGhE,SAAA,gBAAAE,EAFKL,KAAM,OAEN,EAAA,WAAWM,EAAKC,EAAO,OAAON,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC3E,CAAC,GAGKO,IAAcV;AAAA,EACnB,SAAqB,EAAE,WAAAE,GAAW,GAAGC,EAAA,GAAQC,GAAK;AAEhD,WAAA,gBAAAE,EAAC,aAAU,EAAA,OAAOC,EAAKC,EAAO,MAAMN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAAA,EAAA;AAGvE,GAGMQ,IAAcX;AAAA,EACnB,SAAqB,EAAE,WAAAE,GAAW,GAAGC,EAAA,GAAQC,GAAK;AACjD,6BAAQ,aAAU,EAAA,OAAOF,GAAW,KAAAE,GAAW,GAAGD,GAAM;AAAA,EAAA;AAE1D,GAEaS,IAAO,OAAO,OAAOb,GAAU;AAAA,EAC3C,SAASW;AAAA,EACT,SAASC;AACV,CAAC;"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function unobserve(el: Element): void;
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
u as observe,
|
|
17
|
-
E as unobserve
|
|
1
|
+
import m from "../styles.module.css.js";
|
|
2
|
+
import { IS_BROWSER as a, on as u, QUICK_EVENT as e, createOptimizedMutationObserver as f, attr as E } from "../utils.js";
|
|
3
|
+
const g = m.dialog.split(" ")[0], p = a ? document.getElementsByClassName(g) : [], i = (t) => {
|
|
4
|
+
t.stopImmediatePropagation(), t.stopPropagation();
|
|
5
|
+
}, b = () => {
|
|
6
|
+
for (const t of p)
|
|
7
|
+
t.matches('[open]:not([data-modal="false"]):not(:modal)') && (t.addEventListener("close", i, e), t.close(), t.showModal(), window.requestAnimationFrame(() => t.removeEventListener("close", i, e)));
|
|
8
|
+
}, I = ({ clientX: t, clientY: n, target: o }) => {
|
|
9
|
+
var s;
|
|
10
|
+
if (o instanceof HTMLDialogElement && E(o, "data-closedby") === "any") {
|
|
11
|
+
const { top: c, right: d, bottom: l, left: r } = o.getBoundingClientRect();
|
|
12
|
+
c <= n && n <= l && r <= t && t <= d || o.close();
|
|
13
|
+
} else o instanceof Element && o.closest('button[data-command="close"]') && ((s = o == null ? void 0 : o.closest("dialog")) == null || s.close());
|
|
18
14
|
};
|
|
15
|
+
a && (u(document, "click", I, e), f(b).observe(document.documentElement, {
|
|
16
|
+
attributeFilter: ["open"],
|
|
17
|
+
attributes: !0,
|
|
18
|
+
childList: !0,
|
|
19
|
+
subtree: !0
|
|
20
|
+
}));
|
|
19
21
|
//# sourceMappingURL=dialog-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import { QUICK_EVENT, attr,
|
|
1
|
+
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, QUICK_EVENT, attr, createOptimizedMutationObserver, on } from '../utils';\n\nconst CSS_DIALOG = styles.dialog.split(\" \")[0];\nconst DIALOGS = IS_BROWSER ? document.getElementsByClassName(CSS_DIALOG) as HTMLCollectionOf<HTMLDialogElement> : [];\nconst PREVENT_EVENT = (event: Event) => {\n event.stopImmediatePropagation();\n event.stopPropagation();\n}\n\nconst handleModal = () => {\n for (const dialog of DIALOGS)\n if (dialog.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n dialog.addEventListener('close', PREVENT_EVENT, QUICK_EVENT); // Prevent closing events due to swapping to modal\n dialog.close();\n dialog.showModal();\n window.requestAnimationFrame(() => dialog.removeEventListener('close', PREVENT_EVENT, QUICK_EVENT)); // Re-enable closing events\n }\n};\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\nif (IS_BROWSER) {\n on(document, 'click', handleClick as EventListener, QUICK_EVENT);\n createOptimizedMutationObserver(handleModal).observe(document.documentElement, {\n attributeFilter: ['open'],\n attributes: true,\n childList: true,\n subtree: true,\n });\n}"],"names":["CSS_DIALOG","styles","DIALOGS","IS_BROWSER","PREVENT_EVENT","event","handleModal","dialog","QUICK_EVENT","handleClick","x","y","el","attr","top","right","bottom","left","_a","on","createOptimizedMutationObserver"],"mappings":";;AAGA,MAAMA,IAAaC,EAAO,OAAO,MAAM,GAAG,EAAE,CAAC,GACvCC,IAAUC,IAAa,SAAS,uBAAuBH,CAAU,IAA2C,CAAC,GAC7GI,IAAgB,CAACC,MAAiB;AACtC,EAAAA,EAAM,yBAAyB,GAC/BA,EAAM,gBAAgB;AACxB,GAEMC,IAAc,MAAM;AACxB,aAAWC,KAAUL;AACf,IAAAK,EAAO,QAAQ,8CAA8C,MACxDA,EAAA,iBAAiB,SAASH,GAAeI,CAAW,GAC3DD,EAAO,MAAM,GACbA,EAAO,UAAU,GACjB,OAAO,sBAAsB,MAAMA,EAAO,oBAAoB,SAASH,GAAeI,CAAW,CAAC;AAExG,GAEMC,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;AAEIf,MACCgB,EAAA,UAAU,SAASV,GAA8BD,CAAW,GAC/DY,EAAgCd,CAAW,EAAE,QAAQ,SAAS,iBAAiB;AAAA,EAC7E,iBAAiB,CAAC,MAAM;AAAA,EACxB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,CACV;"}
|
package/mtds/dialog/dialog.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type DialogProps = React.ComponentPropsWithoutRef<"dialog"> & {
|
|
2
2
|
"data-closedby"?: "any" | "closerequest";
|
|
3
|
-
modal
|
|
3
|
+
"data-modal"?: boolean | "true" | "false";
|
|
4
|
+
modal?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare const Dialog: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref"> & {
|
|
6
7
|
"data-closedby"?: "any" | "closerequest";
|
|
7
|
-
modal
|
|
8
|
+
"data-modal"?: boolean | "true" | "false";
|
|
9
|
+
modal?: boolean;
|
|
8
10
|
} & React.RefAttributes<HTMLDialogElement>>;
|
package/mtds/dialog/dialog.js
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as i } from "../external/clsx/dist/clsx.js";
|
|
3
|
+
import { forwardRef as l } from "react";
|
|
4
4
|
import d from "../styles.module.css.js";
|
|
5
|
-
const
|
|
6
|
-
function({ className:
|
|
7
|
-
|
|
8
|
-
return u(i, () => o.current), p(() => {
|
|
9
|
-
var t;
|
|
10
|
-
const n = r ? e ? "showModal" : "show" : "close";
|
|
11
|
-
(t = o.current) == null || t[n]();
|
|
12
|
-
}, [r, e]), /* @__PURE__ */ c(
|
|
5
|
+
const g = l(
|
|
6
|
+
function({ className: a, modal: r = !0, ...o }, m) {
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
13
8
|
"dialog",
|
|
14
9
|
{
|
|
15
|
-
className:
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
className: i(d.dialog, a),
|
|
11
|
+
"data-modal": o["data-modal"] ?? r,
|
|
12
|
+
ref: m,
|
|
13
|
+
...o
|
|
18
14
|
}
|
|
19
15
|
);
|
|
20
16
|
}
|
|
21
17
|
);
|
|
22
18
|
export {
|
|
23
|
-
|
|
19
|
+
g as Dialog
|
|
24
20
|
};
|
|
25
21
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\tmodal?: boolean; // Ketp for backwards compatibility\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog","forwardRef","className","modal","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAUO,MAAMA,IAASC;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,IAAM,GAAGC,EAAK,GAAGC,GAAK;AAEzD,WAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,QAAQN,CAAS;AAAA,QACxC,cAAYE,EAAK,YAAY,KAAKD;AAAA,QAClC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type DividerProps = React.ComponentPropsWithoutRef<"hr"> & {
|
|
2
|
-
"data-gap"?: "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;
|
|
2
|
+
"data-gap"?: "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 | "none" | "sm" | "md" | "lg" | "xl";
|
|
3
3
|
};
|
|
4
4
|
export declare const Divider: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "ref"> & {
|
|
5
|
-
"data-gap"?: "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;
|
|
5
|
+
"data-gap"?: "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 | "none" | "sm" | "md" | "lg" | "xl";
|
|
6
6
|
} & React.RefAttributes<HTMLHRElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30;\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"names":["Divider","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"divider.js","sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30\n\t\t// Backwards compatibility:\n\t\t| \"none\"\n\t\t| \"sm\"\n\t\t| \"md\"\n\t\t| \"lg\"\n\t\t| \"xl\";\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"names":["Divider","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAsDa,MAAAA,IAAUC,EAAwC,SAC9D,EAAE,WAAAC,GAAW,GAAGC,EAAK,GACrBC,GACC;AACD;AAAA;AAAA,IAEC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,eAAY;AAAA,QACZ,WAAWC,EAAKC,EAAO,SAASL,CAAS;AAAA,QACzC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../styles.module.css.js";
|
|
2
|
+
import { IS_BROWSER as r, on as o, QUICK_EVENT as a, attr as m } from "../utils.js";
|
|
3
|
+
function f(n) {
|
|
4
|
+
var i;
|
|
5
|
+
if (n.animationName !== e._errorsummary) return;
|
|
6
|
+
const t = (i = n.target) == null ? void 0 : i.firstElementChild;
|
|
7
|
+
t instanceof HTMLHeadingElement && (m(t, "tabindex", "-1"), t.focus());
|
|
8
|
+
}
|
|
9
|
+
r && o(document, "animationend", f, a);
|
|
10
|
+
//# sourceMappingURL=errorsummary-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorsummary-observer.js","sources":["../../designsystem/errorsummary/errorsummary-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, QUICK_EVENT, attr, on } from \"../utils\";\n\nfunction handleInject(event: Event & { animationName?: string }) {\n if (event.animationName !== styles._errorsummary) return;\n const first = (event.target as Element)?.firstElementChild;\n\n if (first instanceof HTMLHeadingElement) {\n attr(first, \"tabindex\", \"-1\");\n first.focus(); // Autofocus first heading\n }\n}\n\nif (IS_BROWSER)\n on(document, 'animationend', handleInject, QUICK_EVENT);"],"names":["handleInject","event","styles","first","_a","attr","IS_BROWSER","on","QUICK_EVENT"],"mappings":";;AAGA,SAASA,EAAaC,GAA2C;;AAC3D,MAAAA,EAAM,kBAAkBC,EAAO,cAAe;AAC5C,QAAAC,KAASC,IAAAH,EAAM,WAAN,gBAAAG,EAA0B;AAEzC,EAAID,aAAiB,uBACdE,EAAAF,GAAO,YAAY,IAAI,GAC5BA,EAAM,MAAM;AAEhB;AAEIG,KACCC,EAAA,UAAU,gBAAgBP,GAAcQ,CAAW;"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const r = a(null);
|
|
9
|
-
return u(s, () => r.current), c(() => {
|
|
10
|
-
var t;
|
|
11
|
-
const e = (t = r.current) == null ? void 0 : t.firstElementChild;
|
|
12
|
-
e instanceof HTMLHeadingElement && (p(e, "tabindex", "-1"), e.focus());
|
|
13
|
-
}, []), /* @__PURE__ */ f(
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as t } from "../external/clsx/dist/clsx.js";
|
|
3
|
+
import { forwardRef as e } from "react";
|
|
4
|
+
import a from "../styles.module.css.js";
|
|
5
|
+
const c = e(
|
|
6
|
+
function({ className: r, ...o }, m) {
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
14
8
|
"div",
|
|
15
9
|
{
|
|
16
|
-
className:
|
|
10
|
+
className: t(a.errorsummary, r),
|
|
17
11
|
role: "alert",
|
|
18
|
-
ref:
|
|
19
|
-
...
|
|
12
|
+
ref: m,
|
|
13
|
+
...o
|
|
20
14
|
}
|
|
21
15
|
);
|
|
22
16
|
}
|
|
23
17
|
);
|
|
24
18
|
export {
|
|
25
|
-
|
|
19
|
+
c as Errorsummary
|
|
26
20
|
};
|
|
27
21
|
//# sourceMappingURL=errorsummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorsummary.js","sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef
|
|
1
|
+
{"version":3,"file":"errorsummary.js","sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type ErrorsummaryProps = React.ComponentPropsWithoutRef<\"div\">;\n\nexport const Errorsummary = forwardRef<HTMLDivElement, ErrorsummaryProps>(\n\tfunction Errorsummary({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={clsx(styles.errorsummary, className)}\n\t\t\t\trole=\"alert\"\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Errorsummary","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAMO,MAAMA,IAAeC;AAAA,EAC3B,SAAsB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AAEjD,WAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,cAAcL,CAAS;AAAA,QAC9C,MAAK;AAAA,QACL,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;"}
|