mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
fix type issues
This commit is contained in:
parent
66ea114db3
commit
dad7a7a0ff
@ -42,13 +42,13 @@ const getFilter = (filterName: string) => {
|
||||
return `url('#${filterName}')`;
|
||||
};
|
||||
|
||||
const Hidden = styled.div(() => ({
|
||||
const Hidden = styled.div({
|
||||
'&, & svg': {
|
||||
position: 'absolute',
|
||||
width: 0,
|
||||
height: 0,
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
const ColorIcon = styled.span<{ filter: string }>(
|
||||
{
|
||||
|
@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
|
||||
import { MethodCall } from './MethodCall';
|
||||
import { StatusIcon } from './StatusIcon';
|
||||
|
||||
const MethodCallWrapper = styled.div(() => ({
|
||||
const MethodCallWrapper = styled.div({
|
||||
fontFamily: typography.fonts.mono,
|
||||
fontSize: typography.size.s1,
|
||||
overflowWrap: 'break-word',
|
||||
inlineSize: 'calc( 100% - 40px )',
|
||||
}));
|
||||
});
|
||||
|
||||
const RowContainer = styled('div', {
|
||||
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { styled } from 'storybook/internal/theming';
|
||||
|
||||
export const ListWrapper = styled.ul(() => ({
|
||||
export const ListWrapper = styled.ul({
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
rowGap: 16,
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
}));
|
||||
});
|
||||
|
@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
|
||||
import { MethodCall } from './MethodCall';
|
||||
import { StatusIcon } from './StatusIcon';
|
||||
|
||||
const MethodCallWrapper = styled.div(() => ({
|
||||
const MethodCallWrapper = styled.div({
|
||||
fontFamily: typography.fonts.mono,
|
||||
fontSize: typography.size.s1,
|
||||
overflowWrap: 'break-word',
|
||||
inlineSize: 'calc( 100% - 40px )',
|
||||
}));
|
||||
});
|
||||
|
||||
const RowContainer = styled('div', {
|
||||
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),
|
||||
|
@ -355,7 +355,8 @@ export const TestProviderRender: FC<
|
||||
icon={
|
||||
state.crashed ? (
|
||||
<TestStatusIcon status="critical" aria-label="status: crashed" />
|
||||
) : status === 'unknown' ? (
|
||||
) : // @ts-expect-error @ghengeveld should check whether this is a bug or not
|
||||
status === 'unknown' ? (
|
||||
<TestStatusIcon status="unknown" aria-label="status: unknown" />
|
||||
) : (
|
||||
<TestStatusIcon status={statusMap[status]} aria-label={`status: ${status}`} />
|
||||
|
@ -74,10 +74,10 @@ const flip = ({ width, height, ...styles }: ViewportStyles) => ({
|
||||
width: height,
|
||||
});
|
||||
|
||||
const ActiveViewportSize = styled.div(() => ({
|
||||
const ActiveViewportSize = styled.div({
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
}));
|
||||
});
|
||||
|
||||
const ActiveViewportLabel = styled.div(({ theme }) => ({
|
||||
display: 'inline-block',
|
||||
|
@ -7,10 +7,10 @@ import { BrowserIcon, MobileIcon, TabletIcon } from '@storybook/icons';
|
||||
|
||||
import type { Viewport, ViewportMap } from './types';
|
||||
|
||||
export const ActiveViewportSize = styled.div(() => ({
|
||||
export const ActiveViewportSize = styled.div({
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
}));
|
||||
});
|
||||
|
||||
export const ActiveViewportLabel = styled.div(({ theme }) => ({
|
||||
display: 'inline-block',
|
||||
|
@ -140,11 +140,11 @@ const IconPlaceholder = styled.div(({ theme }) => ({
|
||||
animation: `${theme.animation.glow} 1.5s ease-in-out infinite`,
|
||||
}));
|
||||
|
||||
const IconButtonSkeletonWrapper = styled.div(() => ({
|
||||
const IconButtonSkeletonWrapper = styled.div({
|
||||
marginTop: 6,
|
||||
padding: 7,
|
||||
height: 28,
|
||||
}));
|
||||
});
|
||||
|
||||
/** @deprecated This component will be removed in Storybook 9.0 */
|
||||
export const IconButtonSkeleton = () => (
|
||||
|
@ -93,7 +93,7 @@ const NotificationWithInteractiveStates = styled(Notification)({
|
||||
const NotificationButton = NotificationWithInteractiveStates.withComponent('div');
|
||||
const NotificationLink = NotificationWithInteractiveStates.withComponent(Link);
|
||||
|
||||
const NotificationIconWrapper = styled.div(() => ({
|
||||
const NotificationIconWrapper = styled.div({
|
||||
display: 'flex',
|
||||
marginRight: 10,
|
||||
alignItems: 'center',
|
||||
@ -102,7 +102,7 @@ const NotificationIconWrapper = styled.div(() => ({
|
||||
width: 16,
|
||||
height: 16,
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
const NotificationTextWrapper = styled.div(({ theme }) => ({
|
||||
width: '100%',
|
||||
|
@ -74,9 +74,9 @@ const Subsection = styled.td(({ theme }) => ({
|
||||
background: theme.background.app,
|
||||
}));
|
||||
|
||||
const StyledTd = styled.td(() => ({
|
||||
const StyledTd = styled.td({
|
||||
position: 'relative',
|
||||
}));
|
||||
});
|
||||
|
||||
const StyledTr = styled.tr(({ theme }) => ({
|
||||
'&:hover > td': {
|
||||
@ -86,7 +86,7 @@ const StyledTr = styled.tr(({ theme }) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
const ClickIntercept = styled.button(() => ({
|
||||
const ClickIntercept = styled.button({
|
||||
// reset button style
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
@ -103,7 +103,7 @@ const ClickIntercept = styled.button(() => ({
|
||||
width: '100%',
|
||||
color: 'transparent',
|
||||
cursor: 'row-resize !important',
|
||||
}));
|
||||
});
|
||||
|
||||
export const SectionRow: FC<SectionRowProps> = ({
|
||||
level = 'section',
|
||||
|
Loading…
x
Reference in New Issue
Block a user