@utrecht/component-library-react 1.0.0-alpha.270 → 1.0.0-alpha.271
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/dist/.jest-test-results.json +1 -1
- package/dist/Accordion.d.ts +49 -0
- package/dist/css-module/Accordion.d.ts +49 -0
- package/dist/css-module/css-module/Accordion.d.ts +6 -0
- package/dist/css-module/css-module/index.d.ts +1 -0
- package/dist/css-module/index.d.ts +1 -0
- package/dist/css-module/index.js +348 -102
- package/dist/css-module/index.js.map +1 -1
- package/dist/css-module/index.mjs +347 -104
- package/dist/css-module/index.mjs.map +1 -1
- package/dist/index.cjs.js +343 -101
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +342 -103
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ForwardedRef, HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
export interface AccordionSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
headingLevel?: number;
|
|
4
|
+
label: string;
|
|
5
|
+
body: any;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
section?: boolean;
|
|
9
|
+
onActivate?: Function;
|
|
10
|
+
onButtonFocus?: Function;
|
|
11
|
+
onButtonBlur?: Function;
|
|
12
|
+
buttonRef?: RefObject<HTMLButtonElement>;
|
|
13
|
+
}
|
|
14
|
+
export declare const AccordionSection: import("react").ForwardRefExoticComponent<AccordionSectionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
headingLevel?: number;
|
|
17
|
+
heading?: string;
|
|
18
|
+
group?: false;
|
|
19
|
+
}
|
|
20
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & {
|
|
21
|
+
children?: import("react").ReactNode;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const useAccordion: <T>(sections: T[], ref: RefObject<HTMLDivElement | undefined>) => {
|
|
24
|
+
ref: RefObject<HTMLDivElement | undefined>;
|
|
25
|
+
refs: RefObject<HTMLDivElement>[];
|
|
26
|
+
buttonRefs: RefObject<HTMLButtonElement>[];
|
|
27
|
+
activeElement: null;
|
|
28
|
+
sections: T[];
|
|
29
|
+
focusNextSection: (activeElement: RefObject<HTMLDivElement>) => void;
|
|
30
|
+
focusFirstSection: () => void;
|
|
31
|
+
focusPreviousSection: (activeElement: RefObject<HTMLDivElement>) => void;
|
|
32
|
+
focusLastSection: () => void;
|
|
33
|
+
};
|
|
34
|
+
interface AccordionSectionProviderProps {
|
|
35
|
+
defaultExpanded?: boolean;
|
|
36
|
+
expanded?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const useAccordionSection: ({ defaultExpanded, expanded }: AccordionSectionProviderProps, ref: ForwardedRef<HTMLDivElement>) => {
|
|
39
|
+
ref: ForwardedRef<HTMLDivElement>;
|
|
40
|
+
expanded: boolean;
|
|
41
|
+
};
|
|
42
|
+
interface AccordionProviderProps {
|
|
43
|
+
sections: AccordionSectionProps[];
|
|
44
|
+
}
|
|
45
|
+
export declare const AccordionProvider: {
|
|
46
|
+
({ sections }: AccordionProviderProps): JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ForwardedRef, HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
export interface AccordionSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
headingLevel?: number;
|
|
4
|
+
label: string;
|
|
5
|
+
body: any;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
section?: boolean;
|
|
9
|
+
onActivate?: Function;
|
|
10
|
+
onButtonFocus?: Function;
|
|
11
|
+
onButtonBlur?: Function;
|
|
12
|
+
buttonRef?: RefObject<HTMLButtonElement>;
|
|
13
|
+
}
|
|
14
|
+
export declare const AccordionSection: import("react").ForwardRefExoticComponent<AccordionSectionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
headingLevel?: number;
|
|
17
|
+
heading?: string;
|
|
18
|
+
group?: false;
|
|
19
|
+
}
|
|
20
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & {
|
|
21
|
+
children?: import("react").ReactNode;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const useAccordion: <T>(sections: T[], ref: RefObject<HTMLDivElement | undefined>) => {
|
|
24
|
+
ref: RefObject<HTMLDivElement | undefined>;
|
|
25
|
+
refs: RefObject<HTMLDivElement>[];
|
|
26
|
+
buttonRefs: RefObject<HTMLButtonElement>[];
|
|
27
|
+
activeElement: null;
|
|
28
|
+
sections: T[];
|
|
29
|
+
focusNextSection: (activeElement: RefObject<HTMLDivElement>) => void;
|
|
30
|
+
focusFirstSection: () => void;
|
|
31
|
+
focusPreviousSection: (activeElement: RefObject<HTMLDivElement>) => void;
|
|
32
|
+
focusLastSection: () => void;
|
|
33
|
+
};
|
|
34
|
+
interface AccordionSectionProviderProps {
|
|
35
|
+
defaultExpanded?: boolean;
|
|
36
|
+
expanded?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const useAccordionSection: ({ defaultExpanded, expanded }: AccordionSectionProviderProps, ref: ForwardedRef<HTMLDivElement>) => {
|
|
39
|
+
ref: ForwardedRef<HTMLDivElement>;
|
|
40
|
+
expanded: boolean;
|
|
41
|
+
};
|
|
42
|
+
interface AccordionProviderProps {
|
|
43
|
+
sections: AccordionSectionProps[];
|
|
44
|
+
}
|
|
45
|
+
export declare const AccordionProvider: {
|
|
46
|
+
({ sections }: AccordionProviderProps): JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
export {};
|