Skip to content

Commit

Permalink
more unmucking
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker committed Aug 18, 2023
1 parent c4bff1d commit c5d21c6
Show file tree
Hide file tree
Showing 13 changed files with 2,148 additions and 2,570 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/components/FieldWrap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ const FieldWrap = React.forwardRef<HTMLElement, Props>(

FieldWrap.displayName = 'FieldWrap';
FieldWrap.propTypes = {
// @ts-expect-error
children: PropTypes.node.isRequired,
className: PropTypes.string,
as: PropTypes.string
as: PropTypes.string,
};

export default FieldWrap;
7 changes: 3 additions & 4 deletions packages/react/src/components/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, {
forwardRef,
useImperativeHandle,
MutableRefObject,
HTMLProps
HTMLProps,
} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
Expand Down Expand Up @@ -82,7 +82,7 @@ const IconButton = forwardRef(
IconButton: true,
'IconButton--primary': variant === 'primary',
'IconButton--secondary': variant === 'secondary',
'IconButton--error': variant === 'error'
'IconButton--error': variant === 'error',
})}
ref={internalRef}
disabled={disabled}
Expand Down Expand Up @@ -115,15 +115,14 @@ IconButton.propTypes = {
as: PropTypes.elementType,
// @ts-expect-error
icon: PropTypes.string.isRequired,
// @ts-expect-error
label: PropTypes.node.isRequired,
// @ts-expect-error
tooltipPlacement: PropTypes.string,
// @ts-expect-error
tooltipVariant: PropTypes.string,
tooltipPortal: PropTypes.any,
// @ts-expect-error
variant: PropTypes.string
variant: PropTypes.string,
};

IconButton.displayName = 'IconButton';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Listbox/ListboxOption.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { forwardRef, useEffect, useCallback } from 'react';
import classnames from 'classnames';
import { useId } from 'react-id-generator';
import { useListboxContext } from './';
import { useListboxContext } from './ListboxContext';
import useSharedRef from '../../utils/useSharedRef';

export type ListboxValue = Readonly<string | number | undefined>;
Expand Down
7 changes: 3 additions & 4 deletions packages/react/src/components/LoaderOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ const LoaderOverlay = forwardRef<HTMLDivElement, LoaderOverlayProps>(
const wrapperProps = focusTrap
? {
focusTrapOptions: {
fallbackFocus: '.Loader__overlay'
}
fallbackFocus: '.Loader__overlay',
},
}
: {};

Expand Down Expand Up @@ -98,8 +98,7 @@ LoaderOverlay.propTypes = {
variant: PropTypes.oneOf(['large', 'small']),
label: PropTypes.string,
focusOnInitialRender: PropTypes.bool,
// @ts-expect-error
children: PropTypes.node
children: PropTypes.node,
};

LoaderOverlay.displayName = 'LoaderOverlay';
Expand Down
9 changes: 4 additions & 5 deletions packages/react/src/components/Notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ContentNode } from '../../types';
const iconTypeMap = {
caution: 'caution',
danger: 'caution',
info: 'info-circle'
info: 'info-circle',
};

export interface NoticeProps
Expand All @@ -26,7 +26,7 @@ const Notice = forwardRef<HTMLDivElement, NoticeProps>(
return (
<div
className={classNames('Notice', {
[`Notice--${type}`]: type
[`Notice--${type}`]: type,
})}
ref={ref}
{...otherProps}
Expand All @@ -43,17 +43,16 @@ const Notice = forwardRef<HTMLDivElement, NoticeProps>(

Notice.displayName = 'Notice';
Notice.propTypes = {
// @ts-expect-error
children: PropTypes.node,
type: PropTypes.oneOf(['caution', 'info', 'danger']),
// @ts-expect-error
title: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.element
PropTypes.element,
]),
// @ts-expect-error
icon: PropTypes.string
icon: PropTypes.string,
};

export default Notice;
5 changes: 2 additions & 3 deletions packages/react/src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Panel = forwardRef<HTMLElement, PanelProps>(
aria-labelledby={headingId}
className={classNames('Panel', className, {
['Panel--collapsed']: collapsed,
['Panel--no-padding']: !padding
['Panel--no-padding']: !padding,
})}
ref={ref}
{...other}
Expand All @@ -77,13 +77,12 @@ const Panel = forwardRef<HTMLElement, PanelProps>(

Panel.displayName = 'Panel';
Panel.propTypes = {
// @ts-expect-error
children: PropTypes.node.isRequired,
// @ts-expect-error
heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]),
className: PropTypes.string,
padding: PropTypes.bool,
collapsed: PropTypes.bool
collapsed: PropTypes.bool,
};

export default Panel;
5 changes: 2 additions & 3 deletions packages/react/src/components/Panel/PanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PanelContent = forwardRef<HTMLDivElement, PanelContentProps>(
return (
<div
className={classNames('Panel__Content', className, {
['Panel__Content--no-padding']: !padding
['Panel__Content--no-padding']: !padding,
})}
ref={ref}
{...otherProps}
Expand All @@ -31,10 +31,9 @@ const PanelContent = forwardRef<HTMLDivElement, PanelContentProps>(
PanelContent.displayName = 'PanelContent';

PanelContent.propTypes = {
//@ts-expect-error
children: PropTypes.node.isRequired,
className: PropTypes.string,
padding: PropTypes.bool
padding: PropTypes.bool,
};

export default PanelContent;
3 changes: 1 addition & 2 deletions packages/react/src/components/Panel/PanelHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ const PanelHeader = forwardRef<HTMLDivElement, PanelHeaderProps>(
PanelHeader.displayName = 'PanelHeader';

PanelHeader.propTypes = {
//@ts-expect-error
children: PropTypes.node.isRequired,
className: PropTypes.string
className: PropTypes.string,
};

export default PanelHeader;
11 changes: 5 additions & 6 deletions packages/react/src/components/SideBar/SideBarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export interface SideBarItemProps extends React.HTMLAttributes<HTMLLIElement> {
autoClickLink?: boolean;
}

const SideBarItem: React.ComponentType<React.PropsWithChildren<
SideBarItemProps
>> = ({ children, autoClickLink, ...other }) => {
const SideBarItem: React.ComponentType<
React.PropsWithChildren<SideBarItemProps>
> = ({ children, autoClickLink, ...other }) => {
const onClick = (e: React.MouseEvent<HTMLLIElement>) => {
if (!autoClickLink) {
return;
Expand All @@ -28,12 +28,11 @@ const SideBarItem: React.ComponentType<React.PropsWithChildren<

SideBarItem.displayName = 'SideBarItem';
SideBarItem.defaultProps = {
autoClickLink: true
autoClickLink: true,
};
SideBarItem.propTypes = {
// @ts-expect-error
children: PropTypes.node.isRequired,
autoClickLink: PropTypes.bool
autoClickLink: PropTypes.bool,
};

export default SideBarItem;
3 changes: 1 addition & 2 deletions packages/react/src/components/Tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ Tab.displayName = 'Tab';
Tab.propTypes = {
target: PropTypes.any.isRequired,
id: PropTypes.string,
// @ts-expect-error
children: PropTypes.node
children: PropTypes.node,
};

export default Tab;
3 changes: 1 addition & 2 deletions packages/react/src/components/Tabs/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(
TabPanel.displayName = 'TabPanel';
TabPanel.propTypes = {
id: PropTypes.string,
// @ts-expect-error
children: PropTypes.node,
className: PropTypes.string
className: PropTypes.string,
};

export default TabPanel;
9 changes: 4 additions & 5 deletions packages/react/src/components/TopBar/TopBarTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ interface TopBarTriggerProps extends React.HTMLAttributes<HTMLLIElement> {
children: React.ReactNode;
}

const TopBarTrigger: React.ComponentType<React.PropsWithChildren<
TopBarTriggerProps
>> = ({ children, className, ...other }) => (
const TopBarTrigger: React.ComponentType<
React.PropsWithChildren<TopBarTriggerProps>
> = ({ children, className, ...other }) => (
<MenuItem
aria-haspopup="true"
className={classNames('TopBar__menu-trigger', className)}
Expand All @@ -20,9 +20,8 @@ const TopBarTrigger: React.ComponentType<React.PropsWithChildren<
);
TopBarTrigger.displayName = 'TopBarTrigger';
TopBarTrigger.propTypes = {
// @ts-expect-error
children: PropTypes.node.isRequired,
className: PropTypes.string
className: PropTypes.string,
};

export default TopBarTrigger;
Loading

0 comments on commit c5d21c6

Please sign in to comment.