Skip to content

Commit

Permalink
Merge pull request #50 from perimetre/feature/checkbox-radio-richtext
Browse files Browse the repository at this point in the history
feature: Added support to richtext for checkbox and radio inputs
  • Loading branch information
macanhajc authored Oct 20, 2021
2 parents 1bfbc9f + 773ec35 commit 64e0543
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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

## [3.1.4] 2021-10-20

### Added

- Added rich-text support for inputs of type Radio and Checkbox

## [3.1.3] 2021-08-04

### 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": "3.1.3",
"version": "3.1.4",
"repository": {
"type": "git",
"url": "git+https://github.com/perimetre/ui.git"
Expand Down
5 changes: 4 additions & 1 deletion src/components/CheckboxRadioInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useRef } from 'react';
import classnames from 'classnames';
import { HTMLParsedContent } from '../HTMLParsedContent';

const sizeClassnameMap = {
small: 'pui-check-radio-small',
Expand Down Expand Up @@ -98,7 +99,9 @@ export const CheckboxRadioInput: React.FC<CheckboxRadioInputProps> = ({
<div>
<label className={`${type === 'checkbox' ? 'pui-checkbox-label' : 'pui-radio-label'}`}>
{input}
<span>{label}</span>
<span>
<HTMLParsedContent content={label} className="max-w-none" />
</span>
</label>
{bottom}
</div>
Expand Down

0 comments on commit 64e0543

Please sign in to comment.