Skip to content

Commit 0788491

Browse files
updated docs
1 parent 7db040e commit 0788491

File tree

4 files changed

+13
-66
lines changed

4 files changed

+13
-66
lines changed

docs/docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ExampleComponent = () => {
4040
<button className="w-full mx-auto" onClick={() => setIsOpen(!isOpen)}>
4141
Open Popup
4242
</button>
43-
<PopupContainer
43+
<Popup
4444
animation="bounce"
4545
open={isOpen}
4646
closeOnEscape={true}
@@ -49,7 +49,7 @@ const ExampleComponent = () => {
4949
onClose={onClose}
5050
>
5151
Say Hello to React-Poupify !!
52-
</PopupContainer>
52+
</Popup>
5353
</div>
5454
)
5555
}

docs/docs/popup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Popup
66

77
## Overview
88

9-
The `Popup` component is a versatile React component designed to display popup windows with customizable options for animations, auto-close behavior, and various close mechanisms. It supports nested children and can be controlled programmatically via a ref.
9+
The ` Popup` component is a higher-order React component designed to manage and display popup windows. It extends the `PopupContainer` component functionality by providing a container that handles rendering within a specified DOM element (defaulting to a `div` with the ID `popup-root`). This component offers additional customization for backdrops and integrates various popup properties for a seamless user experience.
1010

1111
## Props
1212

docs/docs/popupContainer.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: PopupContainer
66

77
## Overview
88

9-
The `PopupContainer` component is a higher-order React component designed to manage and display popup windows. It extends the `Popup` component functionality by providing a container that handles rendering within a specified DOM element (defaulting to a `div` with the ID `popup-root`). This component offers additional customization for backdrops and integrates various popup properties for a seamless user experience.
9+
The `PopupContainer` component is a versatile React component designed to display popup windows with customizable options for animations, auto-close behavior, and various close mechanisms. It supports nested children and can be controlled programmatically via a ref.
1010

1111
## Props
1212

@@ -27,60 +27,6 @@ The `PopupContainer` component is a higher-order React component designed to man
2727
| `duration` | `number` | `300` | Duration of the animation in milliseconds. |
2828
| `popupClassName` | `string` | N/A | Additional class names for the popup element. |
2929

30-
### Default Props
31-
32-
The `PopupContainer` component merges these default properties with the user-provided props:
33-
34-
```typescript
35-
const defaultProps: defualtProps = {
36-
autoClose: false,
37-
closeOnOutsideClick: true,
38-
closeOnEscape: true,
39-
animation: 'fade',
40-
duration: 300,
41-
closeButton: true,
42-
}
43-
```
44-
45-
## Usage Example
46-
47-
```jsx
48-
import React, { useRef } from 'react'
49-
import PopupContainer from './PopupContainer'
50-
51-
const ExampleComponent = () => {
52-
const popupContainerRef = useRef(null)
53-
54-
const openPopup = () => {
55-
if (popupContainerRef.current) {
56-
popupContainerRef.current.open()
57-
}
58-
}
59-
60-
const closePopup = () => {
61-
if (popupContainerRef.current) {
62-
popupContainerRef.current.close()
63-
}
64-
}
65-
66-
return (
67-
<div>
68-
<button onClick={openPopup}>Open Popup</button>
69-
<PopupContainer
70-
ref={popupContainerRef}
71-
open={false}
72-
animation="fade"
73-
duration={300}
74-
onClose={() => console.log('Popup closed')}
75-
>
76-
<div>Popup content goes here</div>
77-
</PopupContainer>
78-
</div>
79-
)
80-
}
81-
82-
export default ExampleComponent
83-
```
8430

8531
## Notes
8632

docs/docs/transition.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ Defines the Type of animations that can be applied.
2222
2323
Defines the properties that can be passed to the Transition component.
2424
25-
| Property | Type | Default | Description |
26-
| :---------: | :---------------: | ------: | --------------------------------------------------------------------------------------------------- |
27-
| `animation` | `Animation` | N/A | The type of animation to be applied. Must be one of `bounce`, `flip`, `zoom`, or `fade`. |
28-
| `duration` | `number` | 300 | The duration of the animation in milliseconds. |
29-
| `children` | `React.ReactNode` | N/A | The child elements that will be wrapped by the Transition component and subjected to the animation. |
30-
| `in` | `boolean` | N/A | A flag to determine if the component should be in the "entered" state. |
31-
| `onEntered` | `() => void` | N/A | A callback function that is called when the enter animation has completed. |
32-
| `onExited` | `() => void` | N/A | A callback function that is called when the exit animation has completed. |
25+
| Property | Type | Default | Description |
26+
| :---------: | :-------------------------------: | ------: | --------------------------------------------------------------------------------------------------- |
27+
| `animation` | `Animation` | N/A | The type of animation to be applied. Must be one of `bounce`, `flip`, `zoom`, or `fade`. |
28+
| `duration` | `number` | 300 | The duration of the animation in milliseconds. |
29+
| `children` | `React.ReactNode` | N/A | The child elements that will be wrapped by the Transition component and subjected to the animation. |
30+
| `in` | `boolean` | N/A | A flag to determine if the component should be in the "entered" state. |
31+
| `onEntered` | `() => void` | N/A | A callback function that is called when the enter animation has completed. |
32+
| `onExited` | `() => void` | N/A | A callback function that is called when the exit animation has completed. |
33+
| `nodeRef` | `React.RefObject<HTMLDivElement>` | N/A | Ref to child component |
3334
3435
## Usage Example
3536

0 commit comments

Comments
 (0)