Skip to content

Commit 31fa9b7

Browse files
committed
fixup! fixup! transform RUI to typescript (#394)
1 parent 3d5dfc7 commit 31fa9b7

File tree

19 files changed

+30
-30
lines changed

19 files changed

+30
-30
lines changed

src/components/Alert/Alert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { AlertProps } from './Alert.types';
1010
export const Alert: React.FunctionComponent<AlertProps> = ({
1111
children,
1212
color = 'note',
13-
icon = null,
13+
icon,
1414
id,
15-
onClose = null,
15+
onClose,
1616
...restProps
1717
}) => {
1818
const translations = useContext(TranslationsContext);

src/components/Button/Button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ import styles from './Button.module.scss';
1414

1515
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
1616
const {
17-
afterLabel = null,
18-
beforeLabel = null,
17+
afterLabel,
18+
beforeLabel,
1919
block = false,
2020
disabled = false,
21-
endCorner = null,
22-
feedbackIcon = null,
21+
endCorner,
22+
feedbackIcon,
2323
id,
2424
label,
2525
labelVisibility = 'xs',
2626
priority = 'filled',
2727
size = 'medium',
28-
startCorner = null,
28+
startCorner,
2929
color = 'primary',
3030
...restProps
3131
} = props;

src/components/ButtonGroup/ButtonGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import styles from './ButtonGroup.module.scss';
1717
export const ButtonGroup: React.FunctionComponent<ButtonGroupProps> = ({
1818
block = defaultValues.block,
1919
disabled = defaultValues.disabled,
20-
children = null,
20+
children,
2121
priority = defaultValues.priority,
2222
size = defaultValues.size,
2323
...restProps

src/components/CheckboxField/CheckboxField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import styles from './CheckboxField.module.scss';
1010
export const CheckboxField = React.forwardRef<HTMLInputElement, CheckboxFieldProps>((props, ref) => {
1111
const {
1212
disabled = false,
13-
helpText = null,
13+
helpText,
1414
id,
1515
isLabelVisible = true,
1616
label,
1717
labelPosition = 'after',
1818
renderAsRequired = false,
1919
required = false,
2020
validationState,
21-
validationText = null,
21+
validationText,
2222
...restProps
2323
} = props;
2424
const context = useContext(FormLayoutContext);

src/components/FileInputField/FileInputField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export const FileInputField = React.forwardRef<HTMLInputElement, FileInputFieldP
1212
const {
1313
disabled = false,
1414
fullWidth = false,
15-
helpText = null,
15+
helpText,
1616
id,
1717
isLabelVisible = true,
1818
label,
1919
layout = 'vertical',
2020
required = false,
2121
validationState,
22-
validationText = null,
22+
validationText,
2323
...restProps
2424
} = props;
2525

src/components/FormLayout/FormLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { PREDEFINED_LABEL_WIDTH_VALUES } from './constants';
1414

1515
export const FormLayout: React.FunctionComponent<FormLayoutProps> = ({
1616
autoWidth = false,
17-
children = null,
17+
children,
1818
fieldLayout = defaultValues.layout,
1919
labelWidth = 'default',
2020
...restProps

src/components/Grid/Grid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const Grid: React.FunctionComponent<GridProps> = ({
1010
alignContent,
1111
alignItems,
1212
autoFlow,
13-
children = null,
13+
children,
1414
columnGap = 4,
1515
columns = '1fr',
1616
justifyContent,

src/components/Grid/GridSpan.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import styles from './Grid.module.scss';
77
import { GridSpanProps } from './GridSpan.types';
88

99
export const GridSpan: React.FunctionComponent<GridSpanProps> = ({
10-
children = null,
10+
children,
1111
columns = 1,
1212
rows = 1,
1313
tag: Tag = 'div',

src/components/InputGroup/InputGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const InputGroup: React.FunctionComponent<InputGroupProps> = ({
2828
layout = defaultValues.layout,
2929
required = false,
3030
size = defaultValues.size,
31-
validationTexts = null,
31+
validationTexts,
3232
...restProps
3333
}) => {
3434
const formLayoutContext = useContext(FormLayoutContext);

src/components/Modal/Modal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ export const Modal: React.FunctionComponent<ModalProps> = ({
5757
allowCloseOnEscapeKey = true,
5858
allowPrimaryActionOnEnterKey = true,
5959
autoFocus = true,
60-
children = null,
60+
children,
6161
closeButtonRef,
62-
dialogRef = null,
63-
portalId = null,
62+
dialogRef,
63+
portalId,
6464
position = 'center',
6565
preventScrollUnderneath = window.document.body,
6666
primaryButtonRef,
@@ -125,7 +125,7 @@ export const Modal: React.FunctionComponent<ModalProps> = ({
125125
onKeyDown,
126126
};
127127

128-
if (portalId === null) {
128+
if (portalId === undefined) {
129129
return preRender(
130130
children,
131131
internalDialogRef,

src/components/Modal/ModalBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ModalBodyProps } from './ModalBody.types';
88
import styles from './ModalBody.module.scss';
99

1010
export const ModalBody: React.FunctionComponent<ModalBodyProps> = ({
11-
children = null,
11+
children,
1212
scrolling = 'auto',
1313
...restProps
1414
}) => {

src/components/Modal/ModalContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ModalContentProps } from './ModalContent.types';
66
import styles from './ModalContent.module.scss';
77

88
export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
9-
children = null,
9+
children,
1010
...restProps
1111
}) => {
1212
if (isChildrenEmpty(children)) {

src/components/ScrollView/ScrollView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ScrollView = React.forwardRef<HTMLDivElement, ScrollViewProps>((pro
3030
arrows = false,
3131
arrowsScrollStep = 200,
3232
autoScroll = 'off',
33-
children = null,
33+
children,
3434
endShadowBackground = 'linear-gradient(var(--rui-local-end-shadow-direction), rgba(255 255 255 / 1), rgba(255 255 255 / 0))',
3535
endShadowInitialOffset = '-1rem',
3636
endShadowSize = '2em',

src/components/SelectField/SelectField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const SelectField = React.forwardRef<HTMLSelectElement, SelectFieldProps>
1818
const {
1919
disabled = false,
2020
fullWidth = false,
21-
helpText = null,
21+
helpText,
2222
id,
2323
isLabelVisible = true,
2424
label,
@@ -28,7 +28,7 @@ export const SelectField = React.forwardRef<HTMLSelectElement, SelectFieldProps>
2828
required = false,
2929
size = 'medium',
3030
validationState,
31-
validationText = null,
31+
validationText,
3232
variant = 'outline',
3333
...restProps
3434
} = props;

src/components/Tabs/Tabs.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactNode } from 'react';
22

3-
export type TabsProps = {
3+
export type TabsProps = React.ComponentProps<'nav'> & {
44
/**
55
* Nested `TabsItem` elements.
66
*/

src/components/Tabs/TabsItem.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactNode } from 'react';
22

3-
export type TabsItemProps = {
3+
export type TabsItemProps = React.ComponentProps<'a'> & {
44
/**
55
* Optional element shown after item's label, e.g. an icon.
66
*/

src/components/TextArea/TextArea.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Validation,
77
} from '../../types';
88

9-
export type TextAreaProps = {
9+
export type TextAreaProps = React.ComponentProps<'textarea'> & {
1010
/**
1111
* If `true`, the input will be disabled.
1212
*/

src/components/Toolbar/Toolbar.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
Justify,
55
} from '../../types';
66

7-
export type ToolbarProps = {
7+
export type ToolbarProps = React.ComponentProps<'div'> & {
88
/**
99
* Vertical alignment of toolbar items and groups.
1010
*/

src/components/Toolbar/ToolbarGroup.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ReactNode } from 'react';
22
import { Align } from '../../types';
33

4-
export type ToolbarGroupProps = {
4+
export type ToolbarGroupProps = React.ComponentProps<'div'> & {
55
/**
66
* Vertical alignment of toolbar items in the group.
77
*/

0 commit comments

Comments
 (0)