@shohojdhara/atomix 0.1.9 → 0.1.10
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.
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps, IconPosition } from '../../lib/types/components';
|
|
3
3
|
/**
|
|
4
4
|
* Accordion component for showing/hiding content panels
|
|
5
|
-
* @see AccordionProps in types/components.ts
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
6
|
+
export interface AccordionProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Title of the accordion
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* Content to be shown when accordion is expanded
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the accordion is initially open
|
|
17
|
+
*/
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Position of the icon (right or left)
|
|
21
|
+
*/
|
|
22
|
+
iconPosition?: IconPosition;
|
|
23
|
+
/**
|
|
24
|
+
* Custom icon for the accordion
|
|
25
|
+
*/
|
|
26
|
+
icon?: ReactNode;
|
|
8
27
|
/**
|
|
9
28
|
* Controlled open state (overrides defaultOpen)
|
|
10
29
|
*/
|
|
@@ -13,7 +32,7 @@ export type AccordionProps = AccordionPropsType & {
|
|
|
13
32
|
* Callback when open state changes (for controlled mode)
|
|
14
33
|
*/
|
|
15
34
|
onOpenChange?: (open: boolean) => void;
|
|
16
|
-
}
|
|
35
|
+
}
|
|
17
36
|
declare const Accordion: React.FC<AccordionProps>;
|
|
18
37
|
export default Accordion;
|
|
19
38
|
export { Accordion };
|
package/package.json
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
1
|
import React, { ReactNode, useId } from 'react';
|
|
2
2
|
import { ACCORDION } from '../../lib/constants/components';
|
|
3
3
|
import { useAccordion } from '../../lib/composables/useAccordion';
|
|
4
|
-
import {
|
|
4
|
+
import { BaseComponentProps, IconPosition } from '../../lib/types/components';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Accordion component for showing/hiding content panels
|
|
8
|
-
* @see AccordionProps in types/components.ts
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
9
|
+
export interface AccordionProps extends BaseComponentProps {
|
|
10
|
+
/**
|
|
11
|
+
* Title of the accordion
|
|
12
|
+
*/
|
|
13
|
+
title: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Content to be shown when accordion is expanded
|
|
17
|
+
*/
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Whether the accordion is initially open
|
|
22
|
+
*/
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Position of the icon (right or left)
|
|
27
|
+
*/
|
|
28
|
+
iconPosition?: IconPosition;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Custom icon for the accordion
|
|
32
|
+
*/
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
|
|
11
35
|
/**
|
|
12
36
|
* Controlled open state (overrides defaultOpen)
|
|
13
37
|
*/
|
|
14
38
|
isOpen?: boolean;
|
|
39
|
+
|
|
15
40
|
/**
|
|
16
41
|
* Callback when open state changes (for controlled mode)
|
|
17
42
|
*/
|
|
@@ -96,4 +121,4 @@ Accordion.displayName = 'Accordion';
|
|
|
96
121
|
export default Accordion;
|
|
97
122
|
|
|
98
123
|
// Named export for compatibility
|
|
99
|
-
export { Accordion };
|
|
124
|
+
export { Accordion };
|