@mattilsynet/design 3.1.4 → 3.1.6
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/atlas/atlas-element.js +1 -1
- package/mtds/field/field.d.ts +1 -0
- package/mtds/field/field.js +115 -113
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.iife.js +11 -11
- package/mtds/index.js +36 -35
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.d.ts +6 -2
- package/mtds/input/input.js +22 -27
- package/mtds/input/input.js.map +1 -1
- package/mtds/input/input.stories.d.ts +1 -0
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.d.ts +7 -1
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/pagination/pagination.stories.d.ts +4 -0
- package/mtds/popover/popover-observer.d.ts +1 -0
- package/mtds/popover/popover-observer.js +13 -0
- package/mtds/popover/popover-observer.js.map +1 -0
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +23 -23
- package/mtds/styles.module.css.js +16 -16
- package/mtds/tailwind.css +1 -0
- package/mtds/togglegroup/togglegroup.d.ts +1 -1
- package/mtds/tooltip/tooltip-element.js +7 -3
- package/mtds/tooltip/tooltip-element.js.map +1 -1
- package/mtds/validation/validation-observer.js +3 -2
- package/mtds/validation/validation-observer.js.map +1 -1
- package/package.json +12 -10
package/mtds/index.js
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { UHTMLComboboxElement as
|
|
2
|
-
import { UHTMLTabElement as
|
|
1
|
+
import { UHTMLComboboxElement as U, UHTMLComboboxShadowRoot as d, UHTMLComboboxStyle as w } from "./external/@u-elements/u-combobox/dist/u-combobox.js";
|
|
2
|
+
import { UHTMLTabElement as S, UHTMLTabListElement as c, UHTMLTabListShadowRoot as g, UHTMLTabListStyle as h, UHTMLTabPanelElement as y, UHTMLTabPanelShadowRoot as C, UHTMLTabPanelStyle as E, UHTMLTabShadowRoot as R, UHTMLTabStyle as k, UHTMLTabsElement as P, UHTMLTabsShadowRoot as u, UHTMLTabsStyle as v } from "./external/@u-elements/u-tabs/dist/u-tabs.js";
|
|
3
3
|
import "@u-elements/u-details";
|
|
4
4
|
import o from "./print/print.css.js";
|
|
5
5
|
export * from "@digdir/designsystemet-web";
|
|
6
|
-
import { version as
|
|
7
|
-
import { analytics as
|
|
8
|
-
import { toggleAppExpanded as
|
|
9
|
-
import { fixLawHtml as
|
|
6
|
+
import { version as _ } from "./package.json.js";
|
|
7
|
+
import { analytics as q } from "./analytics/analytics.js";
|
|
8
|
+
import { toggleAppExpanded as B } from "./app/app-observer.js";
|
|
9
|
+
import { fixLawHtml as F, getLawChecked as G, parseLawIds as J, parseLawMeta as K, setLawChecked as N, toggleLawChecked as O } from "./law/law-helper.js";
|
|
10
10
|
import * as r from "./styles.module.css.js";
|
|
11
|
-
import { toast as
|
|
12
|
-
import "./deprecations.js";
|
|
11
|
+
import { toast as V } from "./toast/toast-helper.js";
|
|
13
12
|
import "./chart/chart-element.js";
|
|
13
|
+
import "./deprecations.js";
|
|
14
14
|
import "./logo/logo-observer.js";
|
|
15
|
+
import "./popover/popover-observer.js";
|
|
15
16
|
import "./table/table-observer.js";
|
|
16
17
|
import "./toast/toast-observer.js";
|
|
17
18
|
import "./tooltip/tooltip-element.js";
|
|
18
19
|
import "./validation/validation-observer.js";
|
|
19
20
|
import "@u-elements/u-datalist";
|
|
20
21
|
import "@u-elements/u-progress";
|
|
21
|
-
const
|
|
22
|
+
const H = String(o).replace(/\/\*[^!][^*]*\*\//gs, "").replace(/(\n|\t)/g, "").replace(/\s+/g, " ");
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
U as UHTMLComboboxElement,
|
|
25
|
+
d as UHTMLComboboxShadowRoot,
|
|
26
|
+
w as UHTMLComboboxStyle,
|
|
27
|
+
S as UHTMLTabElement,
|
|
28
|
+
c as UHTMLTabListElement,
|
|
29
|
+
g as UHTMLTabListShadowRoot,
|
|
30
|
+
h as UHTMLTabListStyle,
|
|
31
|
+
y as UHTMLTabPanelElement,
|
|
32
|
+
C as UHTMLTabPanelShadowRoot,
|
|
33
|
+
E as UHTMLTabPanelStyle,
|
|
34
|
+
R as UHTMLTabShadowRoot,
|
|
35
|
+
k as UHTMLTabStyle,
|
|
36
|
+
P as UHTMLTabsElement,
|
|
37
|
+
u as UHTMLTabsShadowRoot,
|
|
38
|
+
v as UHTMLTabsStyle,
|
|
39
|
+
q as analytics,
|
|
40
|
+
F as fixLawHtml,
|
|
41
|
+
G as getLawChecked,
|
|
42
|
+
J as parseLawIds,
|
|
43
|
+
K as parseLawMeta,
|
|
44
|
+
H as printcss,
|
|
45
|
+
N as setLawChecked,
|
|
45
46
|
r as styles,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
V as toast,
|
|
48
|
+
B as toggleAppExpanded,
|
|
49
|
+
O as toggleLawChecked,
|
|
50
|
+
_ as version
|
|
50
51
|
};
|
|
51
52
|
//# sourceMappingURL=index.js.map
|
package/mtds/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../designsystem/index.ts"],"sourcesContent":["// Import and expose custom elements not matching HTML elements for backward compatibility\nexport * from \"@u-elements/u-combobox\";\nexport * from \"@u-elements/u-tabs\";\nimport \"@u-elements/u-details\";\n\nimport printcssraw from \"./print/print.css?raw\"; // Expose print CSS\n\n// Minify print CSS\nexport const printcss = String(printcssraw)\n\t.replace(/\\/\\*[^!][^*]*\\*\\//gs, \"\") // Strip comments\n\t.replace(/(\\n|\\t)/g, \"\") // Strip newlines and tabs\n\t.replace(/\\s+/g, \" \"); // Strip multiple spaces\n\n// Expose API\nexport * from \"@digdir/designsystemet-web\"; // Import and expose Digdir web functionality\nexport { version } from \"../package.json\"; // Expose version to make it easier to debug\nexport * from \"./analytics/analytics\";\nexport * from \"./app/app-observer\";\nexport * from \"./law/law-helper\";\nexport * as styles from \"./styles.module.css\";\nexport * from \"./toast/toast-helper\";\n\n// Load behaviors\nimport \"./deprecations\";\nimport \"./
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../designsystem/index.ts"],"sourcesContent":["// Import and expose custom elements not matching HTML elements for backward compatibility\nexport * from \"@u-elements/u-combobox\";\nexport * from \"@u-elements/u-tabs\";\nimport \"@u-elements/u-details\";\n\nimport printcssraw from \"./print/print.css?raw\"; // Expose print CSS\n\n// Minify print CSS\nexport const printcss = String(printcssraw)\n\t.replace(/\\/\\*[^!][^*]*\\*\\//gs, \"\") // Strip comments\n\t.replace(/(\\n|\\t)/g, \"\") // Strip newlines and tabs\n\t.replace(/\\s+/g, \" \"); // Strip multiple spaces\n\n// Expose API\nexport * from \"@digdir/designsystemet-web\"; // Import and expose Digdir web functionality\nexport { version } from \"../package.json\"; // Expose version to make it easier to debug\nexport * from \"./analytics/analytics\";\nexport * from \"./app/app-observer\";\nexport * from \"./law/law-helper\";\nexport * as styles from \"./styles.module.css\";\nexport * from \"./toast/toast-helper\";\n\n// Load behaviors\nimport \"./chart/chart-element\";\nimport \"./deprecations\";\nimport \"./logo/logo-observer\";\nimport \"./popover/popover-observer\";\nimport \"./table/table-observer\";\nimport \"./toast/toast-observer\";\nimport \"./tooltip/tooltip-element\";\nimport \"./validation/validation-observer\";\nimport \"@u-elements/u-datalist\";\nimport \"@u-elements/u-progress\";\n\n// Expose types\nexport type Size = \"sm\" | \"md\" | \"lg\";\nexport type HeadingSize = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n"],"names":["printcss","printcssraw"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQO,MAAMA,IAAW,OAAOC,CAAW,EACxC,QAAQ,uBAAuB,EAAE,EACjC,QAAQ,YAAY,EAAE,EACtB,QAAQ,QAAQ,GAAG;"}
|
package/mtds/input/input.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export type InputProps = React.ComponentPropsWithoutRef<"input"
|
|
2
|
-
|
|
1
|
+
export type InputProps = React.ComponentPropsWithoutRef<"input"> & {
|
|
2
|
+
"data-indeterminate"?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare const Input: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
5
|
+
"data-indeterminate"?: boolean;
|
|
6
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
3
7
|
export type SelectProps = React.ComponentPropsWithoutRef<"select">;
|
|
4
8
|
export declare const Select: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import('react').RefAttributes<HTMLSelectElement>>;
|
|
5
9
|
export type TextareaProps = React.ComponentPropsWithoutRef<"textarea">;
|
package/mtds/input/input.js
CHANGED
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import a from "clsx";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
return l(r, () => u.current), f(() => {
|
|
8
|
-
u.current?.dispatchEvent(new CustomEvent("ds-field-update")), t.value;
|
|
9
|
-
}, [t.value]), /* @__PURE__ */ s(
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import i from "../styles.module.css.js";
|
|
5
|
+
const l = s(function({ "data-indeterminate": t, className: e, type: r = "text", ...u }, p) {
|
|
6
|
+
return /* @__PURE__ */ n(
|
|
10
7
|
"input",
|
|
11
8
|
{
|
|
12
|
-
className: a(
|
|
9
|
+
className: a(i.input, e),
|
|
10
|
+
"data-indeterminate": !!t || void 0,
|
|
13
11
|
suppressHydrationWarning: !0,
|
|
14
|
-
type:
|
|
15
|
-
ref:
|
|
16
|
-
...
|
|
12
|
+
type: r,
|
|
13
|
+
ref: p,
|
|
14
|
+
...u
|
|
17
15
|
}
|
|
18
16
|
);
|
|
19
|
-
}),
|
|
20
|
-
function({ className:
|
|
21
|
-
return /* @__PURE__ */
|
|
17
|
+
}), x = s(
|
|
18
|
+
function({ className: t, ...e }, r) {
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
22
20
|
"select",
|
|
23
21
|
{
|
|
24
|
-
className: a(
|
|
22
|
+
className: a(i.input, t),
|
|
25
23
|
suppressHydrationWarning: !0,
|
|
26
|
-
ref:
|
|
24
|
+
ref: r,
|
|
27
25
|
...e
|
|
28
26
|
}
|
|
29
27
|
);
|
|
30
28
|
}
|
|
31
|
-
),
|
|
32
|
-
function({ className:
|
|
33
|
-
|
|
34
|
-
return l(t, () => r.current), f(() => {
|
|
35
|
-
r.current?.dispatchEvent(new CustomEvent("ds-field-update")), e.value;
|
|
36
|
-
}, [e.value]), /* @__PURE__ */ s(
|
|
29
|
+
), y = s(
|
|
30
|
+
function({ className: t, ...e }, r) {
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
37
32
|
"textarea",
|
|
38
33
|
{
|
|
39
|
-
className: a(
|
|
34
|
+
className: a(i.input, t),
|
|
40
35
|
ref: r,
|
|
41
36
|
suppressHydrationWarning: !0,
|
|
42
37
|
...e
|
|
@@ -45,8 +40,8 @@ const E = i(function({ className: n, type: e = "text", ...t }, r) {
|
|
|
45
40
|
}
|
|
46
41
|
);
|
|
47
42
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
l as Input,
|
|
44
|
+
x as Select,
|
|
45
|
+
y as Textarea
|
|
51
46
|
};
|
|
52
47
|
//# sourceMappingURL=input.js.map
|
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
|
|
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\t\"data-indeterminate\"?: boolean;\n};\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n\t{ \"data-indeterminate\": indeterminate, className, type = \"text\", ...rest },\n\tref,\n) {\n\treturn (\n\t\t<input\n\t\t\tclassName={clsx(styles.input, className)}\n\t\t\tdata-indeterminate={!!indeterminate || undefined} // Remove attribute if false\n\t\t\tsuppressHydrationWarning // Prevent hydration mismatch for SSR caused by field-observer.ts\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\">;\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n\tfunction Select({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<select\n\t\t\t\tclassName={clsx(styles.input, className)}\n\t\t\t\tsuppressHydrationWarning // Prevent hydration mismatch for SSR caused by field-observer.ts\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type TextareaProps = React.ComponentPropsWithoutRef<\"textarea\">;\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n\tfunction Textarea({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<textarea\n\t\t\t\tclassName={clsx(styles.input, className)}\n\t\t\t\tref={ref}\n\t\t\t\tsuppressHydrationWarning // Prevent hydration mismatch for SSR caused by field-observer.ts\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Input","forwardRef","indeterminate","className","type","rest","ref","jsx","clsx","styles","Select","Textarea"],"mappings":";;;;AAOO,MAAMA,IAAQC,EAAyC,SAC7D,EAAE,sBAAsBC,GAAe,WAAAC,GAAW,MAAAC,IAAO,QAAQ,GAAGC,EAAA,GACpEC,GACC;AACD,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAWC,EAAKC,EAAO,OAAON,CAAS;AAAA,MACvC,sBAAoB,CAAC,CAACD,KAAiB;AAAA,MACvC,0BAAwB;AAAA,MACxB,MAAAE;AAAA,MACA,KAAAE;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC,GAGYK,IAAST;AAAA,EACrB,SAAgB,EAAE,WAAAE,GAAW,GAAGE,EAAA,GAAQC,GAAK;AAC5C,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,OAAON,CAAS;AAAA,QACvC,0BAAwB;AAAA,QACxB,KAAAG;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD,GAGaM,IAAWV;AAAA,EACvB,SAAkB,EAAE,WAAAE,GAAW,GAAGE,EAAA,GAAQC,GAAK;AAC9C,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,OAAON,CAAS;AAAA,QACvC,KAAAG;AAAA,QACA,0BAAwB;AAAA,QACvB,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
|
|
@@ -18,6 +18,7 @@ export declare const Switch: Story;
|
|
|
18
18
|
export declare const Sizes: Story;
|
|
19
19
|
export declare const ReadOnly: Story;
|
|
20
20
|
export declare const Disabled: Story;
|
|
21
|
+
export declare const Indeterminate: Story;
|
|
21
22
|
export declare const TypeSearch: Story;
|
|
22
23
|
export declare const TypeDate: Story;
|
|
23
24
|
export declare const TypeNumber: Story;
|
package/mtds/package.json.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { DSPaginationElement } from '@digdir/designsystemet-web';
|
|
2
2
|
import { Button } from '../button/button';
|
|
3
3
|
import { CustomReactElementProps } from '../react-types';
|
|
4
|
-
export type PaginationProps = Omit<CustomReactElementProps<DSPaginationElement>, "children"> &
|
|
4
|
+
export type PaginationProps = Omit<CustomReactElementProps<DSPaginationElement>, "children"> & {
|
|
5
|
+
"data-variant"?: "primary" | "secondary";
|
|
6
|
+
} & ({
|
|
5
7
|
children?: never;
|
|
6
8
|
current: number;
|
|
7
9
|
show?: number;
|
|
@@ -18,6 +20,8 @@ export type PaginationProps = Omit<CustomReactElementProps<DSPaginationElement>,
|
|
|
18
20
|
props?: never;
|
|
19
21
|
});
|
|
20
22
|
export declare const Pagination: import('react').ForwardRefExoticComponent<(Omit<Omit<CustomReactElementProps<DSPaginationElement>, "children"> & {
|
|
23
|
+
"data-variant"?: "primary" | "secondary";
|
|
24
|
+
} & {
|
|
21
25
|
children?: never;
|
|
22
26
|
current: number;
|
|
23
27
|
show?: number;
|
|
@@ -27,6 +31,8 @@ export declare const Pagination: import('react').ForwardRefExoticComponent<(Omit
|
|
|
27
31
|
type: "prev" | "next" | "page";
|
|
28
32
|
}) => Parameters<typeof Button>[0];
|
|
29
33
|
}, "ref"> | Omit<Omit<CustomReactElementProps<DSPaginationElement>, "children"> & {
|
|
34
|
+
"data-variant"?: "primary" | "secondary";
|
|
35
|
+
} & {
|
|
30
36
|
children: React.ReactNode;
|
|
31
37
|
current?: never;
|
|
32
38
|
show?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import type { DSPaginationElement } from \"@digdir/designsystemet-web\";\nimport { pagination } from \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../button/button\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type PaginationProps = Omit<\n\tCustomReactElementProps<DSPaginationElement>,\n\t\"children\"\n>
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../designsystem/pagination/pagination.tsx"],"sourcesContent":["import type { DSPaginationElement } from \"@digdir/designsystemet-web\";\nimport { pagination } from \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../button/button\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type PaginationProps = Omit<\n\tCustomReactElementProps<DSPaginationElement>,\n\t\"children\"\n> & {\n\t\"data-variant\"?: \"primary\" | \"secondary\";\n} & (\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<DSPaginationElement, PaginationProps>(\n\tfunction Pagination(\n\t\t{ children, 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<ds-pagination\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest, styles.pagination)}\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</ds-pagination>\n\t\t);\n\t},\n);\n"],"names":["Pagination","forwardRef","children","current","total","show","props","rest","ref","pages","next","prev","pagination","jsx","toCustomElementProps","styles","Button","key","page"],"mappings":";;;;;;AAiCO,MAAMA,IAAaC;AAAA,EACzB,SACC,EAAE,UAAAC,GAAU,SAAAC,GAAS,OAAAC,GAAO,MAAAC,IAAO,GAAG,OAAAC,GAAO,GAAGC,EAAA,GAChDC,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,KAAAL;AAAA,QACC,GAAGM,EAAqBP,GAAMQ,EAAO,UAAU;AAAA,QAE/C,UAAAb,uBACC,MAAA,EACA,UAAA;AAAA,UAAA,gBAAAW,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;"}
|
|
@@ -39,6 +39,9 @@ declare const meta: {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
42
45
|
};
|
|
43
46
|
export default meta;
|
|
44
47
|
type Story = StoryObj<typeof meta>;
|
|
@@ -46,4 +49,5 @@ export declare const WithLinks: Story;
|
|
|
46
49
|
export declare const React: Story;
|
|
47
50
|
export declare const WithButtons: Story;
|
|
48
51
|
export declare const Sizes: Story;
|
|
52
|
+
export declare const Variants: Story;
|
|
49
53
|
export declare const WithHelper: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { onHotReload as s, on as a, attr as c } from "../utils.js";
|
|
2
|
+
function i({ target: p }) {
|
|
3
|
+
const o = p?.closest?.("a"), t = o && c(o, "popovertarget"), e = t ? document.getElementById(t) : o?.closest("[popover]");
|
|
4
|
+
if (o && e instanceof HTMLElement && e.popover) {
|
|
5
|
+
const n = c(o, "popovertargetaction"), r = n === "show" || (n === "hide" ? !1 : void 0);
|
|
6
|
+
e.togglePopover(r);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
s("popover", () => [
|
|
10
|
+
a(document, "click", i)
|
|
11
|
+
// Allow `<a>` to use `popovertarget` as well
|
|
12
|
+
]);
|
|
13
|
+
//# sourceMappingURL=popover-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { attr, on, onHotReload } from \"../utils\";\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 handlePopoverClick({ target }: Event) {\n\tconst a = (target as Element)?.closest?.(\"a\");\n\tconst id = a && attr(a, \"popovertarget\");\n\tconst pop = id ? document.getElementById(id) : a?.closest(\"[popover]\");\n\n\tif (a && pop instanceof HTMLElement && pop.popover) {\n\t\tconst action = attr(a, \"popovertargetaction\");\n\t\tconst open = action === \"show\" || (action === \"hide\" ? false : undefined);\n\t\tpop.togglePopover(open);\n\t}\n}\n\nonHotReload(\"popover\", () => [\n\ton(document, \"click\", handlePopoverClick), // Allow `<a>` to use `popovertarget` as well\n]);\n"],"names":["handlePopoverClick","target","a","id","attr","pop","action","open","onHotReload","on"],"mappings":";AAKA,SAASA,EAAmB,EAAE,QAAAC,KAAiB;AAC9C,QAAMC,IAAKD,GAAoB,UAAU,GAAG,GACtCE,IAAKD,KAAKE,EAAKF,GAAG,eAAe,GACjCG,IAAMF,IAAK,SAAS,eAAeA,CAAE,IAAID,GAAG,QAAQ,WAAW;AAErE,MAAIA,KAAKG,aAAe,eAAeA,EAAI,SAAS;AACnD,UAAMC,IAASF,EAAKF,GAAG,qBAAqB,GACtCK,IAAOD,MAAW,WAAWA,MAAW,SAAS,KAAQ;AAC/D,IAAAD,EAAI,cAAcE,CAAI;AAAA,EACvB;AACD;AAEAC,EAAY,WAAW,MAAM;AAAA,EAC5BC,EAAG,UAAU,SAAST,CAAkB;AAAA;AACzC,CAAC;"}
|