@mattilsynet/design 2.2.17 → 2.2.18

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.
@@ -0,0 +1,31 @@
1
+ import { MTDSElement } from '../utils';
2
+ export declare class MTDSLawElement extends MTDSElement {
3
+ _observer?: MutationObserver;
4
+ static get observedAttributes(): string[];
5
+ constructor();
6
+ connectedCallback(): void;
7
+ disconnectedCallback(): void;
8
+ attributeChangedCallback(): void;
9
+ handleMutation(): void;
10
+ handleEvent(event: Event): void;
11
+ scrollToId(id: string): void;
12
+ get checked(): string[];
13
+ set checked(ids: string[]);
14
+ }
15
+ export declare const parseLawIds: (ids: string[], lawHtml: string) => {
16
+ path: {
17
+ className: string;
18
+ id: string;
19
+ label: string;
20
+ url: string;
21
+ }[];
22
+ label: string;
23
+ url: string;
24
+ className: string;
25
+ id: string;
26
+ }[];
27
+ export declare const parseLawMeta: (lawHtml: string) => Record<"title" | (string & {}) | "legacyId" | "titleShort", {
28
+ label: string;
29
+ value: string;
30
+ }>;
31
+ export declare const renderLawHTML: (lawHtml: string) => string;
@@ -0,0 +1,18 @@
1
+ import { parseLawIds } from './law-helper';
2
+ declare global {
3
+ namespace React.JSX {
4
+ interface IntrinsicElements {
5
+ "mtds-law": LawProps;
6
+ }
7
+ }
8
+ }
9
+ export type LawProps = React.ComponentPropsWithoutRef<"div"> & {
10
+ html?: string;
11
+ checked?: string[];
12
+ onCheckedChange?: (checked: ReturnType<typeof parseLawIds>) => void;
13
+ };
14
+ export declare const Law: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
15
+ html?: string;
16
+ checked?: string[];
17
+ onCheckedChange?: (checked: ReturnType<typeof parseLawIds>) => void;
18
+ } & React.RefAttributes<HTMLDivElement>>;