Skip to content

Commit 1a86644

Browse files
Merge release/v3.2.1 into main branch (#1249)
* Fix aria label on CreateableSelect (#1246) * Set RichTextEditor value to empty string if editor is empty (#1247) * Fix Heading default props & stories, fix disabled prop of CreateableSelect (#1248)
1 parent 0fb20e2 commit 1a86644

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@user-interviews/ui-design-system",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"dependencies": {
55
"@tiptap/core": "^2.3.1",
66
"@tiptap/extension-bold": "^2.3.1",

src/Heading/Heading.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ export default meta;
1919
type Story = StoryObj<typeof Heading>;
2020

2121
/**
22-
A default `Heading` as a level `2` with size `xxl` and weight `bold`
22+
A default `Heading` as a level `1` weight `bold`
2323
*/
2424
export const Default: Story = {
2525
args: {
2626
children: 'The fastest way to recruit research participants',
27-
level: 1,
2827
},
2928
};
3029

src/Heading/Heading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface HeadingProps {
1616
* logical hierarchy where each heading level represents a sublevel of the previous one,
1717
* and avoid skipping levels.
1818
*/
19-
level: 1 | 2 | 3 | 4 | 5 | 6;
19+
level?: 1 | 2 | 3 | 4 | 5 | 6;
2020
/**
2121
* @type {string}
2222
* @description Sizes map to the available font-sizes from the defined list of font-types.

src/RichTextEditor/RichTextEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const RichTextEditor = forwardRef((
171171
extensions: editorExtensions,
172172
content: initialValue,
173173
onUpdate: ({ editor: ttEditor }) => {
174-
const html = ttEditor.getHTML();
174+
const html = ttEditor.isEmpty ? '' : ttEditor.getHTML();
175175

176176
// if allowAttributes or allowedTags aren't passed
177177
// then use defaults from sanitize-html by not passing that key in the options

src/Select/CreatableSelect.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const CreatableSelect = ({
1515
className,
1616
components,
1717
defaultValue,
18-
disabled,
19-
getOptionValue,
2018
getOptionLabel,
19+
getOptionValue,
2120
id,
2221
inputId,
2322
isClearable,
23+
isDisabled,
2424
isLoading,
2525
menuWidth,
2626
modal,
@@ -34,18 +34,18 @@ const CreatableSelect = ({
3434
}) => (
3535
<Creatable
3636
{...props}
37-
ariaLabel={ariaLabel}
37+
aria-label={ariaLabel}
3838
ariaLabelledBy={ariaLabelledBy}
3939
className={`${className || ''} CreatableSelect`}
4040
classNamePrefix="Select"
4141
components={components}
4242
defaultValue={defaultValue}
43-
disabled={disabled}
4443
getOptionLabel={getOptionLabel}
4544
getOptionValue={getOptionValue}
4645
id={id}
4746
inputId={inputId}
4847
isClearable={isClearable}
48+
isDisabled={isDisabled}
4949
isLoading={isLoading}
5050
menuPortalTarget={modal ? document.body : undefined}
5151
name={name}
@@ -73,7 +73,6 @@ CreatableSelect.propTypes = {
7373
className: PropTypes.string,
7474
components: PropTypes.any,
7575
defaultValue: PropTypes.object,
76-
disabled: PropTypes.bool,
7776
getOptionLabel: PropTypes.func,
7877
getOptionValue: PropTypes.func,
7978
id: PropTypes.string,
@@ -83,6 +82,7 @@ CreatableSelect.propTypes = {
8382
*/
8483
inputId: PropTypes.string.isRequired,
8584
isClearable: PropTypes.bool,
85+
isDisabled: PropTypes.bool,
8686
isLoading: PropTypes.bool,
8787
menuWidth: PropTypes.string,
8888
modal: PropTypes.bool,
@@ -102,7 +102,7 @@ CreatableSelect.defaultProps = {
102102
className: undefined,
103103
components: undefined,
104104
defaultValue: undefined,
105-
disabled: false,
105+
isDisabled: false,
106106
getOptionLabel: undefined,
107107
getOptionValue: undefined,
108108
isClearable: false,

0 commit comments

Comments
 (0)