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

Publish under @componentdriven and update README #8

Merged
merged 3 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
# Storybook Component Story Format (CSF)
<img src="https://raw.githubusercontent.com/ComponentDriven/csf/polish-readme/csf-header.png" width="321px" />

A minimal set of utility functions for dealing with Storybook [Component Story Format (CSF)](https://storybook.js.org/docs/formats/component-story-format/).
# Component Story Format (CSF)

## Install
### Why a standard format?
Components have risen to dominate the UI landscape. There are new component-oriented tools for development, testing, design, and prototyping. These tools engage in the creation and consumption of components and component examples (a.k.a. stories). But each tool has its own proprietary format because a simple, platform-agnostic way to express component examples doesn't yet exist.

### The "Story" is the source of truth for a component.
A story is a code snippet that renders an example of a component in a specific state. Think about it like a "[user story](https://en.wikipedia.org/wiki/User_story)".

It uses the production code shipped to users, making it the most accurate representation of a component example. What's more, stories are expressed in the view layer you use to build your app.


### Component Story Format
The Component Story Format is an open standard for component examples based on JavaScript ES6 modules. This enables interoperation between development, testing, and design tools.

```js
export default { title: 'atoms/Button' };
export const text = () => <Button>Hello</Button>;
export const emoji = () => <Button>😀😎👍💯</Button>;
```

💎 **Simple.** Writing component "stories" is as easy as exporting ES6 functions using a clean, widely-used format.

🚚 **Non-proprietary.** CSF doesn't require any vendor-specific libraries. Component stories are easily consumed anywhere ES6 modules live, including your favourite testing tools like Jest and Cypress.

☝️ **Declarative.** The declarative syntax is isomorphic to higher-level formats like MDX, enabling clean, verifiable transformations.

🔥 **Optimized.** Component stories don't need any libraries other than your components. And because they're ES6 modules, they're even tree-shakeable!

### Who uses CSF?
domyen marked this conversation as resolved.
Show resolved Hide resolved

winkerVSbecks marked this conversation as resolved.
Show resolved Hide resolved
**Tools:** [Storybook](https://storybook.js.org), [UXPin](https://www.uxpin.com) & [WebComponents.dev](https://webcomponents.dev)

**Compatible with:** [Jest](https://jestjs.io/), [Enzyme](https://enzymejs.github.io/enzyme), [Testing Library](https://testing-library.com), [Cypress](https://www.cypress.io/), [Mocha](https://mochajs.org), etc.


## CSF utilities

A minimal set of utility functions for dealing with [Component Story Format (CSF)](https://storybook.js.org/docs/formats/component-story-format/).


### Install

```sh
yarn add @storybook/csf
yarn add @componentdriven/csf
```

## API
### API

See package source for function definitions and types:

Expand Down
Binary file added csf-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@storybook/csf",
"name": "@componentdriven/csf",
"version": "0.0.2-alpha.0",
"description": "Storybook Component Story Format (CSF) utilities",
"description": "Component Story Format (CSF) utilities",
"keywords": [
"storybook",
"component story format",
"csf",
"stories"
],
"homepage": "https://github.com/storybookjs/csf",
"homepage": "https://github.com/ComponentDriven/csf",
"bugs": {
"url": "https://github.com/storybookjs/csf/issues"
"url": "https://github.com/ComponentDriven/csf/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/csf.git"
"url": "https://github.com/ComponentDriven/csf.git"
},
"license": "MIT",
"files": [
Expand Down Expand Up @@ -62,4 +62,4 @@
"publishConfig": {
"access": "public"
}
}
}