@mattilsynet/design 3.3.10 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/_virtual/_rolldown/runtime.js +17 -0
- package/mtds/ai/card.stories.tsx +54 -77
- package/mtds/ai/layout.mdx +37 -1
- package/mtds/ai/layout.stories.tsx +126 -1
- package/mtds/ai/print.mdx +1 -1
- package/mtds/ai/print.stories.tsx +1 -2
- package/mtds/alert/alert.js +16 -11
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.js +118 -118
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +31 -36
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +12 -26
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +6 -11
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +66 -60
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.js +83 -93
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-marker.js +63 -52
- package/mtds/atlas/atlas-marker.js.map +1 -1
- package/mtds/atlas/atlas-matgeo.js +67 -61
- package/mtds/atlas/atlas-matgeo.js.map +1 -1
- package/mtds/atlas/atlas-wms.js +33 -28
- package/mtds/atlas/atlas-wms.js.map +1 -1
- package/mtds/atlas/atlas.js +6 -38
- package/mtds/atlas/atlas.js.map +1 -1
- package/mtds/atlas/atlas2.js +39 -0
- package/mtds/atlas/atlas2.js.map +1 -0
- package/mtds/atlas/cluster.js +759 -1149
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +3 -4
- package/mtds/atlas.js +6 -14
- package/mtds/avatar/avatar.js +14 -10
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js +15 -10
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +15 -19
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js +18 -20
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js +22 -15
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart-axis.js +33 -21
- package/mtds/chart/chart-axis.js.map +1 -1
- package/mtds/chart/chart-bars.js +23 -21
- package/mtds/chart/chart-bars.js.map +1 -1
- package/mtds/chart/chart-element.js +94 -88
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.js +35 -37
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart-pies.js +17 -17
- package/mtds/chart/chart-pies.js.map +1 -1
- package/mtds/chart/chart.js +6 -52
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chart/chart2.js +21 -0
- package/mtds/chart/chart2.js.map +1 -0
- package/mtds/chip/chip.js +15 -11
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/deprecations.js +76 -158
- package/mtds/deprecations.js.map +1 -1
- package/mtds/details/details.js +21 -24
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog.js +17 -21
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js +15 -20
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js +14 -16
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +22 -25
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/helpers/dist/esm/index.js +21 -24
- package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/invariant/dist/esm/index.js +15 -19
- package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +270 -297
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +75 -101
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +4257 -6151
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet.css.js +5 -606
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js +24 -25
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
- package/mtds/external/robust-predicates/esm/incircle.js +5 -0
- package/mtds/external/robust-predicates/esm/incircle.js.map +1 -0
- package/mtds/external/robust-predicates/esm/insphere.js +5 -0
- package/mtds/external/robust-predicates/esm/insphere.js.map +1 -0
- package/mtds/external/robust-predicates/esm/orient2d.js +20 -22
- package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
- package/mtds/external/robust-predicates/esm/orient3d.js +5 -0
- package/mtds/external/robust-predicates/esm/orient3d.js.map +1 -0
- package/mtds/external/robust-predicates/esm/util.js +20 -28
- package/mtds/external/robust-predicates/esm/util.js.map +1 -1
- package/mtds/external/robust-predicates/index.js +5 -0
- package/mtds/field/field.js +167 -214
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset.js +32 -30
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/fileupload/fileupload.js +16 -13
- package/mtds/fileupload/fileupload.js.map +1 -1
- package/mtds/helptext/helptext.js +25 -27
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/identitet/illustrasjons-generator/illustrasjons-generator.d.ts +1 -0
- package/mtds/identitet/illustrasjons-generator/index-old-1.d.ts +1 -0
- package/mtds/identitet/infografikk-generator/infografikk-generator.d.ts +1 -0
- package/mtds/index.iife.js +21 -21
- package/mtds/index.js +38 -31
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.js +33 -47
- package/mtds/input/input.js.map +1 -1
- package/mtds/law/law-helper.js +106 -95
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +15 -10
- package/mtds/law/law.js.map +1 -1
- package/mtds/layout/layout.js +21 -13
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/layout/layout.stories.d.ts +1 -0
- package/mtds/link/link.js +15 -10
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +18 -18
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js +18 -18
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.js +6 -0
- package/mtds/package.js.map +1 -0
- package/mtds/package.json.d.ts +112 -0
- package/mtds/pagination/pagination.js +46 -60
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +15 -15
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.js +18 -20
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/print/print.js +15 -10
- package/mtds/print/print.js.map +1 -1
- package/mtds/print/print.stories.d.ts +0 -1
- package/mtds/profilering/epost.d.ts +1 -0
- package/mtds/progress/progress.js +15 -13
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-atlas.js +7 -16
- package/mtds/react.js +36 -84
- package/mtds/skeleton/skeleton.js +15 -11
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js +16 -13
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js +15 -10
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +2 -1
- package/mtds/styles.module.js +122 -0
- package/mtds/styles.module.js.map +1 -0
- package/mtds/table/table-observer.js +23 -28
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.js +88 -60
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js +32 -27
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js +16 -19
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tailwind.css +0 -4
- package/mtds/toast/toast-helper.js +45 -25
- package/mtds/toast/toast-helper.js.map +1 -1
- package/mtds/toast/toast-observer.js +18 -18
- package/mtds/toast/toast-observer.js.map +1 -1
- package/mtds/toast/toast.js +67 -54
- package/mtds/toast/toast.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js +31 -40
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-element.js +12 -25
- package/mtds/tooltip/tooltip-element.js.map +1 -1
- package/mtds/typography/typography.js +38 -21
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.js +53 -70
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation-observer.js +40 -47
- package/mtds/validation/validation-observer.js.map +1 -1
- package/mtds/validation/validation.js +17 -21
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +9 -9
- package/mtds/atlas/atlas.css.js +0 -138
- package/mtds/atlas/atlas.css.js.map +0 -1
- package/mtds/atlas.js.map +0 -1
- package/mtds/chart/chart.css.js +0 -187
- package/mtds/chart/chart.css.js.map +0 -1
- package/mtds/package.json.js +0 -5
- package/mtds/package.json.js.map +0 -1
- package/mtds/react-atlas.js.map +0 -1
- package/mtds/react.js.map +0 -1
- package/mtds/styles.module.css.js +0 -118
- package/mtds/styles.module.css.js.map +0 -1
|
@@ -1,28 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import { attr as t, on as n, tag as r } from "../utils.js";
|
|
3
|
+
import i from "clsx";
|
|
4
|
+
//#region designsystem/toast/toast-helper.ts
|
|
5
|
+
function a(a, s = {}) {
|
|
6
|
+
let c = document.getElementById(s.id || "") || r("dialog");
|
|
7
|
+
return t(c, "aria-busy", s.busy ? "true" : null), t(c, "class", i(e.toast, s.className)), t(c, "closedby", s.closedby || null), t(c, "data-color", s.color || null), t(c, "data-icon", `${s.icon ?? ""}` || null), t(c, "data-timeout", `${s.timeout ?? ""}` || null), t(c, "id", s.id || `${Date.now()}`), t(c, "open", s.open === !1 ? null : ""), c.innerHTML = a, n(c, "animationend", o, { once: !0 }), document.body.appendChild(c), c.id;
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
9
|
+
function o({ animationName: t, target: n }) {
|
|
10
|
+
t === e._toastClose && n.remove();
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
a.success = (e, t) => a(e, {
|
|
13
|
+
color: "success",
|
|
14
|
+
...t
|
|
15
|
+
}), a.danger = (e, t) => a(e, {
|
|
16
|
+
color: "danger",
|
|
17
|
+
...t
|
|
18
|
+
}), a.info = (e, t) => a(e, {
|
|
19
|
+
color: "info",
|
|
20
|
+
...t
|
|
21
|
+
}), a.warning = (e, t) => a(e, {
|
|
22
|
+
color: "warning",
|
|
23
|
+
...t
|
|
24
|
+
}), a.neutral = (e, t) => a(e, {
|
|
25
|
+
color: "neutral",
|
|
26
|
+
...t
|
|
27
|
+
}), a.promise = async function(e, t) {
|
|
28
|
+
let { loading: n, success: r, error: i, ...o } = t, s = a(n, {
|
|
29
|
+
busy: !0,
|
|
30
|
+
...o
|
|
31
|
+
});
|
|
32
|
+
try {
|
|
33
|
+
let t = await e();
|
|
34
|
+
return a.success(r, {
|
|
35
|
+
id: s,
|
|
36
|
+
busy: !1
|
|
37
|
+
}), t;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
throw a.danger(i, {
|
|
40
|
+
id: s,
|
|
41
|
+
busy: !1
|
|
42
|
+
}), e;
|
|
43
|
+
}
|
|
24
44
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=toast-helper.js.map
|
|
45
|
+
//#endregion
|
|
46
|
+
export { a as toast };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=toast-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-helper.js","sources":["../../designsystem/toast/toast-helper.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport styles from \"../styles.module.css\";\nimport { attr, on, tag } from \"../utils\";\n\nexport type ToastOptions = {\n\tclassName?: string;\n\tclosedby?: \"none\";\n\tcolor?: \"main\" | \"neutral\" | \"success\" | \"danger\" | \"info\" | \"warning\";\n\ticon?: boolean | \"none\";\n\ttimeout?: number | false;\n\tbusy?: boolean;\n\topen?: boolean;\n\tid?: string;\n};\n\nexport function toast(content: string, opt: ToastOptions = {}) {\n\tconst dialog = document.getElementById(opt.id || \"\") || tag(\"dialog\");\n\n\tattr(dialog, \"aria-busy\", opt.busy ? \"true\" : null);\n\tattr(dialog, \"class\", clsx(styles.toast, opt.className));\n\tattr(dialog, \"closedby\", opt.closedby || null);\n\tattr(dialog, \"data-color\", opt.color || null);\n\tattr(dialog, \"data-icon\", `${opt.icon ?? \"\"}` || null);\n\tattr(dialog, \"data-timeout\", `${opt.timeout ?? \"\"}` || null);\n\tattr(dialog, \"id\", opt.id || `${Date.now()}`);\n\tattr(dialog, \"open\", opt.open === false ? null : \"\");\n\n\tdialog.innerHTML = content;\n\ton(dialog, \"animationend\", handleToastClose, { once: true });\n\tdocument.body.appendChild(dialog);\n\treturn dialog.id;\n}\n\nfunction handleToastClose({ animationName, target }: Partial<AnimationEvent>) {\n\tif (animationName === styles._toastClose)\n\t\t(target as HTMLDialogElement).remove();\n}\n\n// Expose toast.danger, toast.info, toast.success etc.\ntoast.success = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"success\", ...opt });\ntoast.danger = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"danger\", ...opt });\ntoast.info = (content: string, opt: ToastOptions) =>\n\ttoast(content, { color: \"info\", ...opt });\ntoast.warning = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"warning\", ...opt });\ntoast.neutral = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"neutral\", ...opt });\ntoast.promise = async function promise<T>(\n\taction: () => Promise<T>,\n\tprops: ToastOptions & {\n\t\tloading: string;\n\t\tsuccess: string;\n\t\terror: string;\n\t},\n): Promise<T> {\n\tconst { loading, success, error, ...opt } = props;\n\tconst id = toast(loading, { busy: true, ...opt });\n\ttry {\n\t\tconst result = await action();\n\t\ttoast.success(success, { id, busy: false });\n\t\treturn result;\n\t} catch (_error) {\n\t\ttoast.danger(error, { id, busy: false });\n\t\tthrow _error;\n\t}\n};\n"],"
|
|
1
|
+
{"version":3,"file":"toast-helper.js","names":[],"sources":["../../designsystem/toast/toast-helper.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport styles from \"../styles.module.css\";\nimport { attr, on, tag } from \"../utils\";\n\nexport type ToastOptions = {\n\tclassName?: string;\n\tclosedby?: \"none\";\n\tcolor?: \"main\" | \"neutral\" | \"success\" | \"danger\" | \"info\" | \"warning\";\n\ticon?: boolean | \"none\";\n\ttimeout?: number | false;\n\tbusy?: boolean;\n\topen?: boolean;\n\tid?: string;\n};\n\nexport function toast(content: string, opt: ToastOptions = {}) {\n\tconst dialog = document.getElementById(opt.id || \"\") || tag(\"dialog\");\n\n\tattr(dialog, \"aria-busy\", opt.busy ? \"true\" : null);\n\tattr(dialog, \"class\", clsx(styles.toast, opt.className));\n\tattr(dialog, \"closedby\", opt.closedby || null);\n\tattr(dialog, \"data-color\", opt.color || null);\n\tattr(dialog, \"data-icon\", `${opt.icon ?? \"\"}` || null);\n\tattr(dialog, \"data-timeout\", `${opt.timeout ?? \"\"}` || null);\n\tattr(dialog, \"id\", opt.id || `${Date.now()}`);\n\tattr(dialog, \"open\", opt.open === false ? null : \"\");\n\n\tdialog.innerHTML = content;\n\ton(dialog, \"animationend\", handleToastClose, { once: true });\n\tdocument.body.appendChild(dialog);\n\treturn dialog.id;\n}\n\nfunction handleToastClose({ animationName, target }: Partial<AnimationEvent>) {\n\tif (animationName === styles._toastClose)\n\t\t(target as HTMLDialogElement).remove();\n}\n\n// Expose toast.danger, toast.info, toast.success etc.\ntoast.success = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"success\", ...opt });\ntoast.danger = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"danger\", ...opt });\ntoast.info = (content: string, opt: ToastOptions) =>\n\ttoast(content, { color: \"info\", ...opt });\ntoast.warning = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"warning\", ...opt });\ntoast.neutral = (content: string, opt?: ToastOptions) =>\n\ttoast(content, { color: \"neutral\", ...opt });\ntoast.promise = async function promise<T>(\n\taction: () => Promise<T>,\n\tprops: ToastOptions & {\n\t\tloading: string;\n\t\tsuccess: string;\n\t\terror: string;\n\t},\n): Promise<T> {\n\tconst { loading, success, error, ...opt } = props;\n\tconst id = toast(loading, { busy: true, ...opt });\n\ttry {\n\t\tconst result = await action();\n\t\ttoast.success(success, { id, busy: false });\n\t\treturn result;\n\t} catch (_error) {\n\t\ttoast.danger(error, { id, busy: false });\n\t\tthrow _error;\n\t}\n};\n"],"mappings":";;;;AAeA,SAAgB,EAAM,GAAiB,IAAoB,CAAC,GAAG;CAC9D,IAAM,IAAS,SAAS,eAAe,EAAI,MAAM,EAAE,KAAK,EAAI,QAAQ;CAcpE,OAZA,EAAK,GAAQ,aAAa,EAAI,OAAO,SAAS,IAAI,GAClD,EAAK,GAAQ,SAAS,EAAK,EAAO,OAAO,EAAI,SAAS,CAAC,GACvD,EAAK,GAAQ,YAAY,EAAI,YAAY,IAAI,GAC7C,EAAK,GAAQ,cAAc,EAAI,SAAS,IAAI,GAC5C,EAAK,GAAQ,aAAa,GAAG,EAAI,QAAQ,QAAQ,IAAI,GACrD,EAAK,GAAQ,gBAAgB,GAAG,EAAI,WAAW,QAAQ,IAAI,GAC3D,EAAK,GAAQ,MAAM,EAAI,MAAM,GAAG,KAAK,IAAI,GAAG,GAC5C,EAAK,GAAQ,QAAQ,EAAI,SAAS,KAAQ,OAAO,EAAE,GAEnD,EAAO,YAAY,GACnB,EAAG,GAAQ,gBAAgB,GAAkB,EAAE,MAAM,GAAK,CAAC,GAC3D,SAAS,KAAK,YAAY,CAAM,GACzB,EAAO;AACf;AAEA,SAAS,EAAiB,EAAE,kBAAe,aAAmC;CAC7E,AAAI,MAAkB,EAAO,eAC5B,EAA8B,OAAO;AACvC;AAGA,EAAM,WAAW,GAAiB,MACjC,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,UAAU,GAAiB,MAChC,EAAM,GAAS;CAAE,OAAO;CAAU,GAAG;AAAI,CAAC,GAC3C,EAAM,QAAQ,GAAiB,MAC9B,EAAM,GAAS;CAAE,OAAO;CAAQ,GAAG;AAAI,CAAC,GACzC,EAAM,WAAW,GAAiB,MACjC,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,WAAW,GAAiB,MACjC,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,UAAU,eACf,GACA,GAKa;CACb,IAAM,EAAE,YAAS,YAAS,UAAO,GAAG,MAAQ,GACtC,IAAK,EAAM,GAAS;EAAE,MAAM;EAAM,GAAG;CAAI,CAAC;CAChD,IAAI;EACH,IAAM,IAAS,MAAM,EAAO;EAE5B,OADA,EAAM,QAAQ,GAAS;GAAE;GAAI,MAAM;EAAM,CAAC,GACnC;CACR,SAAS,GAAQ;EAEhB,MADA,EAAM,OAAO,GAAO;GAAE;GAAI,MAAM;EAAM,CAAC,GACjC;CACP;AACD"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import { attr as t, on as n, onHotReload as r } from "../utils.js";
|
|
3
|
+
//#region designsystem/toast/toast-observer.ts
|
|
4
|
+
var i = e.toast.split(" ")[0], a = "data-sort";
|
|
5
|
+
function o({ animationName: n, target: r }) {
|
|
6
|
+
let o = r;
|
|
7
|
+
if (n === e._toastTimeout && o.close(), n !== e._toastOpen) return;
|
|
8
|
+
let s = Number(t(o, "data-timeout"));
|
|
9
|
+
o.style.setProperty("--mtdsc-toast-timeout", s ? `${s}ms` : null), o.hasAttribute(a) || t(o, a, `${Date.now()}`), t(o, "tabindex", "0"), [...document.querySelectorAll(`.${i}[open]`)].sort((e, n) => Number(t(n, a)) - Number(t(e, a))).reduce((e, t) => (t.style.translate = `0 ${t === r ? 0 : e}px`, e + t.offsetHeight + 5), 0);
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
function s({ target: e, clientX: n, clientY: r }) {
|
|
12
|
+
if (e instanceof HTMLDialogElement && e.classList.contains(i) && t(e, "data-closedby") !== "none") {
|
|
13
|
+
let t = e.getBoundingClientRect(), i = window.getComputedStyle(e), a = window.getComputedStyle(e, "::after"), o = t.top + Number.parseInt(i.paddingTop, 10), s = o + Number.parseInt(a.height, 10), c = t.right - Number.parseInt(i.paddingRight, 10), l = c - Number.parseInt(a.width, 10);
|
|
14
|
+
o <= r && r <= s && l <= n && n <= c && e.close();
|
|
15
|
+
}
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=toast-observer.js.map
|
|
17
|
+
r("toast", () => [n(document, "animationstart", o), n(document, "click", s)]);
|
|
18
|
+
//#endregion
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=toast-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-observer.js","sources":["../../designsystem/toast/toast-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, on, onHotReload } from \"../utils\";\n\nconst CSS_TOAST = styles.toast.split(\" \")[0];\nconst ATTR_SORT = \"data-sort\";\n\nfunction handleToastState({ animationName, target }: Partial<AnimationEvent>) {\n\tconst dialog = target as HTMLDialogElement;\n\tif (animationName === styles._toastTimeout) dialog.close();\n\tif (animationName !== styles._toastOpen) return;\n\n\tconst ms = Number(attr(dialog, \"data-timeout\"));\n\tdialog.style.setProperty(\"--mtdsc-toast-timeout\", ms ? `${ms}ms` : null);\n\tdialog.hasAttribute(ATTR_SORT) || attr(dialog, ATTR_SORT, `${Date.now()}`);\n\tattr(dialog, \"tabindex\", \"0\"); // Make focusable\n\n\t// Setup layout\n\t[...document.querySelectorAll<HTMLDialogElement>(`.${CSS_TOAST}[open]`)]\n\t\t.sort((a, b) => Number(attr(b, ATTR_SORT)) - Number(attr(a, ATTR_SORT)))\n\t\t.reduce((top, toast) => {\n\t\t\ttoast.style.translate = `0 ${toast === target ? 0 : top}px`;\n\t\t\treturn top + toast.offsetHeight + 5;\n\t\t}, 0);\n}\n\nfunction handleToastClick({ target, clientX: x, clientY: y }: MouseEvent) {\n\tif (\n\t\ttarget instanceof HTMLDialogElement &&\n\t\ttarget.classList.contains(CSS_TOAST) &&\n\t\tattr(target, \"data-closedby\") !== \"none\"\n\t) {\n\t\tconst rect = target.getBoundingClientRect();\n\t\tconst toast = window.getComputedStyle(target);\n\t\tconst close = window.getComputedStyle(target, \"::after\");\n\t\tconst top = rect.top + Number.parseInt(toast.paddingTop, 10);\n\t\tconst bottom = top + Number.parseInt(close.height, 10);\n\t\tconst right = rect.right - Number.parseInt(toast.paddingRight, 10);\n\t\tconst left = right - Number.parseInt(close.width, 10);\n\t\tconst isClose = top <= y && y <= bottom && left <= x && x <= right;\n\n\t\tif (isClose) target.close(); // Click is on ::after element\n\t}\n}\n\nonHotReload(\"toast\", () => [\n\ton(document, \"animationstart\", handleToastState),\n\ton(document, \"click\", handleToastClick as EventListener),\n]);\n"],"
|
|
1
|
+
{"version":3,"file":"toast-observer.js","names":[],"sources":["../../designsystem/toast/toast-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, on, onHotReload } from \"../utils\";\n\nconst CSS_TOAST = styles.toast.split(\" \")[0];\nconst ATTR_SORT = \"data-sort\";\n\nfunction handleToastState({ animationName, target }: Partial<AnimationEvent>) {\n\tconst dialog = target as HTMLDialogElement;\n\tif (animationName === styles._toastTimeout) dialog.close();\n\tif (animationName !== styles._toastOpen) return;\n\n\tconst ms = Number(attr(dialog, \"data-timeout\"));\n\tdialog.style.setProperty(\"--mtdsc-toast-timeout\", ms ? `${ms}ms` : null);\n\tdialog.hasAttribute(ATTR_SORT) || attr(dialog, ATTR_SORT, `${Date.now()}`);\n\tattr(dialog, \"tabindex\", \"0\"); // Make focusable\n\n\t// Setup layout\n\t[...document.querySelectorAll<HTMLDialogElement>(`.${CSS_TOAST}[open]`)]\n\t\t.sort((a, b) => Number(attr(b, ATTR_SORT)) - Number(attr(a, ATTR_SORT)))\n\t\t.reduce((top, toast) => {\n\t\t\ttoast.style.translate = `0 ${toast === target ? 0 : top}px`;\n\t\t\treturn top + toast.offsetHeight + 5;\n\t\t}, 0);\n}\n\nfunction handleToastClick({ target, clientX: x, clientY: y }: MouseEvent) {\n\tif (\n\t\ttarget instanceof HTMLDialogElement &&\n\t\ttarget.classList.contains(CSS_TOAST) &&\n\t\tattr(target, \"data-closedby\") !== \"none\"\n\t) {\n\t\tconst rect = target.getBoundingClientRect();\n\t\tconst toast = window.getComputedStyle(target);\n\t\tconst close = window.getComputedStyle(target, \"::after\");\n\t\tconst top = rect.top + Number.parseInt(toast.paddingTop, 10);\n\t\tconst bottom = top + Number.parseInt(close.height, 10);\n\t\tconst right = rect.right - Number.parseInt(toast.paddingRight, 10);\n\t\tconst left = right - Number.parseInt(close.width, 10);\n\t\tconst isClose = top <= y && y <= bottom && left <= x && x <= right;\n\n\t\tif (isClose) target.close(); // Click is on ::after element\n\t}\n}\n\nonHotReload(\"toast\", () => [\n\ton(document, \"animationstart\", handleToastState),\n\ton(document, \"click\", handleToastClick as EventListener),\n]);\n"],"mappings":";;;AAGA,IAAM,IAAY,EAAO,MAAM,MAAM,GAAG,CAAC,CAAC,IACpC,IAAY;AAElB,SAAS,EAAiB,EAAE,kBAAe,aAAmC;CAC7E,IAAM,IAAS;CAEf,IADI,MAAkB,EAAO,iBAAe,EAAO,MAAM,GACrD,MAAkB,EAAO,YAAY;CAEzC,IAAM,IAAK,OAAO,EAAK,GAAQ,cAAc,CAAC;CAM9C,AALA,EAAO,MAAM,YAAY,yBAAyB,IAAK,GAAG,EAAG,MAAM,IAAI,GACvE,EAAO,aAAa,CAAS,KAAK,EAAK,GAAQ,GAAW,GAAG,KAAK,IAAI,GAAG,GACzE,EAAK,GAAQ,YAAY,GAAG,GAG5B,CAAC,GAAG,SAAS,iBAAoC,IAAI,EAAU,OAAO,CAAC,CAAC,CACtE,MAAM,GAAG,MAAM,OAAO,EAAK,GAAG,CAAS,CAAC,IAAI,OAAO,EAAK,GAAG,CAAS,CAAC,CAAC,CAAC,CACvE,QAAQ,GAAK,OACb,EAAM,MAAM,YAAY,KAAK,MAAU,IAAS,IAAI,EAAI,KACjD,IAAM,EAAM,eAAe,IAChC,CAAC;AACN;AAEA,SAAS,EAAiB,EAAE,WAAQ,SAAS,GAAG,SAAS,KAAiB;CACzE,IACC,aAAkB,qBAClB,EAAO,UAAU,SAAS,CAAS,KACnC,EAAK,GAAQ,eAAe,MAAM,QACjC;EACD,IAAM,IAAO,EAAO,sBAAsB,GACpC,IAAQ,OAAO,iBAAiB,CAAM,GACtC,IAAQ,OAAO,iBAAiB,GAAQ,SAAS,GACjD,IAAM,EAAK,MAAM,OAAO,SAAS,EAAM,YAAY,EAAE,GACrD,IAAS,IAAM,OAAO,SAAS,EAAM,QAAQ,EAAE,GAC/C,IAAQ,EAAK,QAAQ,OAAO,SAAS,EAAM,cAAc,EAAE,GAC3D,IAAO,IAAQ,OAAO,SAAS,EAAM,OAAO,EAAE;EAGpD,AAFgB,KAAO,KAAK,KAAK,KAAU,KAAQ,KAAK,KAAK,KAEhD,EAAO,MAAM;CAC3B;AACD;AAEA,EAAY,eAAe,CAC1B,EAAG,UAAU,kBAAkB,CAAgB,GAC/C,EAAG,UAAU,SAAS,CAAiC,CACxD,CAAC"}
|
package/mtds/toast/toast.js
CHANGED
|
@@ -1,57 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../styles.module.js";
|
|
3
|
+
import { isBrowser as t, tag as n } from "../utils.js";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { createRoot as a } from "react-dom/client";
|
|
7
|
+
//#region designsystem/toast/toast.tsx
|
|
8
|
+
if (t() && !window._mtdsReactToasts) {
|
|
9
|
+
let t, r = /* @__PURE__ */ new Map(), i = () => t?.render(Array.from(r.values() || []));
|
|
10
|
+
window._mtdsReactToasts = {
|
|
11
|
+
set: (e, o) => {
|
|
12
|
+
t ||= a(document.body.appendChild(n("div"))), r.set(e, o) && i();
|
|
13
|
+
},
|
|
14
|
+
delete: ({ animationName: t, currentTarget: n }) => {
|
|
15
|
+
t === e._toastClose && (r.delete(n.id), i());
|
|
16
|
+
}
|
|
17
|
+
};
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
open: o.open ?? !0,
|
|
33
|
-
suppressHydrationWarning: !0,
|
|
34
|
-
children: s
|
|
35
|
-
},
|
|
36
|
-
t
|
|
37
|
-
)
|
|
38
|
-
), t;
|
|
19
|
+
function o(t, n = {}) {
|
|
20
|
+
let a = n.id || `${Date.now()}`;
|
|
21
|
+
return window._mtdsReactToasts?.set(a, /* @__PURE__ */ i("dialog", {
|
|
22
|
+
"aria-busy": n.busy,
|
|
23
|
+
className: r(e.toast, n.className),
|
|
24
|
+
closedby: n.closedby,
|
|
25
|
+
"data-color": n.color,
|
|
26
|
+
"data-timeout": n.timeout,
|
|
27
|
+
id: a,
|
|
28
|
+
onAnimationEnd: window._mtdsReactToasts.delete,
|
|
29
|
+
open: n.open ?? !0,
|
|
30
|
+
suppressHydrationWarning: !0,
|
|
31
|
+
children: t
|
|
32
|
+
}, a)), a;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
o.success = (e, t) => o(e, {
|
|
35
|
+
color: "success",
|
|
36
|
+
...t
|
|
37
|
+
}), o.danger = (e, t) => o(e, {
|
|
38
|
+
color: "danger",
|
|
39
|
+
...t
|
|
40
|
+
}), o.info = (e, t) => o(e, {
|
|
41
|
+
color: "info",
|
|
42
|
+
...t
|
|
43
|
+
}), o.warning = (e, t) => o(e, {
|
|
44
|
+
color: "warning",
|
|
45
|
+
...t
|
|
46
|
+
}), o.neutral = (e, t) => o(e, {
|
|
47
|
+
color: "neutral",
|
|
48
|
+
...t
|
|
49
|
+
}), o.promise = async function(e, t) {
|
|
50
|
+
let { loading: n, success: r, error: i, ...a } = t, s = o(n, {
|
|
51
|
+
busy: !0,
|
|
52
|
+
...a
|
|
53
|
+
});
|
|
54
|
+
try {
|
|
55
|
+
let t = await e();
|
|
56
|
+
return o.success(r, {
|
|
57
|
+
id: s,
|
|
58
|
+
busy: !1
|
|
59
|
+
}), t;
|
|
60
|
+
} catch (e) {
|
|
61
|
+
throw o.danger(i, {
|
|
62
|
+
id: s,
|
|
63
|
+
busy: !1
|
|
64
|
+
}), e;
|
|
65
|
+
}
|
|
53
66
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=toast.js.map
|
|
67
|
+
//#endregion
|
|
68
|
+
export { o as toast };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=toast.js.map
|
package/mtds/toast/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sources":["../../designsystem/toast/toast.tsx"],"sourcesContent":["\"use client\";\nimport clsx from \"clsx\";\nimport { createRoot } from \"react-dom/client\";\nimport styles from \"../styles.module.css\";\nimport { isBrowser, tag } from \"../utils\";\nimport type { ToastOptions } from \"./toast-helper\";\n\ndeclare global {\n\tinterface Window {\n\t\t_mtdsReactToasts?: {\n\t\t\tset: (id: string, jsx: React.ReactNode) => void;\n\t\t\tdelete: (event: React.AnimationEvent<HTMLDialogElement>) => void;\n\t\t};\n\t}\n}\n\n// Ensure only a single toast master is created\nif (isBrowser() && !window._mtdsReactToasts) {\n\tlet root: ReturnType<typeof createRoot>; // Create root on first toast to avoid hydration issues\n\tconst toasts = new Map<string, React.ReactNode>();\n\tconst render = () => root?.render(Array.from(toasts.values() || []));\n\n\t// Expose methods to add/remove toasts from the root container\n\twindow._mtdsReactToasts = {\n\t\tset: (id, jsx) => {\n\t\t\tif (!root) root = createRoot(document.body.appendChild(tag(\"div\")));\n\t\t\tif (toasts.set(id, jsx)) render();\n\t\t},\n\t\tdelete: ({ animationName, currentTarget }) => {\n\t\t\tif (animationName !== styles._toastClose) return;\n\t\t\ttoasts.delete(currentTarget.id);\n\t\t\trender();\n\t\t},\n\t};\n}\n\nexport function toast(content: React.ReactNode, opt: ToastOptions = {}) {\n\tconst id = opt.id || `${Date.now()}`;\n\twindow._mtdsReactToasts?.set(\n\t\tid,\n\t\t<dialog\n\t\t\taria-busy={opt.busy}\n\t\t\tclassName={clsx(styles.toast, opt.className)}\n\t\t\tclosedby={opt.closedby}\n\t\t\tdata-color={opt.color}\n\t\t\tdata-timeout={opt.timeout}\n\t\t\tid={id}\n\t\t\tkey={id}\n\t\t\tonAnimationEnd={window._mtdsReactToasts.delete}\n\t\t\topen={opt.open ?? true}\n\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t>\n\t\t\t{content}\n\t\t</dialog>,\n\t);\n\n\treturn id;\n}\n\n// Expose toast.danger, toast.info, toast.success etc.\ntoast.success = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"success\", ...opt });\ntoast.danger = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"danger\", ...opt });\ntoast.info = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"info\", ...opt });\ntoast.warning = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"warning\", ...opt });\ntoast.neutral = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"neutral\", ...opt });\ntoast.promise = async function promise<T>(\n\taction: () => Promise<T>,\n\tprops: ToastOptions & {\n\t\tloading: React.ReactNode;\n\t\tsuccess: React.ReactNode;\n\t\terror: React.ReactNode;\n\t},\n): Promise<T> {\n\tconst { loading, success, error, ...opt } = props;\n\tconst id = toast(loading, { busy: true, ...opt });\n\ttry {\n\t\tconst result = await action();\n\t\ttoast.success(success, { id, busy: false });\n\t\treturn result;\n\t} catch (_error) {\n\t\ttoast.danger(error, { id, busy: false });\n\t\tthrow _error;\n\t}\n};\n"],"
|
|
1
|
+
{"version":3,"file":"toast.js","names":[],"sources":["../../designsystem/toast/toast.tsx"],"sourcesContent":["\"use client\";\nimport clsx from \"clsx\";\nimport { createRoot } from \"react-dom/client\";\nimport styles from \"../styles.module.css\";\nimport { isBrowser, tag } from \"../utils\";\nimport type { ToastOptions } from \"./toast-helper\";\n\ndeclare global {\n\tinterface Window {\n\t\t_mtdsReactToasts?: {\n\t\t\tset: (id: string, jsx: React.ReactNode) => void;\n\t\t\tdelete: (event: React.AnimationEvent<HTMLDialogElement>) => void;\n\t\t};\n\t}\n}\n\n// Ensure only a single toast master is created\nif (isBrowser() && !window._mtdsReactToasts) {\n\tlet root: ReturnType<typeof createRoot>; // Create root on first toast to avoid hydration issues\n\tconst toasts = new Map<string, React.ReactNode>();\n\tconst render = () => root?.render(Array.from(toasts.values() || []));\n\n\t// Expose methods to add/remove toasts from the root container\n\twindow._mtdsReactToasts = {\n\t\tset: (id, jsx) => {\n\t\t\tif (!root) root = createRoot(document.body.appendChild(tag(\"div\")));\n\t\t\tif (toasts.set(id, jsx)) render();\n\t\t},\n\t\tdelete: ({ animationName, currentTarget }) => {\n\t\t\tif (animationName !== styles._toastClose) return;\n\t\t\ttoasts.delete(currentTarget.id);\n\t\t\trender();\n\t\t},\n\t};\n}\n\nexport function toast(content: React.ReactNode, opt: ToastOptions = {}) {\n\tconst id = opt.id || `${Date.now()}`;\n\twindow._mtdsReactToasts?.set(\n\t\tid,\n\t\t<dialog\n\t\t\taria-busy={opt.busy}\n\t\t\tclassName={clsx(styles.toast, opt.className)}\n\t\t\tclosedby={opt.closedby}\n\t\t\tdata-color={opt.color}\n\t\t\tdata-timeout={opt.timeout}\n\t\t\tid={id}\n\t\t\tkey={id}\n\t\t\tonAnimationEnd={window._mtdsReactToasts.delete}\n\t\t\topen={opt.open ?? true}\n\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t>\n\t\t\t{content}\n\t\t</dialog>,\n\t);\n\n\treturn id;\n}\n\n// Expose toast.danger, toast.info, toast.success etc.\ntoast.success = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"success\", ...opt });\ntoast.danger = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"danger\", ...opt });\ntoast.info = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"info\", ...opt });\ntoast.warning = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"warning\", ...opt });\ntoast.neutral = (content: React.ReactNode, opt?: ToastOptions) =>\n\ttoast(content, { color: \"neutral\", ...opt });\ntoast.promise = async function promise<T>(\n\taction: () => Promise<T>,\n\tprops: ToastOptions & {\n\t\tloading: React.ReactNode;\n\t\tsuccess: React.ReactNode;\n\t\terror: React.ReactNode;\n\t},\n): Promise<T> {\n\tconst { loading, success, error, ...opt } = props;\n\tconst id = toast(loading, { busy: true, ...opt });\n\ttry {\n\t\tconst result = await action();\n\t\ttoast.success(success, { id, busy: false });\n\t\treturn result;\n\t} catch (_error) {\n\t\ttoast.danger(error, { id, busy: false });\n\t\tthrow _error;\n\t}\n};\n"],"mappings":";;;;;;;AAiBA,IAAI,EAAU,KAAK,CAAC,OAAO,kBAAkB;CAC5C,IAAI,GACE,oBAAS,IAAI,IAA6B,GAC1C,UAAe,GAAM,OAAO,MAAM,KAAK,EAAO,OAAO,KAAK,CAAC,CAAC,CAAC;CAGnE,OAAO,mBAAmB;EACzB,MAAM,GAAI,MAAQ;GAEjB,AADA,AAAW,MAAO,EAAW,SAAS,KAAK,YAAY,EAAI,KAAK,CAAC,CAAC,GAC9D,EAAO,IAAI,GAAI,CAAG,KAAG,EAAO;EACjC;EACA,SAAS,EAAE,kBAAe,uBAAoB;GACzC,MAAkB,EAAO,gBAC7B,EAAO,OAAO,EAAc,EAAE,GAC9B,EAAO;EACR;CACD;AACD;AAEA,SAAgB,EAAM,GAA0B,IAAoB,CAAC,GAAG;CACvE,IAAM,IAAK,EAAI,MAAM,GAAG,KAAK,IAAI;CAmBjC,OAlBA,OAAO,kBAAkB,IACxB,GACA,kBAAC,UAAD;EACC,aAAW,EAAI;EACf,WAAW,EAAK,EAAO,OAAO,EAAI,SAAS;EAC3C,UAAU,EAAI;EACd,cAAY,EAAI;EAChB,gBAAc,EAAI;EACd;EAEJ,gBAAgB,OAAO,iBAAiB;EACxC,MAAM,EAAI,QAAQ;EAClB,0BAAA;YAEC;CACM,GANF,CAME,CACT,GAEO;AACR;AAGA,EAAM,WAAW,GAA0B,MAC1C,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,UAAU,GAA0B,MACzC,EAAM,GAAS;CAAE,OAAO;CAAU,GAAG;AAAI,CAAC,GAC3C,EAAM,QAAQ,GAA0B,MACvC,EAAM,GAAS;CAAE,OAAO;CAAQ,GAAG;AAAI,CAAC,GACzC,EAAM,WAAW,GAA0B,MAC1C,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,WAAW,GAA0B,MAC1C,EAAM,GAAS;CAAE,OAAO;CAAW,GAAG;AAAI,CAAC,GAC5C,EAAM,UAAU,eACf,GACA,GAKa;CACb,IAAM,EAAE,YAAS,YAAS,UAAO,GAAG,MAAQ,GACtC,IAAK,EAAM,GAAS;EAAE,MAAM;EAAM,GAAG;CAAI,CAAC;CAChD,IAAI;EACH,IAAM,IAAS,MAAM,EAAO;EAE5B,OADA,EAAM,QAAQ,GAAS;GAAE;GAAI,MAAM;EAAM,CAAC,GACnC;CACR,SAAS,GAAQ;EAEhB,MADA,EAAM,OAAO,GAAO;GAAE;GAAI,MAAM;EAAM,CAAC,GACjC;CACP;AACD"}
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
] });
|
|
33
|
-
}
|
|
34
|
-
), I = Object.assign(f, {
|
|
35
|
-
Item: d
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
I as Togglegroup
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=togglegroup.js.map
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region designsystem/togglegroup/togglegroup.tsx
|
|
6
|
+
var a = n(function({ "data-toggle-group": n, className: i, ...a }, o) {
|
|
7
|
+
return /* @__PURE__ */ r("fieldset", {
|
|
8
|
+
className: t(e.togglegroup, i),
|
|
9
|
+
"data-toggle-group": n || "Valgknapper",
|
|
10
|
+
ref: o,
|
|
11
|
+
...a
|
|
12
|
+
});
|
|
13
|
+
}), o = n(function({ children: t, checked: n, defaultChecked: a, value: o, name: s, onChange: c, ...l }, u) {
|
|
14
|
+
return /* @__PURE__ */ i("label", {
|
|
15
|
+
className: e.button,
|
|
16
|
+
ref: u,
|
|
17
|
+
...l,
|
|
18
|
+
children: [/* @__PURE__ */ r("input", {
|
|
19
|
+
type: "radio",
|
|
20
|
+
checked: n,
|
|
21
|
+
defaultChecked: a,
|
|
22
|
+
value: o,
|
|
23
|
+
name: s,
|
|
24
|
+
onChange: c
|
|
25
|
+
}), t]
|
|
26
|
+
});
|
|
27
|
+
}), s = Object.assign(a, { Item: o });
|
|
28
|
+
//#endregion
|
|
29
|
+
export { s as Togglegroup };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=togglegroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"togglegroup.js","sources":["../../designsystem/togglegroup/togglegroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type { InputProps } from \"../react\";\nimport styles from \"../styles.module.css\";\n\nexport type TogglegroupProps = React.ComponentPropsWithoutRef<\"fieldset\"> & {\n\t\"data-toggle-group\"?: string;\n};\nexport type TogglegroupItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"label\">,\n\t\"onChange\"\n> &\n\tPick<InputProps, \"defaultChecked\" | \"checked\" | \"onChange\" | \"value\"> &\n\tRequired<Pick<InputProps, \"name\">>; // Make name required\n\nconst TogglegroupComp = forwardRef<HTMLFieldSetElement, TogglegroupProps>(\n\tfunction Togglegroup(\n\t\t{ \"data-toggle-group\": label, className, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<fieldset\n\t\t\t\tclassName={clsx(styles.togglegroup, className)}\n\t\t\t\tdata-toggle-group={label || \"Valgknapper\"}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\nconst TogglegroupItem = forwardRef<HTMLLabelElement, TogglegroupItemProps>(\n\tfunction TogglegroupItem(\n\t\t{ children, checked, defaultChecked, value, name, onChange, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<label className={styles.button} ref={ref} {...rest}>\n\t\t\t\t<input\n\t\t\t\t\t{...{ type: \"radio\", checked, defaultChecked, value, name, onChange }}\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t},\n);\n\nexport const Togglegroup = Object.assign(TogglegroupComp, {\n\tItem: TogglegroupItem,\n});\n"],"
|
|
1
|
+
{"version":3,"file":"togglegroup.js","names":[],"sources":["../../designsystem/togglegroup/togglegroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type { InputProps } from \"../react\";\nimport styles from \"../styles.module.css\";\n\nexport type TogglegroupProps = React.ComponentPropsWithoutRef<\"fieldset\"> & {\n\t\"data-toggle-group\"?: string;\n};\nexport type TogglegroupItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"label\">,\n\t\"onChange\"\n> &\n\tPick<InputProps, \"defaultChecked\" | \"checked\" | \"onChange\" | \"value\"> &\n\tRequired<Pick<InputProps, \"name\">>; // Make name required\n\nconst TogglegroupComp = forwardRef<HTMLFieldSetElement, TogglegroupProps>(\n\tfunction Togglegroup(\n\t\t{ \"data-toggle-group\": label, className, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<fieldset\n\t\t\t\tclassName={clsx(styles.togglegroup, className)}\n\t\t\t\tdata-toggle-group={label || \"Valgknapper\"}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\nconst TogglegroupItem = forwardRef<HTMLLabelElement, TogglegroupItemProps>(\n\tfunction TogglegroupItem(\n\t\t{ children, checked, defaultChecked, value, name, onChange, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<label className={styles.button} ref={ref} {...rest}>\n\t\t\t\t<input\n\t\t\t\t\t{...{ type: \"radio\", checked, defaultChecked, value, name, onChange }}\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t},\n);\n\nexport const Togglegroup = Object.assign(TogglegroupComp, {\n\tItem: TogglegroupItem,\n});\n"],"mappings":";;;;;AAeA,IAAM,IAAkB,EACvB,SACC,EAAE,qBAAqB,GAAO,cAAW,GAAG,KAC5C,GACC;CACD,OACC,kBAAC,YAAD;EACC,WAAW,EAAK,EAAO,aAAa,CAAS;EAC7C,qBAAmB,KAAS;EACvB;EACL,GAAI;CACJ,CAAA;AAEH,CACD,GACM,IAAkB,EACvB,SACC,EAAE,aAAU,YAAS,mBAAgB,UAAO,SAAM,aAAU,GAAG,KAC/D,GACC;CACD,OACC,kBAAC,SAAD;EAAO,WAAW,EAAO;EAAa;EAAK,GAAI;YAA/C,CACC,kBAAC,SAAD;GACO,MAAM;GAAS;GAAS;GAAgB;GAAO;GAAM;EAC3D,CAAA,GACA,CACK;;AAET,CACD,GAEa,IAAc,OAAO,OAAO,GAAiB,EACzD,MAAM,EACP,CAAC"}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import "../
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import "../popover/popover-observer.js";
|
|
14
|
-
import "../table/table-observer.js";
|
|
15
|
-
import "../toast/toast-observer.js";
|
|
16
|
-
import "../validation/validation-observer.js";
|
|
17
|
-
o() && t(
|
|
18
|
-
document.getElementById("mtds-tooltip") || m("div", {
|
|
19
|
-
class: i._tooltip,
|
|
20
|
-
id: "mtds-tooltip",
|
|
21
|
-
popover: "manual"
|
|
22
|
-
})
|
|
23
|
-
// This id is also used by app.module.css
|
|
24
|
-
);
|
|
25
|
-
//# sourceMappingURL=tooltip-element.js.map
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import { isBrowser as t, tag as n } from "../utils.js";
|
|
3
|
+
import { designsystem_exports as r } from "../index.js";
|
|
4
|
+
//#region designsystem/tooltip/tooltip-element.ts
|
|
5
|
+
t() && (0, r.setTooltipElement)(document.getElementById("mtds-tooltip") || n("div", {
|
|
6
|
+
class: e._tooltip,
|
|
7
|
+
id: "mtds-tooltip",
|
|
8
|
+
popover: "manual"
|
|
9
|
+
}));
|
|
10
|
+
//#endregion
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=tooltip-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-element.js","sources":["../../designsystem/tooltip/tooltip-element.ts"],"sourcesContent":["import { setTooltipElement } from \"..\";\nimport styles from \"../styles.module.css\";\nimport { isBrowser, tag } from \"../utils\";\n\n// Set custom tooltip element\nif (isBrowser())\n\tsetTooltipElement(\n\t\tdocument.getElementById(\"mtds-tooltip\") ||\n\t\t\ttag(\"div\", {\n\t\t\t\tclass: styles._tooltip,\n\t\t\t\tid: \"mtds-tooltip\",\n\t\t\t\tpopover: \"manual\",\n\t\t\t}), // This id is also used by app.module.css\n\t);\n"],"
|
|
1
|
+
{"version":3,"file":"tooltip-element.js","names":[],"sources":["../../designsystem/tooltip/tooltip-element.ts"],"sourcesContent":["import { setTooltipElement } from \"..\";\nimport styles from \"../styles.module.css\";\nimport { isBrowser, tag } from \"../utils\";\n\n// Set custom tooltip element\nif (isBrowser())\n\tsetTooltipElement(\n\t\tdocument.getElementById(\"mtds-tooltip\") ||\n\t\t\ttag(\"div\", {\n\t\t\t\tclass: styles._tooltip,\n\t\t\t\tid: \"mtds-tooltip\",\n\t\t\t\tpopover: \"manual\",\n\t\t\t}), // This id is also used by app.module.css\n\t);\n"],"mappings":";;;;AAKI,EAAU,MACb,GAAA,EAAA,kBAAA,CACC,SAAS,eAAe,cAAc,KACrC,EAAI,OAAO;CACV,OAAO,EAAO;CACd,IAAI;CACJ,SAAS;AACV,CAAC,CACH"}
|
|
@@ -1,23 +1,40 @@
|
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
1
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
//#region designsystem/typography/typography.tsx
|
|
6
|
+
var i = n(function({ as: n, className: i, ...a }, o) {
|
|
7
|
+
return /* @__PURE__ */ r(n || "h2", {
|
|
8
|
+
className: t(e.heading, i),
|
|
9
|
+
ref: o,
|
|
10
|
+
...a
|
|
11
|
+
});
|
|
12
|
+
}), a = n(function({ as: n, className: i, ...a }, o) {
|
|
13
|
+
return /* @__PURE__ */ r(n || "small", {
|
|
14
|
+
className: t(e.muted, i),
|
|
15
|
+
ref: o,
|
|
16
|
+
...a
|
|
17
|
+
});
|
|
18
|
+
}), o = n(function({ as: n, className: i, ...a }, o) {
|
|
19
|
+
return /* @__PURE__ */ r(n || "span", {
|
|
20
|
+
className: t(e.ingress, i),
|
|
21
|
+
ref: o,
|
|
22
|
+
...a
|
|
23
|
+
});
|
|
24
|
+
}), s = n(function({ as: n, className: i, ...a }, o) {
|
|
25
|
+
return /* @__PURE__ */ r(n || "div", {
|
|
26
|
+
className: t(e.info, i),
|
|
27
|
+
ref: o,
|
|
28
|
+
...a
|
|
29
|
+
});
|
|
30
|
+
}), c = n(function({ as: n, className: i, ...a }, o) {
|
|
31
|
+
return /* @__PURE__ */ r(n || "div", {
|
|
32
|
+
className: t(e.prose, i),
|
|
33
|
+
ref: o,
|
|
34
|
+
...a
|
|
35
|
+
});
|
|
15
36
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
l as Muted,
|
|
21
|
-
I as Prose
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=typography.js.map
|
|
37
|
+
//#endregion
|
|
38
|
+
export { i as Heading, s as Info, o as Ingress, a as Muted, c as Prose };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sources":["../../designsystem/typography/typography.tsx"],"sourcesContent":["import 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 HeadingSizes = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingProps<As extends React.ElementType = \"h2\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-size\"?: HeadingSizes;\n\t\t\t\"data-justify\"?: \"start\" | \"center\";\n\t\t}\n\t>;\n\ntype HeadingComponent = <As extends React.ElementType = \"h2\">(\n\tprops: HeadingProps<As>,\n) => JSX.Element;\n\nexport const Heading: HeadingComponent = forwardRef<null>(function Heading<\n\tAs extends React.ElementType = \"h2\",\n>({ as, className, ...rest }: HeadingProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"h2\";\n\n\treturn (\n\t\t<Tag className={clsx(styles.heading, className)} ref={ref} {...rest} />\n\t);\n}) as HeadingComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type MutedProps<As extends React.ElementType = \"small\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype MutedComponent = <As extends React.ElementType = \"small\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Muted: MutedComponent = forwardRef<null>(function Muted<\n\tAs extends React.ElementType = \"small\",\n>({ as, className, ...rest }: MutedProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"small\";\n\treturn <Tag className={clsx(styles.muted, className)} ref={ref} {...rest} />;\n}) as MutedComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type IngressProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype IngressComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Ingress: IngressComponent = forwardRef<null>(function Ingress<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: IngressProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn (\n\t\t<Tag className={clsx(styles.ingress, className)} ref={ref} {...rest} />\n\t);\n}) as IngressComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type InfoProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{ \"data-variant\"?: \"regular\" | \"circle\" }\n\t>;\n\ntype InfoComponent = <As extends React.ElementType = \"div\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Info: InfoComponent = forwardRef<null>(function Info<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: InfoProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\treturn <Tag className={clsx(styles.info, className)} ref={ref} {...rest} />;\n}) as InfoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\n/**\n * Prose\n */\nexport type ProseProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{ \"data-justify\"?: \"start\" | \"center\" | \"end\" }\n\t>;\n\ntype ProseComponent = <As extends React.ElementType = \"div\">(\n\tprops: ProseProps<As>,\n) => JSX.Element;\n\nexport const Prose: ProseComponent = forwardRef<null>(function Prose<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: ProseProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.prose, className)} ref={ref} {...rest} />;\n}) as ProseComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"
|
|
1
|
+
{"version":3,"file":"typography.js","names":[],"sources":["../../designsystem/typography/typography.tsx"],"sourcesContent":["import 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 HeadingSizes = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type HeadingProps<As extends React.ElementType = \"h2\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-size\"?: HeadingSizes;\n\t\t\t\"data-justify\"?: \"start\" | \"center\";\n\t\t}\n\t>;\n\ntype HeadingComponent = <As extends React.ElementType = \"h2\">(\n\tprops: HeadingProps<As>,\n) => JSX.Element;\n\nexport const Heading: HeadingComponent = forwardRef<null>(function Heading<\n\tAs extends React.ElementType = \"h2\",\n>({ as, className, ...rest }: HeadingProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"h2\";\n\n\treturn (\n\t\t<Tag className={clsx(styles.heading, className)} ref={ref} {...rest} />\n\t);\n}) as HeadingComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type MutedProps<As extends React.ElementType = \"small\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype MutedComponent = <As extends React.ElementType = \"small\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Muted: MutedComponent = forwardRef<null>(function Muted<\n\tAs extends React.ElementType = \"small\",\n>({ as, className, ...rest }: MutedProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"small\";\n\treturn <Tag className={clsx(styles.muted, className)} ref={ref} {...rest} />;\n}) as MutedComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type IngressProps<As extends React.ElementType = \"span\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype IngressComponent = <As extends React.ElementType = \"span\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Ingress: IngressComponent = forwardRef<null>(function Ingress<\n\tAs extends React.ElementType = \"span\",\n>({ as, className, ...rest }: IngressProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"span\";\n\treturn (\n\t\t<Tag className={clsx(styles.ingress, className)} ref={ref} {...rest} />\n\t);\n}) as IngressComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type InfoProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{ \"data-variant\"?: \"regular\" | \"circle\" }\n\t>;\n\ntype InfoComponent = <As extends React.ElementType = \"div\">(\n\tprops: MutedProps<As>,\n) => JSX.Element;\n\nexport const Info: InfoComponent = forwardRef<null>(function Info<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: InfoProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\treturn <Tag className={clsx(styles.info, className)} ref={ref} {...rest} />;\n}) as InfoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\n/**\n * Prose\n */\nexport type ProseProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{ \"data-justify\"?: \"start\" | \"center\" | \"end\" }\n\t>;\n\ntype ProseComponent = <As extends React.ElementType = \"div\">(\n\tprops: ProseProps<As>,\n) => JSX.Element;\n\nexport const Prose: ProseComponent = forwardRef<null>(function Prose<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: ProseProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.prose, className)} ref={ref} {...rest} />;\n}) as ProseComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"mappings":";;;;;AAsBA,IAAa,IAA4B,EAAiB,SAExD,EAAE,OAAI,cAAW,GAAG,KAA0B,GAA0B;CAGzE,OACC,kBAHW,KAAM,MAGjB;EAAK,WAAW,EAAK,EAAO,SAAS,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAExE,CAAC,GASY,IAAwB,EAAiB,SAEpD,EAAE,OAAI,cAAW,GAAG,KAAwB,GAA0B;CAEvE,OAAO,kBADK,KAAM,SACX;EAAK,WAAW,EAAK,EAAO,OAAO,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC5E,CAAC,GASY,IAA4B,EAAiB,SAExD,EAAE,OAAI,cAAW,GAAG,KAA0B,GAA0B;CAEzE,OACC,kBAFW,KAAM,QAEjB;EAAK,WAAW,EAAK,EAAO,SAAS,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAExE,CAAC,GAYY,IAAsB,EAAiB,SAElD,EAAE,OAAI,cAAW,GAAG,KAAuB,GAA0B;CAEtE,OAAO,kBADK,KAAM,OACX;EAAK,WAAW,EAAK,EAAO,MAAM,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC3E,CAAC,GAeY,IAAwB,EAAiB,SAEpD,EAAE,OAAI,cAAW,GAAG,KAAwB,GAA0B;CAGvE,OAAO,kBAFK,KAAM,OAEX;EAAK,WAAW,EAAK,EAAO,OAAO,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC5E,CAAC"}
|