Skip to content

Commit 46322a8

Browse files
authored
fix: Deprecation warnings (#227)
* Remove textStyle prop usage * Remove textColor prop usage
1 parent e1f37d4 commit 46322a8

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

packages/fuselage-ui-kit/src/Section.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Fields = ({ fields, parser }) => (
3838
export const Section = ({ blockId, appId, text, fields, accessory, parser }) => <Block>
3939
<Grid>
4040
<Grid.Item>
41-
{text && <Box is='span' textStyle='p1' color='default'>{parser.text(text)}</Box>}
41+
{text && <Box is='span' fontScale='p1' color='default'>{parser.text(text)}</Box>}
4242
{fields && <Fields fields={fields} parser={parser} />}
4343
</Grid.Item>
4444
{ accessory && < Flex.Item grow={0}>

packages/fuselage-ui-kit/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class MessageParser extends UiKitParserMessage {
124124
ELEMENT_TYPES.PLAIN_TEXT,
125125
ELEMENT_TYPES.MARKDOWN,
126126
].includes(element.type) ? (
127-
<Box is='span' textStyle='c1' color='info'>
127+
<Box is='span' fontScale='c1' color='info'>
128128
{this.renderContext(element, BLOCK_CONTEXT.CONTEXT, this)}
129129
</Box>
130130
)

packages/fuselage/src/components/Chip/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const Chip = ({
2323
</Margins>}
2424
{children && <Flex.Item shrink={1}>
2525
<Margins all='x4'>
26-
<Box is='span' textStyle='p1' color='default' className='rcx-chip__text'>{children}</Box>
26+
<Box is='span' fontScale='p1' color='default' rcx-chip__text>{children}</Box>
2727
</Margins>
2828
</Flex.Item>}
2929
{Remove && (onClick || onMouseDown) && <Margins all='x4'>

packages/fuselage/src/components/Icon/stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Box, Hint, Icon } from '../..';
99
# Icon
1010

1111
<Story name='Default'>
12-
<Box color='default' textStyle='p1'>
12+
<Box color='default'>
1313
{Object.keys(namesToCharactersMapping).map((name) => <Icon key={name} name={name} size='x40' /> )}
1414
</Box>
1515
</Story>

packages/fuselage/src/components/Menu/stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const options = {
99
action: () => console.log('[...] is now admin'),
1010
},
1111
'delete': {
12-
label: <Box display='flex' alignItems='center' textColor='danger'><Icon mie='x4' name='trash' size='x16'/>Delete</Box>,
12+
label: <Box display='flex' alignItems='center' color='danger'><Icon mie='x4' name='trash' size='x16'/>Delete</Box>,
1313
action: () => console.log('[...] no longer exists'),
1414
}
1515
}

packages/fuselage/src/components/Modal/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const ModalThumb = (props) => <Avatar size='x32' {...props} />;
3939

4040
export const ModalTitle = ({ children, ...props }) =>
4141
<Flex.Item grow={1} shrink={1}>
42-
<Box rcx-modal__title color='default' textStyle='h1' {...props}>
42+
<Box rcx-modal__title color='default' fontScale='h1' {...props}>
4343
{children}
4444
</Box>
4545
</Flex.Item>;

packages/fuselage/src/components/Options/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ const Li = forwardRef(function Li(props, ref) {
2525
return <Box is='li' rcx-option ref={ref} {...props} />;
2626
});
2727

28-
export const Empty = React.memo(() => <Box is='span' textStyle='p1' color='hint'>Empty</Box>);
28+
export const Empty = React.memo(() => <Box is='span' fontScale='p1' color='hint'>Empty</Box>);
2929

3030
export const Option = React.memo(({ id, children: label, focus, selected, ...options }) => <Li key={id} rcx-option--focus={focus} id={id} rcx-option--selected={selected} aria-selected={selected} {...options}>{label}</Li>);
3131

32-
export const CheckOption = React.memo(({ id, children: label, focus, selected, ...options }) => <Li key={id} rcx-option--focus={focus} id={id} aria-selected={selected} {...options}><Margins inline='x4'><CheckBox checked={selected} /></Margins><Margins inline='x4'><Box is='span' textStyle='p1' color='default'>{label}</Box></Margins></Li>);
32+
export const CheckOption = React.memo(({ id, children: label, focus, selected, ...options }) => <Li key={id} rcx-option--focus={focus} id={id} aria-selected={selected} {...options}><Margins inline='x4'><CheckBox checked={selected} /></Margins><Margins inline='x4'><Box is='span' fontScale='p1' color='default'>{label}</Box></Margins></Li>);
3333

3434
export const OptionAvatar = React.memo(({ id, value, children: label, focus, selected, ...options }) => (
3535
<Flex.Container>
3636
<Li key={id} rcx-option--focus={focus} id={id} rcx-option--selected={selected} aria-selected={selected} {...options}>
3737
<Margins inline='x4'><Avatar size='x20' url={value} tile={label}/></Margins>
38-
<Margins inline='x4'><Box is='span' textStyle='p1' color='default'>{label}</Box></Margins>
38+
<Margins inline='x4'><Box is='span' fontScale='p1' color='default'>{label}</Box></Margins>
3939
</Li>
4040
</Flex.Container>
4141
));

packages/fuselage/src/components/Select/Select.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Addon = forwardRef((props, ref) => <Box is='div' rcx-select__addon
99

1010
const Wrapper = forwardRef((props, ref) => <Box is='div' rcx-select__wrapper ref={ref} {...props} />);
1111

12-
export const Focus = React.forwardRef((props, ref) => <Box ref={ref} textStyle='p2' color='hint' rcx-select__focus is='button' type='button' {...props}/>);
12+
export const Focus = React.forwardRef((props, ref) => <Box ref={ref} fontScale='p2' color='hint' rcx-select__focus is='button' type='button' {...props}/>);
1313

1414
export const Select = ({
1515
value,
@@ -80,7 +80,7 @@ export const Select = ({
8080
<Wrapper rcx-select__wrapper--hidden={!!visibleText}>
8181
{ visibleText && <Flex.Item grow={1} shrink={1}>
8282
<Margins inline='x4'>
83-
<Box is='span' rcx-select__item textStyle='p2' color={valueLabel ? 'default' : 'hint'}>{visibleText}</Box>
83+
<Box is='span' rcx-select__item fontScale='p2' color={valueLabel ? 'default' : 'hint'}>{visibleText}</Box>
8484
</Margins>
8585
</Flex.Item>}
8686
<Anchor disabled={disabled} rcx-input-box--undecorated filter={filter} ref={ref} aria-haspopup='listbox' onClick={show} onBlur={hide} onKeyUp={handleKeyUp} onKeyDown={handleKeyDown} />

packages/fuselage/src/components/Table/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const style = {
1010

1111
export function Selection({ children, text, ...props }) {
1212
return <Box color='alternative' rcx-table__selection display='flex' alignItems='center' justifyContent='space-between' {...props} pi='x24'>
13-
<Box textStyle='p2' mb='x16' flexShrink={1} style={style}>{text}</Box>
14-
{ children && <Box mi='neg-x8' textStyle='p2' flexShrink={0} ><Margins inline='x4'>{children}</Margins></Box> }
13+
<Box fontScale='p2' mb='x16' flexShrink={1} style={style}>{text}</Box>
14+
{ children && <Box mi='neg-x8' fontScale='p2' flexShrink={0} ><Margins inline='x4'>{children}</Margins></Box> }
1515
</Box>;
1616
}
1717

0 commit comments

Comments
 (0)