Skip to content

Commit

Permalink
feat: adds ability of jsx in wysiwyg input
Browse files Browse the repository at this point in the history
  • Loading branch information
AssisrMatheus committed Apr 24, 2023
1 parent a3d00af commit 7c3181d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ RELEASE.md
out*

safelist.txt
/.idea/codeStyles/codeStyleConfig.xml
/.idea/codeStyles/Project.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/.gitignore
/.idea/modules.xml
/.idea/ui.iml
/.idea/vcs.xml
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [10.4.0] 2023-04-24

### Changes

- Added option to use JSX as label text of `WYSIWYGInput`

## [10.3.0] 2023-04-18

### Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@perimetre/ui",
"description": "A component library made by @perimetre",
"version": "10.3.0",
"version": "10.4.0",
"repository": {
"type": "git",
"url": "git+https://github.com/perimetre/ui.git"
Expand Down
10 changes: 6 additions & 4 deletions src/components/WYSIWYGInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type WYSIWYGInputProps = PropsWithChildren<
/**
* If provided, displays a label above the input
*/
label?: string;
label?: React.ReactNode;
/**
* If provided, displays a help text under the input
*/
Expand Down Expand Up @@ -305,9 +305,11 @@ export const WYSIWYGInput = forwardRef<WYSIWYGInputRef, WYSIWYGInputProps>(

return (
<div>
<label className="pui-label-input" htmlFor={id}>
{label}
</label>
{label && (
<label className="pui-label-input" htmlFor={id}>
{label}
</label>
)}
<span
className={classnames(containerClassName, {
'pui-wysiwyg-input-error': !!error,
Expand Down

0 comments on commit 7c3181d

Please sign in to comment.