@mattilsynet/design 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +5 -5
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js.map +1 -1
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.js +8 -4
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js.map +1 -1
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog-observer.js +7 -3
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.js +6 -4
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js +342 -0
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js +397 -0
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js +137 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
- 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.map +1 -1
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js.map +1 -1
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +1 -1
- package/mtds/field/field-observer.js +54 -48
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.d.ts +3 -3
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset-observer.js +4 -4
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/index.iife.js +7 -7
- package/mtds/input/input.js.map +1 -1
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +4 -2
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination-helper.js.map +1 -1
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +21 -14
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.d.ts +2 -2
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +20 -20
- package/mtds/styles.module.css.js +31 -31
- package/mtds/table/table-observer.js +10 -8
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/togglegroup/togglegroup-observer.js +8 -8
- package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +14 -10
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.d.ts +2 -14
- package/mtds/utils.js +60 -71
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +12 -11
- package/mtds/toast/toast-observer.d.ts +0 -2
package/mtds/input/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../designsystem/input/input.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type InputProps = React.ComponentPropsWithoutRef<\"input\">;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n\t{ className, type = \"text\", ...rest },\n\tref,\n) {\n\treturn (\n\t\t<input\n\t\t\tsuppressHydrationWarning // Prevent hydration mismatch for SSR due to field-observer.ts\n\t\t\tclassName={clsx(styles.input, className)}\n\t\t\ttype={type}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n\nexport type SelectProps = React.ComponentPropsWithoutRef<\"select\">;\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n\tfunction Select({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<select className={clsx(styles.input, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n"],"names":["Input","forwardRef","className","type","rest","ref","jsx","clsx","styles","Select"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../designsystem/input/input.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type InputProps = React.ComponentPropsWithoutRef<\"input\">;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n\t{ className, type = \"text\", ...rest },\n\tref,\n) {\n\treturn (\n\t\t<input\n\t\t\tsuppressHydrationWarning // Prevent hydration mismatch for SSR due to field-observer.ts\n\t\t\tclassName={clsx(styles.input, className)}\n\t\t\ttype={type}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n\nexport type SelectProps = React.ComponentPropsWithoutRef<\"select\">;\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n\tfunction Select({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<select className={clsx(styles.input, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n"],"names":["Input","forwardRef","className","type","rest","ref","jsx","clsx","styles","Select"],"mappings":";;;;AAMO,MAAMA,IAAQC,EAAyC,SAC7D,EAAE,WAAAC,GAAW,MAAAC,IAAO,QAAQ,GAAGC,EAAA,GAC/BC,GACC;AACD,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,0BAAwB;AAAA,MACxB,WAAWC,EAAKC,EAAO,OAAON,CAAS;AAAA,MACvC,MAAAC;AAAA,MACA,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC,GAIYK,IAASR;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAAQC,GAAK;AAC5C,WACC,gBAAAC,EAAC,UAAA,EAAO,WAAWC,EAAKC,EAAO,OAAON,CAAS,GAAG,KAAAG,GAAW,GAAGD,EAAA,CAAM;AAAA,EAExE;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sources":["../../designsystem/layout/layout.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\ntype GapOld = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Gap =\n\t| \"0\"\n\t| \"1\"\n\t| \"2\"\n\t| \"3\"\n\t| \"4\"\n\t| \"5\"\n\t| \"6\"\n\t| \"7\"\n\t| \"8\"\n\t| \"9\"\n\t| \"10\"\n\t| \"11\"\n\t| \"12\"\n\t| \"13\"\n\t| \"14\"\n\t| \"15\"\n\t| \"18\"\n\t| \"22\"\n\t| \"26\"\n\t| \"30\"\n\t| 0\n\t| 1\n\t| 2\n\t| 3\n\t| 4\n\t| 5\n\t| 6\n\t| 7\n\t| 8\n\t| 9\n\t| 10\n\t| 11\n\t| 12\n\t| 13\n\t| 14\n\t| 15\n\t| 18\n\t| 22\n\t| 26\n\t| 30;\n\ntype SharedProps = {\n\t\"data-align\"?: \"normal\" | \"stretch\" | \"start\" | \"center\" | \"end\";\n\t\"data-align-content\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n\t\"data-center\"?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n\t\"data-gap\"?: Gap | GapOld;\n\t\"data-row-gap\"?: Gap;\n\t\"data-column-gap\"?: Gap;\n\t\"data-nowrap\"?: boolean;\n\t\"data-justify\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n\t\"data-fixed\"?: boolean;\n\t\"data-items\"?:\n\t\t| \"auto\"\n\t\t| \"full\"\n\t\t| \"50\"\n\t\t| \"100\"\n\t\t| \"150\"\n\t\t| \"200\"\n\t\t| \"250\"\n\t\t| \"300\"\n\t\t| \"350\"\n\t\t| \"400\"\n\t\t| \"450\"\n\t\t| \"500\"\n\t\t| 50\n\t\t| 100\n\t\t| 150\n\t\t| 200\n\t\t| 250\n\t\t| 300\n\t\t| 350\n\t\t| 400\n\t\t| 450\n\t\t| 500;\n};\n\n/**\n * Flex\n */\nexport type FlexProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, SharedProps>;\n\ntype FlexComponent = <As extends React.ElementType = \"div\">(\n\tprops: FlexProps<As>,\n) => JSX.Element;\n\nexport const Flex: FlexComponent = forwardRef<null>(function Flex<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: FlexProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.flex, className)} ref={ref} {...rest} />;\n}) as FlexComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\n/**\n * Grid\n */\nexport type GridProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, SharedProps>;\n\ntype GridComponent = <As extends React.ElementType = \"div\">(\n\tprops: GridProps<As>,\n) => JSX.Element;\n\nexport const Grid: GridComponent = forwardRef<null>(function Grid<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GridProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.grid, className)} ref={ref} {...rest} />;\n}) as GridComponent; // 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<As>;\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"],"names":["Flex","forwardRef","as","className","rest","ref","jsx","clsx","styles","Grid","Prose"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"layout.js","sources":["../../designsystem/layout/layout.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\ntype GapOld = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Gap =\n\t| \"0\"\n\t| \"1\"\n\t| \"2\"\n\t| \"3\"\n\t| \"4\"\n\t| \"5\"\n\t| \"6\"\n\t| \"7\"\n\t| \"8\"\n\t| \"9\"\n\t| \"10\"\n\t| \"11\"\n\t| \"12\"\n\t| \"13\"\n\t| \"14\"\n\t| \"15\"\n\t| \"18\"\n\t| \"22\"\n\t| \"26\"\n\t| \"30\"\n\t| 0\n\t| 1\n\t| 2\n\t| 3\n\t| 4\n\t| 5\n\t| 6\n\t| 7\n\t| 8\n\t| 9\n\t| 10\n\t| 11\n\t| 12\n\t| 13\n\t| 14\n\t| 15\n\t| 18\n\t| 22\n\t| 26\n\t| 30;\n\ntype SharedProps = {\n\t\"data-align\"?: \"normal\" | \"stretch\" | \"start\" | \"center\" | \"end\";\n\t\"data-align-content\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n\t\"data-center\"?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n\t\"data-gap\"?: Gap | GapOld;\n\t\"data-row-gap\"?: Gap;\n\t\"data-column-gap\"?: Gap;\n\t\"data-nowrap\"?: boolean;\n\t\"data-justify\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n\t\"data-fixed\"?: boolean;\n\t\"data-items\"?:\n\t\t| \"auto\"\n\t\t| \"full\"\n\t\t| \"50\"\n\t\t| \"100\"\n\t\t| \"150\"\n\t\t| \"200\"\n\t\t| \"250\"\n\t\t| \"300\"\n\t\t| \"350\"\n\t\t| \"400\"\n\t\t| \"450\"\n\t\t| \"500\"\n\t\t| 50\n\t\t| 100\n\t\t| 150\n\t\t| 200\n\t\t| 250\n\t\t| 300\n\t\t| 350\n\t\t| 400\n\t\t| 450\n\t\t| 500;\n};\n\n/**\n * Flex\n */\nexport type FlexProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, SharedProps>;\n\ntype FlexComponent = <As extends React.ElementType = \"div\">(\n\tprops: FlexProps<As>,\n) => JSX.Element;\n\nexport const Flex: FlexComponent = forwardRef<null>(function Flex<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: FlexProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.flex, className)} ref={ref} {...rest} />;\n}) as FlexComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\n/**\n * Grid\n */\nexport type GridProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, SharedProps>;\n\ntype GridComponent = <As extends React.ElementType = \"div\">(\n\tprops: GridProps<As>,\n) => JSX.Element;\n\nexport const Grid: GridComponent = forwardRef<null>(function Grid<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GridProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.grid, className)} ref={ref} {...rest} />;\n}) as GridComponent; // 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<As>;\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"],"names":["Flex","forwardRef","as","className","rest","ref","jsx","clsx","styles","Grid","Prose"],"mappings":";;;;AA4GO,MAAMA,IAAsBC,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAuBC,GAA0B;AAGtE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC,GAYYK,IAAsBR,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAuBC,GAA0B;AAGtE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC,GAYYM,IAAwBT,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAwBC,GAA0B;AAGvE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC3E,CAAC;"}
|
package/mtds/link/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../designsystem/link/link.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type LinkProps<As extends React.ElementType = \"a\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype LinkComponent = <As extends React.ElementType = \"a\">(\n\tprops: LinkProps<As>,\n) => React.ReactElement | null;\n\nexport const Link: LinkComponent = forwardRef<null>(function Link<\n\tAs extends React.ElementType = \"a\",\n>({ as, className, ...rest }: LinkProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"a\";\n\treturn <Tag className={clsx(styles.link, className)} {...rest} ref={ref} />;\n}) as LinkComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Link","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../designsystem/link/link.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type LinkProps<As extends React.ElementType = \"a\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype LinkComponent = <As extends React.ElementType = \"a\">(\n\tprops: LinkProps<As>,\n) => React.ReactElement | null;\n\nexport const Link: LinkComponent = forwardRef<null>(function Link<\n\tAs extends React.ElementType = \"a\",\n>({ as, className, ...rest }: LinkProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"a\";\n\treturn <Tag className={clsx(styles.link, className)} {...rest} ref={ref} />;\n}) as LinkComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Link","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAeO,MAAMA,IAAsBC,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAuBC,GAA0B;AAEtE,SAAO,gBAAAC,EADKJ,KAAM,KACV,EAAI,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAI,GAAGC,GAAM,KAAAC,EAAA,CAAU;AAC1E,CAAC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import c from "../styles.module.css.js";
|
|
2
2
|
import { onLoaded as a, onMutation as d } from "../utils.js";
|
|
3
3
|
const m = c.logo.split(" ")[0];
|
|
4
|
-
function
|
|
4
|
+
function g([t]) {
|
|
5
5
|
if (t?.isConnected && t?.firstElementChild instanceof SVGSVGElement) {
|
|
6
6
|
for (const l of document.head.querySelectorAll("link[rel~='icon']"))
|
|
7
7
|
l.setAttribute("rel", "disabled");
|
|
@@ -14,5 +14,7 @@ function h([t]) {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
a(
|
|
17
|
+
a(
|
|
18
|
+
() => d(document.documentElement, m, g)
|
|
19
|
+
);
|
|
18
20
|
//# sourceMappingURL=logo-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-observer.js","sources":["../../designsystem/logo/logo-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { onLoaded, onMutation } from \"../utils\";\n\nconst CSS_LOGO = styles.logo.split(\" \")[0];\n\nfunction
|
|
1
|
+
{"version":3,"file":"logo-observer.js","sources":["../../designsystem/logo/logo-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { onLoaded, onMutation } from \"../utils\";\n\nconst CSS_LOGO = styles.logo.split(\" \")[0];\n\nfunction handleLogoMutation([logo]: HTMLCollectionOf<HTMLElement>) {\n\tif (logo?.isConnected && logo?.firstElementChild instanceof SVGSVGElement) {\n\t\tfor (const icon of document.head.querySelectorAll(\"link[rel~='icon']\"))\n\t\t\ticon.setAttribute(\"rel\", \"disabled\"); // Disable previous icon (but not remove is as this makes Next.js sad)\n\n\t\tconst svg = logo.firstElementChild;\n\t\tconst isDot = logo?.hasAttribute(\"data-env\");\n\t\tconst style = window.getComputedStyle(svg);\n\t\tconst text = style.getPropertyValue(\"color\");\n\t\tconst back = style.getPropertyValue(\"--mtds-logo-color\");\n\t\tconst icon = svg.outerHTML\n\t\t\t.replace(/\\n+/g, \" \") // Prevent line breaks\n\t\t\t.replace(/(fill|width|height|xmlns)=\"[^\"]+\"/gi, \"\")\n\t\t\t.replace(\"<svg\", `<svg width=\"40\" height=\"40\" fill=\"${text}\"`);\n\n\t\tdocument.head.appendChild(\n\t\t\tObject.assign(document.createElement(\"link\"), {\n\t\t\t\thref: `data:image/svg+xml,${encodeURIComponent(`<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)\">${icon}</g></svg>`)}`,\n\t\t\t\trel: \"icon\",\n\t\t\t}),\n\t\t);\n\t}\n}\n\nonLoaded(() =>\n\tonMutation(document.documentElement, CSS_LOGO, handleLogoMutation),\n);\n"],"names":["CSS_LOGO","styles","handleLogoMutation","logo","icon","svg","isDot","style","text","back","onLoaded","onMutation"],"mappings":";;AAGA,MAAMA,IAAWC,EAAO,KAAK,MAAM,GAAG,EAAE,CAAC;AAEzC,SAASC,EAAmB,CAACC,CAAI,GAAkC;AAClE,MAAIA,GAAM,eAAeA,GAAM,6BAA6B,eAAe;AAC1E,eAAWC,KAAQ,SAAS,KAAK,iBAAiB,mBAAmB;AACpEA,MAAAA,EAAK,aAAa,OAAO,UAAU;AAEpC,UAAMC,IAAMF,EAAK,mBACXG,IAAQH,GAAM,aAAa,UAAU,GACrCI,IAAQ,OAAO,iBAAiBF,CAAG,GACnCG,IAAOD,EAAM,iBAAiB,OAAO,GACrCE,IAAOF,EAAM,iBAAiB,mBAAmB,GACjDH,IAAOC,EAAI,UACf,QAAQ,QAAQ,GAAG,EACnB,QAAQ,uCAAuC,EAAE,EACjD,QAAQ,QAAQ,qCAAqCG,CAAI,GAAG;AAE9D,aAAS,KAAK;AAAA,MACb,OAAO,OAAO,SAAS,cAAc,MAAM,GAAG;AAAA,QAC7C,MAAM,sBAAsB,mBAAmB,2EAA2EF,IAAQ,SAASG,CAAI,gDAAgDD,CAAI,yEAAyEF,IAAQ,MAAM,CAAC,qEAAqEF,CAAI,YAAY,CAAC;AAAA,QACjX,KAAK;AAAA,MAAA,CACL;AAAA,IAAA;AAAA,EAEH;AACD;AAEAM;AAAA,EAAS,MACRC,EAAW,SAAS,iBAAiBX,GAAUE,CAAkB;AAClE;"}
|
package/mtds/logo/logo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.js","sources":["../../designsystem/logo/logo.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\ntype LogoBaseProps<Href> = {\n\t\"data-color\"?: \"danger\" | \"info\";\n\t\"data-env\"?: string | null;\n\thref?: Href;\n};\n\nexport type LogoProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As, LogoBaseProps<Href>>;\n\ntype LogoComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: LogoProps<Href, As>,\n) => JSX.Element;\n\nexport const Logo: LogoComponent = forwardRef<null>(function Logo<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: LogoProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.logo, className)} ref={ref} {...rest} />;\n}) as LogoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Logo","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"logo.js","sources":["../../designsystem/logo/logo.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\ntype LogoBaseProps<Href> = {\n\t\"data-color\"?: \"danger\" | \"info\";\n\t\"data-env\"?: string | null;\n\thref?: Href;\n};\n\nexport type LogoProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As, LogoBaseProps<Href>>;\n\ntype LogoComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: LogoProps<Href, As>,\n) => JSX.Element;\n\nexport const Logo: LogoComponent = forwardRef<null>(function Logo<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: LogoProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.logo, className)} ref={ref} {...rest} />;\n}) as LogoComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Logo","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;AA0BO,MAAMA,IAAsBC,EAAiB,SAGlD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA6BC,GAA0B;AAC5E,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,MAAM;AAErC,SAAO,gBAAAG,EAACD,GAAA,EAAI,WAAWE,EAAKC,EAAO,MAAMN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC;"}
|
package/mtds/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-helper.js","sources":["../../designsystem/pagination/pagination-helper.ts"],"sourcesContent":["const getSteps = (\n\tnow: number,\n\tmax: number,\n\tshow = Number.POSITIVE_INFINITY,\n) => {\n\tconst offset = (show - 1) / 2;\n\tconst start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n\tconst end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n\tconst pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n\tif (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n\tif (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n\treturn pages;\n};\n\nexport const pagination = ({ current = 1, total = 10, show = 7 }) => ({\n\tprev: current > 1 ? current - 1 : 0,\n\tnext: current < total ? current + 1 : 0,\n\tpages: getSteps(current, total, show).map((page, index) => ({\n\t\tcurrent: page === current && (\"page\" as const),\n\t\tkey: `key-${page}-${index}`,\n\t\tpage,\n\t})),\n});\n"],"names":["getSteps","now","max","show","offset","start","end","pages","_","i","pagination","current","total","page","index"],"mappings":"AAAA,MAAMA,IAAW,CAChBC,GACAC,GACAC,IAAO,OAAO,sBACV;
|
|
1
|
+
{"version":3,"file":"pagination-helper.js","sources":["../../designsystem/pagination/pagination-helper.ts"],"sourcesContent":["const getSteps = (\n\tnow: number,\n\tmax: number,\n\tshow = Number.POSITIVE_INFINITY,\n) => {\n\tconst offset = (show - 1) / 2;\n\tconst start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n\tconst end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n\tconst pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n\tif (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n\tif (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n\treturn pages;\n};\n\nexport const pagination = ({ current = 1, total = 10, show = 7 }) => ({\n\tprev: current > 1 ? current - 1 : 0,\n\tnext: current < total ? current + 1 : 0,\n\tpages: getSteps(current, total, show).map((page, index) => ({\n\t\tcurrent: page === current && (\"page\" as const),\n\t\tkey: `key-${page}-${index}`,\n\t\tpage,\n\t})),\n});\n"],"names":["getSteps","now","max","show","offset","start","end","pages","_","i","pagination","current","total","page","index"],"mappings":"AAAA,MAAMA,IAAW,CAChBC,GACAC,GACAC,IAAO,OAAO,sBACV;AACJ,QAAMC,KAAUD,IAAO,KAAK,GACtBE,IAAQ,KAAK,IAAI,KAAK,IAAIJ,IAAM,KAAK,MAAMG,CAAM,GAAGF,IAAMC,IAAO,CAAC,GAAG,CAAC,GACtEG,IAAM,KAAK,IAAI,KAAK,IAAIL,IAAM,KAAK,KAAKG,CAAM,GAAGD,CAAI,GAAGD,CAAG,GAC3DK,IAAQ,MAAM,KAAK,EAAE,QAAQD,IAAM,IAAID,EAAA,GAAS,CAACG,GAAGC,MAAMA,IAAIJ,CAAK;AAEzE,SAAIF,IAAO,KAAKE,IAAQ,OAAS,OAAO,GAAG,GAAG,GAAG,CAAC,GAC9CF,IAAO,KAAKG,IAAMJ,OAAW,OAAO,IAAI,GAAG,GAAGA,CAAG,GAC9CK;AACR,GAEaG,IAAa,CAAC,EAAE,SAAAC,IAAU,GAAG,OAAAC,IAAQ,IAAI,MAAAT,IAAO,SAAS;AAAA,EACrE,MAAMQ,IAAU,IAAIA,IAAU,IAAI;AAAA,EAClC,MAAMA,IAAUC,IAAQD,IAAU,IAAI;AAAA,EACtC,OAAOX,EAASW,GAASC,GAAOT,CAAI,EAAE,IAAI,CAACU,GAAMC,OAAW;AAAA,IAC3D,SAASD,MAASF,KAAY;AAAA,IAC9B,KAAK,OAAOE,CAAI,IAAIC,CAAK;AAAA,IACzB,MAAAD;AAAA,EAAA,EACC;AACH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../react\";\nimport styles from \"../styles.module.css\";\nimport { pagination } from \"./pagination-helper\";\n\nexport type PaginationProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"nav\">,\n\t\"children\"\n> &\n\t(\n\t\t| {\n\t\t\t\tchildren?: never;\n\t\t\t\tcurrent: number;\n\t\t\t\tshow?: number;\n\t\t\t\ttotal: number;\n\t\t\t\tprops: (props: {\n\t\t\t\t\tpage: number;\n\t\t\t\t\ttype: \"prev\" | \"next\" | \"page\";\n\t\t\t\t}) => Parameters<typeof Button>[0];\n\t\t }\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcurrent?: never;\n\t\t\t\tshow?: never;\n\t\t\t\ttotal?: never;\n\t\t\t\tprops?: never;\n\t\t }\n\t);\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, className, current, total, show = 7, props, ...rest },\n\t\tref,\n\t) {\n\t\tconst { pages, next, prev } = pagination({ current, total, show });\n\n\t\treturn (\n\t\t\t<nav\n\t\t\t\taria-label={rest[\"aria-label\"] || \"Pagination\"}\n\t\t\t\tclassName={clsx(styles.pagination, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children || (\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!prev}\n\t\t\t\t\t\t\t\t{...props?.({ page: prev, type: \"prev\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{pages.map(({ key, page, current }) => (\n\t\t\t\t\t\t\t<li key={key}>\n\t\t\t\t\t\t\t\t{!!page && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\taria-current={current}\n\t\t\t\t\t\t\t\t\t\t{...{ children: page }}\n\t\t\t\t\t\t\t\t\t\t{...props?.({ page, type: \"page\" })}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!next}\n\t\t\t\t\t\t\t\t{...props?.({ page: next, type: \"next\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t</nav>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","className","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","clsx","styles","Button","key","page"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,WAAAC,GAAW,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAC3DC,GACC;
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../react\";\nimport styles from \"../styles.module.css\";\nimport { pagination } from \"./pagination-helper\";\n\nexport type PaginationProps = Omit<\n\tReact.ComponentPropsWithoutRef<\"nav\">,\n\t\"children\"\n> &\n\t(\n\t\t| {\n\t\t\t\tchildren?: never;\n\t\t\t\tcurrent: number;\n\t\t\t\tshow?: number;\n\t\t\t\ttotal: number;\n\t\t\t\tprops: (props: {\n\t\t\t\t\tpage: number;\n\t\t\t\t\ttype: \"prev\" | \"next\" | \"page\";\n\t\t\t\t}) => Parameters<typeof Button>[0];\n\t\t }\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcurrent?: never;\n\t\t\t\tshow?: never;\n\t\t\t\ttotal?: never;\n\t\t\t\tprops?: never;\n\t\t }\n\t);\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, className, current, total, show = 7, props, ...rest },\n\t\tref,\n\t) {\n\t\tconst { pages, next, prev } = pagination({ current, total, show });\n\n\t\treturn (\n\t\t\t<nav\n\t\t\t\taria-label={rest[\"aria-label\"] || \"Pagination\"}\n\t\t\t\tclassName={clsx(styles.pagination, className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children || (\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!prev}\n\t\t\t\t\t\t\t\t{...props?.({ page: prev, type: \"prev\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{pages.map(({ key, page, current }) => (\n\t\t\t\t\t\t\t<li key={key}>\n\t\t\t\t\t\t\t\t{!!page && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\taria-current={current}\n\t\t\t\t\t\t\t\t\t\t{...{ children: page }}\n\t\t\t\t\t\t\t\t\t\t{...props?.({ page, type: \"page\" })}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-disabled={!next}\n\t\t\t\t\t\t\t\t{...props?.({ page: next, type: \"next\" })}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t</nav>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","className","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","clsx","styles","Button","key","page"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,WAAAC,GAAW,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAC3DC,GACC;AACD,UAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM,MAAAC,EAAA,IAASC,EAAW,EAAE,SAAAT,GAAS,OAAAC,GAAO,MAAAC,GAAM;AAEjE,WACC,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,cAAYN,EAAK,YAAY,KAAK;AAAA,QAClC,WAAWO,EAAKC,EAAO,YAAYb,CAAS;AAAA,QAC5C,KAAAM;AAAA,QACC,GAAGD;AAAA,QAEH,UAAAN,uBACC,MAAA,EACA,UAAA;AAAA,UAAA,gBAAAY,EAAC,MAAA,EACA,UAAA,gBAAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACL;AAAA,cACf,GAAGL,IAAQ,EAAE,MAAMK,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,GAE1C;AAAA,UACCF,EAAM,IAAI,CAAC,EAAE,KAAAQ,GAAK,MAAAC,GAAM,SAAAf,QACxB,gBAAAU,EAAC,MAAA,EACC,UAAA,CAAC,CAACK,KACF,gBAAAL;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,gBAAcb;AAAAA,cACR,UAAUe;AAAA,cACf,GAAGZ,IAAQ,EAAE,MAAAY,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACnC,GANOD,CAQT,CACA;AAAA,4BACA,MAAA,EACA,UAAA,gBAAAJ;AAAA,YAACG;AAAA,YAAA;AAAA,cACA,iBAAe,CAACN;AAAA,cACf,GAAGJ,IAAQ,EAAE,MAAMI,GAAM,MAAM,QAAQ;AAAA,YAAA;AAAA,UAAA,EACzC,CACD;AAAA,QAAA,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;"}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { flip as g, shift as l } from "../external/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
2
|
+
import d from "../styles.module.css.js";
|
|
3
|
+
import { onLoaded as f, on as c, QUICK_EVENT as m, anchorPosition as r, attr as s } from "../utils.js";
|
|
4
|
+
const a = d.popover.split(" ")[0];
|
|
5
|
+
let p = 0;
|
|
6
|
+
function v({
|
|
7
|
+
target: o,
|
|
8
|
+
newState: t
|
|
9
|
+
}) {
|
|
10
|
+
if (o instanceof HTMLElement && o.classList.contains(a)) {
|
|
11
|
+
const e = t === "closed", n = o.getRootNode()?.querySelector(
|
|
8
12
|
`[popovertarget="${o.id}"]`
|
|
9
13
|
);
|
|
10
|
-
|
|
14
|
+
p += e ? -1 : 1, e ? r(o, !1) : n && r(o, n, {
|
|
15
|
+
placement: s(o, "data-position") || "bottom",
|
|
16
|
+
middleware: [g(), l({ padding: 10 })]
|
|
17
|
+
});
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
20
|
+
function P({ target: o }) {
|
|
21
|
+
const t = p && o?.closest?.("a,[popovertargetaction]");
|
|
15
22
|
if (t) {
|
|
16
|
-
const e =
|
|
17
|
-
|
|
23
|
+
const e = s(t, "popovertargetaction") || "toggle", n = e === "show" || (e === "hide" ? !1 : void 0), i = (document.getElementById(s(t, "popovertarget") || "") || t).closest(`.${a}`);
|
|
24
|
+
i?.isConnected && i?.togglePopover && i.togglePopover(n);
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
f(() => {
|
|
28
|
+
c(document, "toggle", v, m), c(document, "click", P);
|
|
22
29
|
});
|
|
23
30
|
//# sourceMappingURL=popover-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { anchorPosition, attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nconst CSS_POPOVER = styles.popover.split(\" \")[0];\nlet OPEN_POPOVERS = 0; // Speed up by only checking clicks if we have open popovers\n\nfunction
|
|
1
|
+
{"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { flip, type Placement, shift } from \"@floating-ui/dom\";\nimport styles from \"../styles.module.css\";\nimport { anchorPosition, attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nconst CSS_POPOVER = styles.popover.split(\" \")[0];\nlet OPEN_POPOVERS = 0; // Speed up by only checking clicks if we have open popovers\n\nfunction handlePopoverToggle({\n\ttarget: el,\n\tnewState,\n}: Event & { newState?: string }) {\n\tif (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n\t\tconst isClosing = newState === \"closed\";\n\t\tconst anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(\n\t\t\t`[popovertarget=\"${el.id}\"]`,\n\t\t);\n\n\t\tOPEN_POPOVERS += isClosing ? -1 : 1;\n\t\tif (isClosing) anchorPosition(el, false);\n\t\telse if (anchor)\n\t\t\tanchorPosition(el, anchor, {\n\t\t\t\tplacement: (attr(el, \"data-position\") || \"bottom\") as Placement,\n\t\t\t\tmiddleware: [flip(), shift({ padding: 10 })],\n\t\t\t});\n\t}\n}\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handlePopoverLinkClick({ target }: Event) {\n\tconst close =\n\t\tOPEN_POPOVERS && (target as Element)?.closest?.(\"a,[popovertargetaction]\");\n\n\tif (close) {\n\t\tconst action = attr(close, \"popovertargetaction\") || \"toggle\";\n\t\tconst open = action === \"show\" || (action === \"hide\" ? false : undefined);\n\t\tconst target = document.getElementById(attr(close, \"popovertarget\") || \"\");\n\t\tconst popover = (target || close).closest<HTMLElement>(`.${CSS_POPOVER}`);\n\n\t\t// Popover can be disconneted by click handler deeper down in the DOM three before reaching document\n\t\tif (popover?.isConnected && popover?.togglePopover)\n\t\t\tpopover.togglePopover(open);\n\t}\n}\n\nonLoaded(() => {\n\ton(document, \"toggle\", handlePopoverToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n\ton(document, \"click\", handlePopoverLinkClick); // Allow `<a>` to use `popovertarget` as well\n});\n"],"names":["CSS_POPOVER","styles","OPEN_POPOVERS","handlePopoverToggle","el","newState","isClosing","anchor","anchorPosition","attr","flip","shift","handlePopoverLinkClick","target","close","action","open","popover","onLoaded","on","QUICK_EVENT"],"mappings":";;;AAIA,MAAMA,IAAcC,EAAO,QAAQ,MAAM,GAAG,EAAE,CAAC;AAC/C,IAAIC,IAAgB;AAEpB,SAASC,EAAoB;AAAA,EAC5B,QAAQC;AAAA,EACR,UAAAC;AACD,GAAkC;AACjC,MAAID,aAAc,eAAeA,EAAG,UAAU,SAASJ,CAAW,GAAG;AACpE,UAAMM,IAAYD,MAAa,UACzBE,IAAUH,EAAG,YAAA,GAA8B;AAAA,MAChD,mBAAmBA,EAAG,EAAE;AAAA,IAAA;AAGzB,IAAAF,KAAiBI,IAAY,KAAK,GAC9BA,IAAWE,EAAeJ,GAAI,EAAK,IAC9BG,KACRC,EAAeJ,GAAIG,GAAQ;AAAA,MAC1B,WAAYE,EAAKL,GAAI,eAAe,KAAK;AAAA,MACzC,YAAY,CAACM,EAAA,GAAQC,EAAM,EAAE,SAAS,IAAI,CAAC;AAAA,IAAA,CAC3C;AAAA,EACH;AACD;AAKA,SAASC,EAAuB,EAAE,QAAAC,KAAiB;AAClD,QAAMC,IACLZ,KAAkBW,GAAoB,UAAU,yBAAyB;AAE1E,MAAIC,GAAO;AACV,UAAMC,IAASN,EAAKK,GAAO,qBAAqB,KAAK,UAC/CE,IAAOD,MAAW,WAAWA,MAAW,SAAS,KAAQ,SAEzDE,KADS,SAAS,eAAeR,EAAKK,GAAO,eAAe,KAAK,EAAE,KAC9CA,GAAO,QAAqB,IAAId,CAAW,EAAE;AAGxE,IAAIiB,GAAS,eAAeA,GAAS,iBACpCA,EAAQ,cAAcD,CAAI;AAAA,EAC5B;AACD;AAEAE,EAAS,MAAM;AACd,EAAAC,EAAG,UAAU,UAAUhB,GAAqBiB,CAAW,GACvDD,EAAG,UAAU,SAASP,CAAsB;AAC7C,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/dom';
|
|
1
2
|
import { JSX } from 'react';
|
|
2
3
|
import { PolymorphicComponentPropWithRef, PopoverValues } from '../react-types';
|
|
3
|
-
import { AnchorPosition } from '../utils';
|
|
4
4
|
export type PopoverProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, {
|
|
5
|
-
"data-position"?:
|
|
5
|
+
"data-position"?: Placement;
|
|
6
6
|
popover?: PopoverValues;
|
|
7
7
|
}>;
|
|
8
8
|
type PopoverComponent = <As extends React.ElementType = "div">(props: PopoverProps<As>) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n\tPopoverValues,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../designsystem/popover/popover.tsx"],"sourcesContent":["import type { Placement } from \"@floating-ui/dom\";\nimport clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n\tPopoverValues,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type PopoverProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-position\"?: Placement;\n\t\t\tpopover?: PopoverValues;\n\t\t}\n\t>;\n\ntype PopoverComponent = <As extends React.ElementType = \"div\">(\n\tprops: PopoverProps<As>,\n) => JSX.Element;\n\nexport const Popover: PopoverComponent = forwardRef<null>(function Popover<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: PopoverProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn (\n\t\t<Tag\n\t\t\tpopover=\"auto\"\n\t\t\tclassName={clsx(styles.popover, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as PopoverComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Popover","forwardRef","as","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAuBO,MAAMA,IAA4BC,EAAiB,SAExD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA0BC,GAA0B;AAGzE,SACC,gBAAAC;AAAA,IAHWJ,KAAM;AAAA,IAGhB;AAAA,MACA,SAAQ;AAAA,MACR,WAAWK,EAAKC,EAAO,SAASL,CAAS;AAAA,MACzC,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sources":["../../designsystem/progress/progress.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type ProgressProps = React.ComponentPropsWithoutRef<\"progress\">;\nexport const Progress = forwardRef<HTMLProgressElement, ProgressProps>(\n\tfunction Progress(props, ref) {\n\t\treturn (\n\t\t\t<u-progress ref={ref} {...toCustomElementProps(props, styles.progress)} />\n\t\t);\n\t},\n);\n"],"names":["Progress","forwardRef","props","ref","jsx","toCustomElementProps","styles"],"mappings":";;;;AAKO,MAAMA,IAAWC;AAAA,EACvB,SAAkBC,GAAOC,GAAK;
|
|
1
|
+
{"version":3,"file":"progress.js","sources":["../../designsystem/progress/progress.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type ProgressProps = React.ComponentPropsWithoutRef<\"progress\">;\nexport const Progress = forwardRef<HTMLProgressElement, ProgressProps>(\n\tfunction Progress(props, ref) {\n\t\treturn (\n\t\t\t<u-progress ref={ref} {...toCustomElementProps(props, styles.progress)} />\n\t\t);\n\t},\n);\n"],"names":["Progress","forwardRef","props","ref","jsx","toCustomElementProps","styles"],"mappings":";;;;AAKO,MAAMA,IAAWC;AAAA,EACvB,SAAkBC,GAAOC,GAAK;AAC7B,WACC,gBAAAC,EAAC,gBAAW,KAAAD,GAAW,GAAGE,EAAqBH,GAAOI,EAAO,QAAQ,GAAG;AAAA,EAE1E;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sources":["../../designsystem/skeleton/skeleton.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\ntype Variants = \"circle\" | \"text\" | \"rectangle\";\ntype SkeletonBaseProps<Variant extends Variants> = {\n\t\"data-variant\"?: Variant;\n};\n\nexport type SkeletonProps<\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n> = PolymorphicComponentPropWithRef<As, SkeletonBaseProps<Variant>>;\n\ntype SkeletonComponent = <\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n>(\n\tprops: SkeletonProps<Variant, As>,\n) => JSX.Element;\n\nexport const Skeleton: SkeletonComponent = forwardRef<null>(function Skeleton<\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n>(\n\t{ as, className, ...rest }: SkeletonProps<Variant, As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || (rest.href ? \"span\" : \"div\");\n\n\treturn (\n\t\t<Tag className={clsx(styles.skeleton, className)} ref={ref} {...rest} />\n\t);\n}) as SkeletonComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Skeleton","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":["../../designsystem/skeleton/skeleton.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\ntype Variants = \"circle\" | \"text\" | \"rectangle\";\ntype SkeletonBaseProps<Variant extends Variants> = {\n\t\"data-variant\"?: Variant;\n};\n\nexport type SkeletonProps<\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n> = PolymorphicComponentPropWithRef<As, SkeletonBaseProps<Variant>>;\n\ntype SkeletonComponent = <\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n>(\n\tprops: SkeletonProps<Variant, As>,\n) => JSX.Element;\n\nexport const Skeleton: SkeletonComponent = forwardRef<null>(function Skeleton<\n\tVariant extends Variants,\n\tAs extends React.ElementType = Variant extends \"text\" ? \"span\" : \"div\",\n>(\n\t{ as, className, ...rest }: SkeletonProps<Variant, As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || (rest.href ? \"span\" : \"div\");\n\n\treturn (\n\t\t<Tag className={clsx(styles.skeleton, className)} ref={ref} {...rest} />\n\t);\n}) as SkeletonComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Skeleton","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;AAyBO,MAAMA,IAA8BC,EAAiB,SAI3D,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GACpBC,GACC;AACD,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,SAAS;AAExC,SACC,gBAAAG,EAACD,GAAA,EAAI,WAAWE,EAAKC,EAAO,UAAUN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAExE,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sources":["../../designsystem/spinner/spinner.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type SpinnerProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-size\"?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t\"data-state\"?: \"complete\";\n};\n\nexport const Spinner = forwardRef<HTMLSpanElement, SpinnerProps>(\n\tfunction Spinner({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<span className={clsx(styles.spinner, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n"],"names":["Spinner","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AASO,MAAMA,IAAUC;AAAA,EACtB,SAAiB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;
|
|
1
|
+
{"version":3,"file":"spinner.js","sources":["../../designsystem/spinner/spinner.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type SpinnerProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-size\"?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t\"data-state\"?: \"complete\";\n};\n\nexport const Spinner = forwardRef<HTMLSpanElement, SpinnerProps>(\n\tfunction Spinner({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<span className={clsx(styles.spinner, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n"],"names":["Spinner","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AASO,MAAMA,IAAUC;AAAA,EACtB,SAAiB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AAC7C,WACC,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAAKC,EAAO,SAASL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAAA,EAExE;AACD;"}
|
package/mtds/steps/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sources":["../../designsystem/steps/steps.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type StepsProps = React.ComponentPropsWithoutRef<\"ol\"> & {\n\t\"data-direction\"?: \"right\" | \"up\" | \"down\";\n\t\"data-fade\"?: \"true\" | \"false\" | \"start\" | \"end\";\n\t\"data-state\"?: \"complete\";\n};\nexport const Steps = forwardRef<HTMLOListElement, StepsProps>(function Steps(\n\t{ className, ...rest }: StepsProps,\n\tref,\n) {\n\treturn <ol className={clsx(styles.steps, className)} ref={ref} {...rest} />;\n});\n"],"names":["Steps","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"steps.js","sources":["../../designsystem/steps/steps.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type StepsProps = React.ComponentPropsWithoutRef<\"ol\"> & {\n\t\"data-direction\"?: \"right\" | \"up\" | \"down\";\n\t\"data-fade\"?: \"true\" | \"false\" | \"start\" | \"end\";\n\t\"data-state\"?: \"complete\";\n};\nexport const Steps = forwardRef<HTMLOListElement, StepsProps>(function Steps(\n\t{ className, ...rest }: StepsProps,\n\tref,\n) {\n\treturn <ol className={clsx(styles.steps, className)} ref={ref} {...rest} />;\n});\n"],"names":["Steps","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AASO,MAAMA,IAAQC,EAAyC,SAC7D,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,GACC;AACD,SAAO,gBAAAC,EAAC,MAAA,EAAG,WAAWC,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC;"}
|