-
-
Notifications
You must be signed in to change notification settings - Fork 755
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 #2829 from udecode/refactor/plate-ui
Refactor/plate UI
- Loading branch information
Showing
400 changed files
with
2,493 additions
and
2,977 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@udecode/cn': minor | ||
--- | ||
|
||
New package | ||
|
||
- `cn`: utility function to conditionally join classNames | ||
- `withCn`: Set default `className` to a component using `cn` | ||
- `withProps`: Set default props to a component | ||
- `withVariants`: Set default `className` to a component using variants from `class-variance-authority` |
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,8 @@ | ||
--- | ||
'@udecode/react-utils': minor | ||
--- | ||
|
||
New package | ||
|
||
- `PortalBody`, `Text`, `Box`, `createPrimitiveComponent`, `createSlotComponent`, `withProviders` from `@udecode/plate-utils` | ||
- `createPrimitiveElement`: Creates a component from an element type |
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,6 @@ | ||
--- | ||
'@udecode/plate-ui': minor | ||
--- | ||
|
||
- Remove `utils` aliases: `@udecode/cn` dependency is now used | ||
- Remove `clsx` dependency |
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,5 @@ | ||
--- | ||
'@udecode/plate-common': patch | ||
--- | ||
|
||
- Fix import from RSC |
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,5 @@ | ||
--- | ||
'@udecode/plate-common': minor | ||
--- | ||
|
||
- re-export `@udecode/react-utils` |
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,7 @@ | ||
--- | ||
'@udecode/plate-utils': major | ||
--- | ||
|
||
- Moved `withProps` to `@udecode/cn` | ||
- Moved `PortalBody`, `Text`, `Box`, `createPrimitiveComponent`, `createSlotComponent`, `withProviders` to `@udecode/react-utils` | ||
- Removed `getRootProps` (unused) |
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,78 @@ | ||
--- | ||
title: cn | ||
description: API reference for @udecode/cn. | ||
--- | ||
|
||
`@udecode/cn` contains utility functions for React & Tailwind. | ||
|
||
### cn | ||
|
||
Conditionally add Tailwind CSS classes without conflicts. | ||
|
||
<APIParameters> | ||
<APIItem name="...inputs" type="CxOptions"> | ||
Class values set using `clsx` and `tailwind-merge`. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
|
||
`className` string. | ||
|
||
</APIReturns> | ||
|
||
### withCn | ||
|
||
Set default `className` to a component. | ||
|
||
<APIParameters> | ||
<APIItem name="Component" type="React.ComponentType"> | ||
The component to which props will be added. | ||
</APIItem> | ||
<APIItem name="...inputs" type="CxOptions"> | ||
The default `className` to set using `cn`. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
|
||
A new component that includes the default `className`. | ||
|
||
</APIReturns> | ||
|
||
### withProps | ||
|
||
Set default props to a component. | ||
|
||
<APIParameters> | ||
<APIItem name="Component" type="React.ComponentType | ElementType"> | ||
The component to which props will be added. | ||
</APIItem> | ||
<APIItem name="props" type="Partial<T>"> | ||
The props to be added to the component. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
|
||
A new component that includes the default props. | ||
|
||
</APIReturns> | ||
|
||
### withVariants | ||
|
||
Set default `className` to a component using variants from `class-variance-authority`. | ||
|
||
<APIParameters> | ||
<APIItem name="Component" type="React.ComponentType | ElementType"> | ||
The component to which props will be added. | ||
</APIItem> | ||
<APIItem name="variants" type="V extends ReturnType<typeof cva>"> | ||
The variants as the default `className`. | ||
</APIItem> | ||
<APIItem name="onlyVariantsProps" type="(keyof VariantProps<V>)[]"> | ||
The props to exclude from `Component`. Set the props that are only used for variants. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
|
||
A new component that includes the default `className`. | ||
|
||
</APIReturns> |
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,82 @@ | ||
--- | ||
title: React Utils | ||
description: API reference for @udecode/react-utils. | ||
--- | ||
|
||
`@udecode/react-utils` contains utility functions for React. | ||
|
||
### PortalBody | ||
|
||
Renders a React component in the `document.body` using a portal. | ||
|
||
### Text | ||
|
||
Generic component for rendering a span. | ||
|
||
### Box | ||
|
||
Generic component for rendering a div. | ||
|
||
### createPrimitiveComponent | ||
|
||
Creates a primitive component factory which utilizes hooks for managing state, props, and forwards references to child components. | ||
|
||
<APIParameters> | ||
<APIItem name="element" type="React.ElementType"> | ||
The base component or native HTML element. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
A function returning a primitive component with hooks for state and props | ||
management. | ||
</APIReturns> | ||
|
||
### createPrimitiveElement | ||
|
||
Creates a component from an element type. | ||
|
||
<APIParameters> | ||
<APIItem name="element" type="React.ElementType"> | ||
The native HTML element. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
A function component that renders the specified element. | ||
</APIReturns> | ||
|
||
### createSlotComponent | ||
|
||
Creates a Slot component, which is useful when you want a component to behave as its child. | ||
|
||
<APIParameters> | ||
<APIItem name="element" type="React.ElementType"> | ||
The base component or native HTML element. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
|
||
A function returning a Slot component. | ||
|
||
</APIReturns> | ||
|
||
### withProviders | ||
|
||
A function that wraps a component into multiple providers. | ||
|
||
<APIParameters> | ||
<APIItem name="providers" type="any[]"> | ||
Providers with which to wrap the component. | ||
|
||
If there are any props that you want a provider to receive, you can simply pass an array. | ||
|
||
</APIItem> | ||
<APIItem name="WrappedComponent" type="FunctionComponent<T>"> | ||
The component to be wrapped. | ||
</APIItem> | ||
<APIItem name="props" type="T"> | ||
The props to be passed to the wrapped component. | ||
</APIItem> | ||
</APIParameters> | ||
<APIReturns> | ||
A new component that is wrapped by the specified providers. | ||
</APIReturns> |
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
Oops, something went wrong.