From 7c3181da9bdb0fcc36414d95d242ce46a227bdff Mon Sep 17 00:00:00 2001 From: AssisrMatheus Date: Mon, 24 Apr 2023 14:17:29 -0400 Subject: [PATCH] feat: adds ability of jsx in wysiwyg input --- .gitignore | 7 +++++++ CHANGELOG.md | 6 ++++++ package.json | 2 +- src/components/WYSIWYGInput/index.tsx | 10 ++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 930b162..6594adf 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index a5098ea..800cd7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index d0a3fca..e04241c 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/components/WYSIWYGInput/index.tsx b/src/components/WYSIWYGInput/index.tsx index 8b0274d..e882e7c 100644 --- a/src/components/WYSIWYGInput/index.tsx +++ b/src/components/WYSIWYGInput/index.tsx @@ -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 */ @@ -305,9 +305,11 @@ export const WYSIWYGInput = forwardRef( return (
- + {label && ( + + )}