Skip to content

Commit

Permalink
Source code update
Browse files Browse the repository at this point in the history
  • Loading branch information
UberOpenSourceBot authored and Uber Buildkite committed Dec 7, 2022
1 parent a78234b commit 79f592c
Show file tree
Hide file tree
Showing 90 changed files with 57 additions and 315 deletions.
1 change: 0 additions & 1 deletion src/accordion/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export default class Accordion extends React.Component<AccordionProps, Accordion
const { Root: RootOverride } = overrides;
const [Root, rootProps] = getOverrides(RootOverride, StyledRoot);
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root
data-baseweb="accordion"
$disabled={this.props.disabled}
Expand Down
6 changes: 0 additions & 6 deletions src/accordion/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ const Panel = (
return (
<LocaleContext.Consumer>
{(locale) => (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<PanelContainer {...sharedProps} {...panelContainerProps}>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Header
tabIndex={0}
role="button"
Expand All @@ -191,15 +189,13 @@ const Panel = (
ref={ref}
>
{title}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<ToggleIcon
viewBox="0 0 24 24"
title={localState.expanded ? locale.accordion.collapse : locale.accordion.expand}
size={16}
{...toggleIconProps}
{...sharedProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<ToggleIconGroup {...sharedProps} {...toggleIconGroupProps}>
<path
fillRule="evenodd"
Expand All @@ -214,7 +210,6 @@ const Panel = (
/>
</ToggleIcon>
</Header>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<ContentAnimationContainer
{...sharedProps}
{...contentAnimationProps}
Expand All @@ -225,7 +220,6 @@ const Panel = (
}
}}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Content
ref={_animateRef}
{...sharedProps}
Expand Down
1 change: 0 additions & 1 deletion src/accordion/stateful-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import type { StatefulPanelProps } from './types';
export default function StatefulPanel(props: StatefulPanelProps) {
const { children, ...restProps } = props;
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<StatefulContainer {...restProps}>
{(componentProps) => <Panel {...componentProps}>{children}</Panel>}
</StatefulContainer>
Expand Down
1 change: 0 additions & 1 deletion src/accordion/stateless-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function StatelessAccordion({
const { Root: RootOverrides, ...PanelOverrides } = overrides;
const [Root, rootProps] = getOverrides(RootOverrides, StyledRoot);
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root data-baseweb="accordion" {...rootProps}>
{React.Children.map(children, (child, index) => {
let normalizedChild =
Expand Down
3 changes: 0 additions & 3 deletions src/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export default function Avatar({
const [Root, rootProps] = getOverrides(overrides.Root, StyledRoot);

return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root
aria-label={imageLoaded ? null : name}
role={imageLoaded ? null : 'img'}
Expand All @@ -74,10 +73,8 @@ export default function Avatar({
data-baseweb="avatar"
{...rootProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Avatar ref={imageRef} alt={name} $imageLoaded={imageLoaded} $size={size} {...avatarProps} />

{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
{!imageLoaded && <Initials {...initialsProps}>{initials || getInitials(name)}</Initials>}
</Root>
);
Expand Down
5 changes: 1 addition & 4 deletions src/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,23 @@ const Badge = ({
// If there's no anchor, render the badge inline
if (!anchor) {
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Badge $hierarchy={hierarchy} $shape={shape} $color={color} $hidden={hidden} {...badgeProps}>
{content}
</Badge>
);
}

return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root {...rootProps}>
{anchor}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

<Positioner
$horizontalOffset={horizontalOffset}
$verticalOffset={verticalOffset}
$placement={placement}
$role={ROLE.badge}
{...positionerProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Badge
$hierarchy={hierarchy}
$shape={shape}
Expand Down
4 changes: 1 addition & 3 deletions src/badge/hint-dot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ const HintDot = ({
}
}
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root {...rootProps}>
{anchor}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

<Positioner
$horizontalOffset={horizontalOffset}
$verticalOffset={verticalOffset}
$placement={theme.direction === 'rtl' ? PLACEMENT.topLeft : PLACEMENT.topRight}
$role={ROLE.hintDot}
{...positionerProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<HintDot
{...hintDotProps}
$color={color}
Expand Down
5 changes: 1 addition & 4 deletions src/badge/notification-circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,23 @@ const NotificationCircle = ({
// If there's no anchor, render the badge inline
if (!anchor) {
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<NotificationCircle $color={color} $hidden={hidden} {...NotificationCircleProps}>
{content}
</NotificationCircle>
);
}

return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root {...rootProps}>
{anchor}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

<Positioner
$horizontalOffset={horizontalOffset}
$verticalOffset={verticalOffset}
$placement={placement}
$role={ROLE.notificationCircle}
{...positionerProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<NotificationCircle {...NotificationCircleProps} $color={color} $hidden={hidden}>
{content}
</NotificationCircle>
Expand Down
10 changes: 1 addition & 9 deletions src/banner/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ function Trailing({ action, backgroundColor, color, overrides, nested }) {

if (action.icon) {
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<TrailingIconButton
aria-label={action.label}
onClick={action.onClick}
Expand All @@ -165,7 +164,6 @@ function Trailing({ action, backgroundColor, color, overrides, nested }) {

if (action.label) {
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<TrailingButtonContainer {...trailingButtonContainerProps}>
<Button
colors={{ backgroundColor, color }}
Expand Down Expand Up @@ -218,27 +216,22 @@ export function Banner({
const [Message, messageProps] = getOverrides(overrides.Message, StyledMessage);

return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root
$backgroundColor={styles.backgroundColor}
$color={styles.color}
$nested={nested}
{...rootProps}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<LeadingContent $includesArtwork={Boolean(artwork)} {...leadingContentProps}>
<Leading artwork={artwork} />
</LeadingContent>

{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<MessageContent $actionPosition={actionPosition} {...messageContentProps}>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
{Boolean(title) && <Title {...titleProps}>{title}</Title>}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

{Boolean(children) && <Message {...messageProps}>{children}</Message>}
</MessageContent>

{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<TrailingContent {...trailingContentProps}>
<Trailing
action={action}
Expand All @@ -249,7 +242,6 @@ export function Banner({
/>
</TrailingContent>

{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<BelowContent $actionPosition={actionPosition} {...belowContentProps}>
<Below
action={action}
Expand Down
1 change: 0 additions & 1 deletion src/block/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const Block: React.FC<
const [BaseBlock, baseBlockProps] = getOverrides(overrides.Block, StyledBlock);

return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<BaseBlock
// coerced to any because because of how react components are typed.
// cannot guarantee an html element
Expand Down
4 changes: 0 additions & 4 deletions src/breadcrumbs/breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ export function Breadcrumbs(props: BreadcrumbsProps) {
<ListItem key={`breadcrumb-item-${index}`} $itemIndex={index} {...baseListItemProps}>
{child}
{(showTrailingSeparator || index !== childrenArray.length - 1) && (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Separator {...baseSeparatorProps} key={`separator-${index}`}>
<ThemeContext.Consumer>
{(theme) =>
theme.direction === 'rtl' ? (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Left size={16} {...baseIconProps} />
) : (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Right size={16} {...baseIconProps} />
)
}
Expand All @@ -61,7 +58,6 @@ export function Breadcrumbs(props: BreadcrumbsProps) {
return (
<LocaleContext.Consumer>
{(locale) => (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root
aria-label={props['aria-label'] || props.ariaLabel || locale.breadcrumbs.ariaLabel}
data-baseweb="breadcrumbs"
Expand Down
1 change: 0 additions & 1 deletion src/button-group/button-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export default class ButtonGroup extends React.Component<ButtonGroupProps> {
return (
<LocaleContext.Consumer>
{(locale) => (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<Root
aria-label={ariaLabel || locale.buttongroup.ariaLabel}
data-baseweb="button-group"
Expand Down
1 change: 0 additions & 1 deletion src/button-group/stateful-button-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function StatefulButtonGroup(props: StatefulButtonGroupProps) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { children, initialState, ...restProps } = props;
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<StatefulContainer initialState={initialState} {...restProps}>
{({ ...containerProps }) => <ButtonGroup {...containerProps}>{props.children}</ButtonGroup>}
</StatefulContainer>
Expand Down
2 changes: 0 additions & 2 deletions src/button/button-internals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ export default function ButtonInternals(props: ButtonProps) {
return (
<React.Fragment>
{startEnhancer !== null && startEnhancer !== undefined && (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<StartEnhancer {...sharedProps} {...startEnhancerProps}>
<RenderEnhancer Enhancer={startEnhancer} />
</StartEnhancer>
)}
{children}
{endEnhancer !== null && endEnhancer !== undefined && (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<EndEnhancer {...sharedProps} {...endEnhancerProps}>
<RenderEnhancer Enhancer={endEnhancer} />
</EndEnhancer>
Expand Down
4 changes: 1 addition & 3 deletions src/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class Button extends React.Component<
$isFocusVisible: this.state.isFocusVisible,
};
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<BaseButton
ref={forwardedRef}
data-baseweb="button"
Expand Down Expand Up @@ -128,9 +127,8 @@ class Button extends React.Component<
<div style={{ opacity: 0, display: 'flex', height: '0px' }}>
<ButtonInternals {...this.props} />
</div>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

<LoadingSpinnerContainer {...sharedProps} {...loadingSpinnerContainerProps}>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<LoadingSpinner {...sharedProps} {...loadingSpinnerProps} />
</LoadingSpinnerContainer>
</React.Fragment>
Expand Down
1 change: 0 additions & 1 deletion src/checkbox/stateful-checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type { StatefulContainerChildProps, StatefulCheckboxProps } from './types

const StatefulCheckbox = function (props: StatefulCheckboxProps) {
return (
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete
<StatefulContainer {...props}>
{(childrenProps: StatefulContainerChildProps) => (
<Checkbox {...childrenProps}>{props.children}</Checkbox>
Expand Down
2 changes: 1 addition & 1 deletion src/data-table/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function Column<Value, FilterParams>(
/>
</span>
)}
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}

<ProvidedCell {...props} />
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/data-table/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ function CellPlacement({ columnIndex, rowIndex, data, style }: CellPlacementProp
style={style}
onMouseEnter={() => data.onRowMouseEnter(rowIndex, data.rows[rowIndex - 1])}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Cell
value={value}
onSelect={
Expand Down Expand Up @@ -579,7 +578,7 @@ const InnerTableElement = React.forwardRef<
).map((rowAction) => {
if (rowAction.renderButton) {
const RowActionButton = rowAction.renderButton;
// @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete

return <RowActionButton />;
}

Expand Down Expand Up @@ -609,7 +608,6 @@ const InnerTableElement = React.forwardRef<
},
}}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<RowActionIcon size={24} />
</Button>
);
Expand Down
1 change: 0 additions & 1 deletion src/data-table/stateful-data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ export function StatefulDataTable(props: StatefulDataTableProps) {
kind={BUTTON_KINDS.tertiary}
shape={BUTTON_SHAPES.round}
>
{/* @ts-ignore TS2786 error with web-eats-v2, can remove once React 18 migration complete */}
<Icon size={16} />
</Button>
);
Expand Down
Loading

0 comments on commit 79f592c

Please sign in to comment.