Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying Full Source Code #3851

Closed
acruigrok opened this issue Jul 6, 2018 · 3 comments
Closed

Displaying Full Source Code #3851

acruigrok opened this issue Jul 6, 2018 · 3 comments

Comments

@acruigrok
Copy link

I'm currently trying to build a UI Library that's built on top of Material-Ui V1. I want our developers to be able to reference the component code from Storybook.

This is an example of what I'd like to be able to see in Storybook (the full component file with dependencies):

import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';

function PrimaryButton(props) {
  const { classes } = props;
  return (
    <Button
      variant="contained"
    >
      Primary Button
  </Button>
  );
}

PrimaryButton.propTypes = {
  classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(PrimaryButton);

I've implemented @storybook/addon-storysource and @storybook/addon-info. They are great features, but they don't work for our use-case. They can't see past the Material-UI layer, and if it did it would only be the part of the component that's rendered.

This is the output from addon-info:

<div style={{textAlign: 'center'}}>
  <WithStyles(PrimaryButton)/>
</div>

Are there any recommended ways of displaying the full source code? Thanks in advance for any guidance you can provide.

@igor-dv
Copy link
Member

igor-dv commented Jul 9, 2018

I am working on improvements to the addons-storysource (discussed in #3566), but have no ETA yet.

@stale stale bot added the inactive label Jul 30, 2018
@igor-dv igor-dv added the todo label Jul 30, 2018
@stale stale bot removed the inactive label Jul 30, 2018
@storybookjs storybookjs deleted a comment from stale bot Sep 17, 2018
@maciej-gurban
Copy link

I've run into similar issue. Is there any progress on this front?

@ndelangen
Copy link
Member

Let's concentrate the discussion here: #3566

@issue-sh issue-sh bot removed the todo label Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants