-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from TobiTRy/litte-changes
Litte changes
- Loading branch information
Showing
131 changed files
with
1,206 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
export { default as DropDownSelect } from './DropDownSelect'; | ||
|
||
export type { | ||
TDropDownSelectItem, | ||
TDropDownSelect, | ||
TDropDownSelectNativeAttrs, | ||
TDropDownSelectWithNativeAttrs, | ||
} from './TDropDownSelect.model'; |
48 changes: 48 additions & 0 deletions
48
src/components/atoms/DynamicComponentWrapper/DynamicComponentWrapper.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import DynamicComponentWrapper from './DynamicComponentWrapper'; // Assuming component file is in the same directory | ||
|
||
# DynamicComponentWrapper | ||
|
||
Wrap React children with a dynamically specified component. | ||
|
||
## Overview | ||
|
||
This component provides a simple way to encapsulate each child element within a React component that you define. This is particularly useful for adding consistent styling or behavior across a group of children. | ||
|
||
## Props | ||
|
||
| Prop | Type | Description | | ||
| :----------------- | :------------------- | :-------------------------------------------------------------------------------------------------------------- | | ||
| `children` | `React.ReactNode` | The children elements to be wrapped. | | ||
| `wrapperComponent` | `React.ReactElement` | The component to wrap each child. This must be a valid React element (e.g., `<div>`, a custom component, etc.). | | ||
|
||
## Usage | ||
|
||
```jsx | ||
import React from 'react'; | ||
import DynamicComponentWrapper from 'fui-fancyui'; | ||
|
||
const ExampleComponent = () => ( | ||
<DynamicComponentWrapper WrapperComponent={<Link href="http://fui.cool" />}>Click me!</DynamicComponentWrapper> | ||
); | ||
|
||
export default ExampleComponent; | ||
``` | ||
|
||
In the above example: | ||
|
||
1. Each child (`<p>Child 1</p>` and `<p>Child 2</p>`) will be wrapped in an `<li>` element. | ||
2. The `<li>` element has a blue text color style applied to it. | ||
|
||
## Example | ||
|
||
```jsx | ||
<DynamicComponentWrapper wrapperComponent={<div style={{ border: '1px solid gray', padding: '10px' }}>}> | ||
<h2>This is wrapped text</h2> | ||
<p>Another wrapped paragraph.</p> | ||
</DynamicComponentWrapper> | ||
``` | ||
|
||
## Considerations | ||
|
||
- **Valid React Elements:** Ensure `wrapperComponent` is a valid React element (not a component function). | ||
- **Deeply Nested Children:** This component works well for children at a single level. If your children have deep nesting, consider refactoring your child structure or using a more complex recursive approach. |
Oops, something went wrong.