GithubHelp home page GithubHelp logo

dutscher / stencil-storybook Goto Github PK

View Code? Open in Web Editor NEW
71.0 8.0 14.0 5.23 MB

Storybook meets Stencil in 2021

Home Page: https://dutscher.github.io/stencil-storybook

License: MIT License

JavaScript 26.14% HTML 2.64% TypeScript 60.10% SCSS 11.11%
stencil storybook hmr

stencil-storybook's People

Contributors

dutscher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stencil-storybook's Issues

HMR css/scss variables

Hey,
First of all thanks for the great setup.

I'm having issues with HMR and changing the scss variables.
For example changing the $color-primary, the change doesn't affect the component in storybook. Even reloading doesn't help and only after restarting the storybook/stencil combo the change is visible. I did also try this with CSS variables in _variables.scss file (did not work) or in init.scss (showed up in component after refresh). So my guess is it has something to do with the sass plugin and injectGlobalPaths.

I did try to follow how it all works but couldn't figure it out past where Stencil Dev Server Connector 2.0.3 gets injected into the storybook html.
Any idea how to get HRM working for CSS/SCSS variables?

Cheers

Multiple dists

Hi :)

Less of an ‘issue’ and more of a question. I was wondering if you had any suggestions on creating multiple dists. I have some ‘extra’ components that i’ve made specifically to have as a sandbox area on storybook, so I want them in the dist for the storybook build, but I don’t want them in the dist-stencil that I am publishing on the npm package. Was wondering if you had any ideas or suggestions.

Thank you

Allow more flexibility with Props for stencil.stories generation

The stencil-to-storybook generation is restrictive and requires the following criteria in order to generate stencil-stories.ts with all the props added:

Props must have jsdoc comments
The comments must be on one line
The prop names must be lowercase

Is there a reason for this or can I submit a PR to allow scenarios like this:

/**
 * Specify size limit in Kb
 * */
@Prop() maxFileSize

and also for props with no comments.

Are they any plans with licensing?

Not sure if any contributors are still active but found this to be a cool project and I was wondering if there were any plans on adding a license. Would be nice to play with but cannot find any license on the repo and this [https://opensource.stackexchange.com/questions/1720/what-can-i-assume-if-a-publicly-published-project-has-no-license] says I'm only really allowed to look, which scares me off a bit. Is this done purposely or are there plans to add an open-source license?

Thanks for the time!

Does it work with latest Stencil v1?

Hello @dutscher and thank you so much for creating this package! ❤️

I see that it supports Stencil v2 but our organization can't quite move to v2 just yet, so we're on the latest version of v1. Would this package work with the latest v1?

Thanks for any information.

Can't resolve components in my project

Hi there,

First of all, thanks a lot for this setup. It's great!

I am running into a problem where my components can't be resolved when I try to import them in my ionic project.

Some more info:

  • I am building my Stencil project with yarn build:stencil
  • I ran yarn link in my Stencil project
  • I ran yarn link <project-name> in my ionic vue project
  • I am importing the web component with
import { MyComponent } from "<project-name>"

When I load the page, I see the following error in the console: Failed to resolve component: MyComponent

Am I missing something here

Creating Storybook stories in combination with slots

In the example story there is a section about slots that I don't quite understand:

export const Slots = setupComposition(
  `<slot's />`,
  () => h`
  ${['Slot eins', 'Slot dva'].map((slot) => h`${Story.tplComposition({ slot })}<br>`)}
`,
);

I've played around with it but I don't seem to be able to get it working. The first parameter is supposed to be the name of slot you want to use? Any elaboration would be greatly appreciated.

My component:

<Host
  onClick={this.handleClick}
>
  <TagType
    {...attributes}
    class={this.buttonClasses}
    disabled={disabled}
    onFocus={this.onFocus}
    onBlur={this.onBlur}
    {...inheritedAttributes}
  >
    <slot name="left" />
    <slot name="label">
      <span>{label}</span>
    </slot>
    <slot name="right" />
  </TagType>
</Host>

What would I have to pass to setupComposition in order to render some lit-html in the left slot?

chromatic setup

Thanks for this - we're using it for our project.
Having an issue with chromatic though, in that the stencil [app].esm.js and css files are not in dist-storybook
Locally the proxy.js works to replace those urls, but on chromatic we get 404s
We're looking into it but want to ask here to see if this should work and if we're missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.