@shohojdhara/atomix 0.1.9 → 0.1.11

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 { AccordionProps as AccordionPropsType } from '../../lib/types/components';
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 type AccordionProps = AccordionPropsType & {
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 };
@@ -1,2 +1,2 @@
1
- export { Accordion } from './Accordion';
1
+ export { default, Accordion } from './Accordion';
2
2
  export type { AccordionProps } from './Accordion';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shohojdhara/atomix",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Atomix Design System - A modern component library for web applications",
5
5
  "main": "dist/js/atomix.react.cjs.js",
6
6
  "module": "dist/js/atomix.react.esm.js",
@@ -120,13 +120,13 @@ export const AccordionGroup: Story = {
120
120
  >
121
121
  <p>Content of the first accordion.</p>
122
122
  </Accordion>
123
-
123
+
124
124
  <Accordion
125
125
  title="Second Accordion"
126
126
  >
127
127
  <p>Content of the second accordion.</p>
128
128
  </Accordion>
129
-
129
+
130
130
  <Accordion
131
131
  title="Third Accordion"
132
132
  >
@@ -159,28 +159,28 @@ export const AllVariants: Story = {
159
159
  <p>This is the default accordion.</p>
160
160
  </Accordion>
161
161
  </div>
162
-
162
+
163
163
  <div>
164
164
  <h3>Initially Open</h3>
165
165
  <Accordion title="Initially Open Accordion" defaultOpen={true}>
166
166
  <p>This accordion starts in the open state.</p>
167
167
  </Accordion>
168
168
  </div>
169
-
169
+
170
170
  <div>
171
171
  <h3>Disabled</h3>
172
172
  <Accordion title="Disabled Accordion" disabled={true}>
173
173
  <p>This accordion is disabled and cannot be interacted with.</p>
174
174
  </Accordion>
175
175
  </div>
176
-
176
+
177
177
  <div>
178
178
  <h3>Icon on Left</h3>
179
179
  <Accordion title="Icon on Left" iconPosition="left">
180
180
  <p>This accordion has its icon positioned on the left.</p>
181
181
  </Accordion>
182
182
  </div>
183
-
183
+
184
184
  <div>
185
185
  <h3>Custom Icon</h3>
186
186
  <Accordion
@@ -199,7 +199,7 @@ export const AllVariants: Story = {
199
199
  <p>This accordion uses a custom plus icon.</p>
200
200
  </Accordion>
201
201
  </div>
202
-
202
+
203
203
  <div>
204
204
  <h3>With Rich Content</h3>
205
205
  <Accordion title="Rich Content">
@@ -255,4 +255,4 @@ export const Controlled: Story = {
255
255
  },
256
256
  },
257
257
  },
258
- };
258
+ };
@@ -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 { AccordionProps as AccordionPropsType } from '../../lib/types/components';
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 type AccordionProps = AccordionPropsType & {
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 };
@@ -1,2 +1,2 @@
1
- export { Accordion } from './Accordion';
2
- export type { AccordionProps } from './Accordion';
1
+ export { default, Accordion } from './Accordion';
2
+ export type { AccordionProps } from './Accordion';