storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.98k stars 9.23k forks source link

Styled component props not showing using typescript and styled-system #14482

Closed ebellumat closed 1 year ago

ebellumat commented 3 years ago

Describe the bug The props in docs are not loaded correctly using @emotion/native and styled-system image

To Reproduce Component:

import styled from '@emotion/native';
import { color, space, margin, padding, position, flexbox, width, 
  SpaceProps, ColorProps, FlexboxProps, PositionProps } from "styled-system";
import { theme } from '../../themes';
import { View } from 'react-native';

export type BoxProps = FlexboxProps<typeof theme> & 
                       SpaceProps<typeof theme> &
                       PositionProps<typeof theme> &
                       ColorProps<typeof theme>;

export const Box = styled(View)<BoxProps>`
  ${color}
  ${space}
  ${margin}
  ${padding}
  ${width}
  ${flexbox}
  ${position}
`

Story MDX:

import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
import { View } from 'react-native';

import { Box } from './Box';
import { Typography } from '../Typography';

<Meta title="UI/Box" component={Box} />

# Box

Base building component.

## Props

<Props of={Box} />

Expected behavior The expected behaviour its generate the docs correctly, like this.

image

Screenshots image

Code snippets If applicable, add code samples to help explain your problem.

System Environment Info:

System: OS: macOS 10.15.7 CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz Binaries: Node: 15.8.0 - ~/.nvm/versions/node/v15.8.0/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.5.1 - ~/.nvm/versions/node/v15.8.0/bin/npm Browsers: Chrome: 89.0.4389.114 Firefox: 84.0.2 Safari: 13.1.3 npmPackages: @storybook/addon-essentials: ^6.2.2 => 6.2.2 @storybook/addon-links: 6.2.2 => 6.2.2 @storybook/react: 6.2.2 => 6.2.2

Additional context Add any other context about the problem here.

kimyvgy commented 1 year ago

Same issue.

ndelangen commented 1 year ago

I'm pretty sure this is fixed in 7.0 beta.

Could you check?