-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add filtering prop tables by excluding or including #163
Conversation
…ers to getPropsTables
…opTables and includePropTables
packages/storybook-readme/src/services/getPropsTables/excludePropTable.js
Outdated
Show resolved
Hide resolved
packages/storybook-readme/src/services/getPropsTables/refinePropTables.js
Outdated
Show resolved
Hide resolved
packages/storybook-readme/src/services/getPropsTables/refinePropTables.js
Outdated
Show resolved
Hide resolved
LGFM Let's merge it? |
That sounds good. I will add more docs and examples little bit later |
@lonyele released at |
@archansel hm... what you are saying is that example-react at
If none of the above works, then can you show me the code where you use |
Both (master branch and my project) gave incorrect behavior Master Branch
I don't know whether My Project import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';
import { CheckboxInput } from '../index';
import CheckboxInputReadme from './CheckboxInput.readme.md';
/* eslint-disable react/prop-types */
const value = [{ value: 'option-2', label: 'My Option #2' }];
const options = [{ value: 'option-1', label: 'My Option #1' }, { value: 'option-2', label: 'My Option #2' }, { value: 'option-3', label: 'My Option #3' }];
const StoryComponent = ({ value: propValue, onChange: propOnChange, ...props }) => {
const [currentValue, setCurrentValue] = useState(propValue);
const onChange = values => {
setCurrentValue(values);
if (propOnChange) propOnChange(values);
};
return <CheckboxInput value={currentValue} onChange={onChange} {...props} />;
};
storiesOf('Forms|Input.CheckboxInput', module)
.addParameters({
readme: {
sidebar: CheckboxInputReadme,
},
})
.add('Default', () => <StoryComponent name="my-options" value={value} options={options} />)
.add('With Disabled State', () => <CheckboxInput name="my-options" value={value} options={options} disabled />); It has two stories .addParameters({
readme: {
sidebar: CheckboxInputReadme,
includePropTables: [CheckboxInput],
},
}) Originally, the So, as you can see (I hope its clearer now), in master branch, the incorrect behavior is PS: No warning in the console |
@archansel hm... first I tested this official repo's exmple-react on windows 10(chrome, firefox) and ubuntu 18.04(chrome, firefox) both cloning this repo and make up fresh CRA project with storybook-readme setting. From my laptop, everything works fine(I can't reproduce your case) @tuchk4 would you try reproduce this behaviour? or I'd like to see if anyone seeing this problem too.(yes! you... now reading this comment) My guesses are that
-> This part is the problem of general
-> This part is the same problem as above. From the beginning it is not showing the propTables, thus with
-> This is a correct behaviour. I have made some examples here(also covers your case) https://github.com/lonyele/storybook-readme-filtering-proptables-example
btw I may not be that responsive, it's still a weekday, so I don't have much time |
I know the problem here,
I think I got a better understanding of this feature. I thought
as for general |
@archansel hm... maybe... It was working fine for me. I maybe wrong but other examples( Anyway, If it's not a bug then It sounds good to me. I should probably finish additional things(more examples, docs) this weekend About the sorry for the confusion and I'll make explanation and usage more clear soon |
It's a wrap then 😄 Nice additional feature, by the way. Looking forward to the stable release |
closes Issue: #159
Hi, first I'm really sorry for being late on this new feature. I've been pretty ok before I said I would take this feature, but as soon as I take it I've got a lot of tasks from my work(magically) I'll try to be as responsive as possible, but I predict my heavy workload goes until next 1 or 2 weeks,
Basically, I've implemented as we talked at #159. I chose putting actual React components instead of string of React component names because something like
would not work with string of names. However if actual React component is used, its displayName and name can be tracked to its real value.
Please take a look and give me some feedbacks. Aside from code reviews, I think more can be added after the main logic is acceptable(adding more examples, Docs, examples on Vue etc...)