@mattilsynet/design 0.5.4 → 1.0.0
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/card/card.stories.d.ts +3 -2
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +250 -0
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +1 -0
- package/mtds/external/@u-elements/u-tags/dist/u-tags.js +367 -0
- package/mtds/external/@u-elements/u-tags/dist/u-tags.js.map +1 -0
- package/mtds/field/field-observer.js +42 -34
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.stories.d.ts +2 -0
- package/mtds/helptext/helptext-observer.d.ts +1 -0
- package/mtds/helptext/helptext.d.ts +2 -0
- package/mtds/{togglegroup/togglegroup.stories.d.ts → helptext/helptext.story.d.ts} +3 -0
- package/mtds/index.d.ts +7 -4
- package/mtds/index.iife.js +5 -2
- package/mtds/index.iife.js.map +1 -1
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.stories.d.ts +1 -0
- package/mtds/layout/layout-observer.js +21 -13
- package/mtds/layout/layout-observer.js.map +1 -1
- package/mtds/layout/layout.d.ts +4 -3
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/logo/logo-observer.js +16 -16
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/popover/popover.js +3 -3
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/popover/popover.stories.d.ts +1 -0
- package/mtds/react.d.ts +1 -1
- package/mtds/react.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +34 -33
- package/mtds/styles.module.css.js +67 -65
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/{heading/heading.js → typography/typography.js} +1 -1
- package/mtds/typography/typography.js.map +1 -0
- package/mtds/{heading/heading.stories.d.ts → typography/typography.stories.d.ts} +2 -1
- package/mtds/utils.d.ts +2 -2
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation.stories.d.ts +1 -0
- package/package.json +17 -17
- package/mtds/heading/heading.js.map +0 -1
- /package/mtds/{heading/heading.d.ts → typography/typography.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-observer.js","sources":["../../designsystem/logo/logo-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, onMutation } from \"../utils\";\nconst CSS_LOGO = styles.logo.split(\" \")[0];\nlet FAVICON: HTMLLinkElement;\n\nfunction process(logos: HTMLCollectionOf<Element>) {\n const svg = logos[0]?.firstElementChild;\n\n if (!svg) return;\n if (!FAVICON) {\n const
|
|
1
|
+
{"version":3,"file":"logo-observer.js","sources":["../../designsystem/logo/logo-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, onMutation } from \"../utils\";\nconst CSS_LOGO = styles.logo.split(\" \")[0];\nlet FAVICON: HTMLLinkElement;\n\nfunction process(logos: HTMLCollectionOf<Element>) {\n const svg = logos[0]?.firstElementChild;\n\n if (!svg) return;\n if (!FAVICON) {\n const oldIcon = document.head.getElementsByTagName(\"link[rel~='icon']\");\n const newIcon = document.createElement(\"link\");\n\n for (const icon of oldIcon) icon.remove();\n FAVICON = document.head.appendChild(Object.assign(newIcon, { rel: \"icon\" }));\n }\n\n const isDot = svg.parentElement?.hasAttribute(\"data-color\");\n const style = window.getComputedStyle(svg);\n const text = style.getPropertyValue(\"color\");\n const back = style.getPropertyValue(\"background-color\");\n\n FAVICON.href = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${isDot ? \"none\" : back}' width='51' height='51' x='2' y='2' stroke='${text}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${isDot ? 0.6 : 0}' stroke-width='2.3' rx='25.5'/><g transform=\"translate(7.5 7.5)\">${encodeURIComponent(svg.outerHTML.replace(/(fill|width|height|xmlns)=\\S+/gi, \"\").replace(\"<svg\", `<svg width=\"40\" height=\"40\" fill=\"${text}\"`))}</g></svg>`;\n}\n\n// Force a update even if not active tab\nif (IS_BROWSER)\n setTimeout(() => process(document.getElementsByClassName(CSS_LOGO)), 300);\n\nexport const observe = (el: Element) => onMutation(el, CSS_LOGO, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_LOGO, false);\n"],"names":["CSS_LOGO","styles","FAVICON","process","logos","svg","_a","oldIcon","newIcon","icon","isDot","_b","style","text","back","IS_BROWSER","observe","el","onMutation","unobserve"],"mappings":";;AAEA,MAAMA,IAAWC,EAAO,KAAK,MAAM,GAAG,EAAE,CAAC;AACzC,IAAIC;AAEJ,SAASC,EAAQC,GAAkC;;AAC3C,QAAAC,KAAMC,IAAAF,EAAM,CAAC,MAAP,gBAAAE,EAAU;AAEtB,MAAI,CAACD,EAAK;AACV,MAAI,CAACH,GAAS;AACZ,UAAMK,IAAU,SAAS,KAAK,qBAAqB,mBAAmB,GAChEC,IAAU,SAAS,cAAc,MAAM;AAElC,eAAAC,KAAQF,EAAS,CAAAE,EAAK,OAAO;AAC9B,IAAAP,IAAA,SAAS,KAAK,YAAY,OAAO,OAAOM,GAAS,EAAE,KAAK,OAAO,CAAC,CAAC;AAAA,EAAA;AAG7E,QAAME,KAAQC,IAAAN,EAAI,kBAAJ,gBAAAM,EAAmB,aAAa,eACxCC,IAAQ,OAAO,iBAAiBP,CAAG,GACnCQ,IAAOD,EAAM,iBAAiB,OAAO,GACrCE,IAAOF,EAAM,iBAAiB,kBAAkB;AAE9C,EAAAV,EAAA,OAAO,8FAA8FQ,IAAQ,SAASI,CAAI,gDAAgDD,CAAI,yEAAyEH,IAAQ,MAAM,CAAC,qEAAqE,mBAAmBL,EAAI,UAAU,QAAQ,mCAAmC,EAAE,EAAE,QAAQ,QAAQ,qCAAqCQ,CAAI,GAAG,CAAC,CAAC;AACne;AAGIE,KACF,WAAW,MAAMZ,EAAQ,SAAS,uBAAuBH,CAAQ,CAAC,GAAG,GAAG;AAEnE,MAAMgB,IAAU,CAACC,MAAgBC,EAAWD,GAAIjB,GAAUG,CAAO,GAC3DgB,IAAY,CAACF,MAAgBC,EAAWD,GAAIjB,GAAU,EAAK;"}
|
package/mtds/popover/popover.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx as m } from "../external/clsx/dist/clsx.js";
|
|
3
3
|
import { forwardRef as s } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
|
-
const
|
|
5
|
+
const u = s(function({ as: o, className: r, ...p }, t) {
|
|
6
6
|
return /* @__PURE__ */ e(
|
|
7
7
|
o || "div",
|
|
8
8
|
{
|
|
9
|
-
popover: "",
|
|
9
|
+
popover: "auto",
|
|
10
10
|
className: m(f.popover, r),
|
|
11
11
|
ref: t,
|
|
12
12
|
...p
|
|
@@ -14,6 +14,6 @@ const x = s(function({ as: o, className: r, ...p }, t) {
|
|
|
14
14
|
);
|
|
15
15
|
});
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
u as Popover
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.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 PopoverProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-position\"?: \"top\" | \"bottom\" | \"left\" | \"right\";\n\t\t}\n\t>;\n\ntype PopoverComponent = <As extends React.ElementType = \"div\">(\n\tprops: PopoverProps<As>,\n) => JSX.Element;\n\nexport const Popover: PopoverComponent = forwardRef<null>(function Popover<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: PopoverProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn (\n\t\t<Tag\n\t\t\tpopover=\"\"\n\t\t\tclassName={clsx(styles.popover, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as PopoverComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Popover","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBa,MAAAA,IAA4BC,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAqBC,GAA0B;AAIxE,SAAA,gBAAAC;AAAA,IAHWJ,KAAM;AAAA,IAGhB;AAAA,MACA,SAAQ;AAAA,MACR,WAAWK,EAAKC,EAAO,SAASL,CAAS;AAAA,MACzC,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EACL;AAEF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.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 PopoverProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-position\"?: \"top\" | \"bottom\" | \"left\" | \"right\";\n\t\t}\n\t>;\n\ntype PopoverComponent = <As extends React.ElementType = \"div\">(\n\tprops: PopoverProps<As>,\n) => JSX.Element;\n\nexport const Popover: PopoverComponent = forwardRef<null>(function Popover<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: PopoverProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn (\n\t\t<Tag\n\t\t\tpopover=\"auto\"\n\t\t\tclassName={clsx(styles.popover, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as PopoverComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Popover","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBa,MAAAA,IAA4BC,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAqBC,GAA0B;AAIxE,SAAA,gBAAAC;AAAA,IAHWJ,KAAM;AAAA,IAGhB;AAAA,MACA,SAAQ;AAAA,MACR,WAAWK,EAAKC,EAAO,SAASL,CAAS;AAAA,MACzC,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EACL;AAEF,CAAC;"}
|
package/mtds/react.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export * from './divider/divider';
|
|
|
11
11
|
export * from './errorsummary/errorsummary';
|
|
12
12
|
export * from './field/field';
|
|
13
13
|
export * from './fieldset/fieldset';
|
|
14
|
-
export * from './
|
|
14
|
+
export * from './typography/typography';
|
|
15
15
|
export * from './input/input';
|
|
16
16
|
export * from './layout/layout';
|
|
17
17
|
export * from './link/link';
|
package/mtds/react.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Divider as C } from "./divider/divider.js";
|
|
|
11
11
|
import { Errorsummary as T } from "./errorsummary/errorsummary.js";
|
|
12
12
|
import { Field as A, FieldComp as L } from "./field/field.js";
|
|
13
13
|
import { Fieldset as S } from "./fieldset/fieldset.js";
|
|
14
|
-
import { Heading as h } from "./
|
|
14
|
+
import { Heading as h } from "./typography/typography.js";
|
|
15
15
|
import { Input as E } from "./input/input.js";
|
|
16
16
|
import { Flex as H, Grid as I } from "./layout/layout.js";
|
|
17
17
|
import { Link as j } from "./link/link.js";
|