docs(ComponentPlayground): add playground to docs#1082
Conversation
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #1082 +/- ##
=======================================
Coverage 81.94% 81.94%
=======================================
Files 702 702
Lines 8580 8580
Branches 1245 1172 -73
=======================================
Hits 7031 7031
Misses 1534 1534
Partials 15 15Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1082 +/- ##
=======================================
Coverage 83.21% 83.21%
=======================================
Files 751 751
Lines 8881 8881
Branches 1192 1260 +68
=======================================
Hits 7390 7390
Misses 1477 1477
Partials 14 14Continue to review full report at Codecov.
|
…thub.com/stardust-ui/react into docs/component-playground # Conflicts: # package.json # yarn.lock
| > | ||
| {props.values && | ||
| props.values.map(option => ( | ||
| <option key={option} value={option}> |
There was a problem hiding this comment.
Have you considered using <Dropdown>?
There was a problem hiding this comment.
These components are part of docs-component package which should be consumable even without Stardust.
I am going to add mapping with our components in a separate PR.
Playground
Inspired by BluePrint JS docs.
New knobs
There cool knobs are powered by Context and hooks, it means that we will be to replace old knobs with them and get:
Heavily inspired by Retoggle.
They are implemented in
@stardust-ui/docs-componentsand will start our work for shared docs experience 🚀 I'm going to move editor and snippet components there, it will allow us to reduce dependencies on rootpackage.json, too.They use less dependencies as possible, to they are independent from Fela or Stardust.
How to implement new playground?
Actually, each playground is a simple functional component with knobs, so just create a new
Playground.tsxfile in examples directory and it will work like a 💎docs/src/examples/components/Header/Playground.tsxThis solution is temporary, in the future we are going to generate playgrounds in automated mode. But, we should start with something 🐎
Next steps
CodeSnippets copy-pastable, generated JSX should be also exportable to CodeSandbox