woocommerce/plugins/woocommerce-blocks/assets/js/components
Rua Haszard 7f44458418 Basic storybook implementation (https://github.com/woocommerce/woocommerce-blocks/pull/1636)
* install & configure storybook (via magic npx script)

* fix indentation in storybook generated files

* eslint ignore generated storybook files (for now at least)

* unhide storybook folder, consistent with Gutenberg project

* demo story for one of our components (with no css/styles)

* hack in scss webpack config & add story for button:
- fixes scss imports breaking storybook build
- note scss / styling doesn't work yet
+ organise our component stories into folder

* git ignore storybook-static build folder

* pin dependencies for storybook

* piggy-back off main webpack config for storybook module.rules (for scss)

* use gutenberg (wp-components) styles in storybook

* use system font for storybook, consistent with wp-admin/gberg and reasonable default for components in front end

* add --ci flag to prevent storybook opening new browser tab…
- see also https://github.com/storybookjs/storybook/issues/6201

* rename default stories to Default (following Gutenberg pattern)

* add story for ErrorPlaceholder

* failing ProductPreview story (committing to PR as an example for discussion)

* storybook for components/icons

* fix aliased dependencies in components for storybook:
append our webpack aliases to storybook webpack config

* basic story for PriceSlider (looks right but interaction broken)

* fix PriceSlider user interaction:
- PriceSlider expects client to handle onChange and pass in new min/max

* add comment about priceslider max/min (todoish)

* remove default stories from storybook scaffolding

* organise stories by module (aka folder in codebase)

* package-lock update after rebase

* remove unnecessary ignores (default stories are gone)

* delete experimental/risky/broken stories:
- icons components are changing in woocommerce/woocommerce-blocks#1644
- we need to refactor/do more work to get ProductPreview working (settings globals)

* remove unnecessary import

* clarify PriceSlider component intended usage comment in story

* remove redundant wrapper divs from stories

* add common storybook addons (used by Gutenberg storybook)

* rebuild package.lock after rebase

* remove unnecessary wrapper div

* package fixes after rebase

* add configuration for storybook source loader

* add decorators for a11y and knobs plugins

* remove unnecessary react import & import useState from WP

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-01-31 09:59:14 +13:00
..
block-title Fix wrong proptypes definition in BlockTitle component (https://github.com/woocommerce/woocommerce-blocks/pull/1259) 2019-11-26 12:16:28 +01:00
error-placeholder Basic storybook implementation (https://github.com/woocommerce/woocommerce-blocks/pull/1636) 2020-01-31 09:59:14 +13:00
grid-content-control Reformat files with new tabwidth (https://github.com/woocommerce/woocommerce-blocks/pull/953) 2019-09-09 12:52:48 +02:00
grid-layout-control Rename the "Align Buttons" option for the All Products Block (https://github.com/woocommerce/woocommerce-blocks/pull/1659) 2020-01-29 10:28:40 +00:00
heading-toolbar Remove h1 from atomic title (https://github.com/woocommerce/woocommerce-blocks/pull/1167) 2019-11-14 14:26:35 +01:00
icons UI for removing cart items (not including hooking up to API) (https://github.com/woocommerce/woocommerce-blocks/pull/1579) 2020-01-17 13:46:56 +00:00
product-attribute-term-control Filter all products block by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/1127) 2019-11-11 10:32:56 +00:00
product-category-control Show number of reviews in each category in Reviews per Category block (https://github.com/woocommerce/woocommerce-blocks/pull/1177) 2019-11-19 16:22:16 +01:00
product-control Update dependencies order (https://github.com/woocommerce/woocommerce-blocks/pull/1146) 2019-11-08 17:30:11 +01:00
product-orderby-control Reformat files with new tabwidth (https://github.com/woocommerce/woocommerce-blocks/pull/953) 2019-09-09 12:52:48 +02:00
product-preview Install prettier and reformat files (https://github.com/woocommerce/woocommerce-blocks/pull/945) 2019-09-05 17:09:31 +02:00
product-tag-control Reformat files with new tabwidth (https://github.com/woocommerce/woocommerce-blocks/pull/953) 2019-09-09 12:52:48 +02:00
products-control Update dependencies order (https://github.com/woocommerce/woocommerce-blocks/pull/1146) 2019-11-08 17:30:11 +01:00
text-toolbar-button Cart block: line-items front end initial work (https://github.com/woocommerce/woocommerce-blocks/pull/1333) 2020-01-10 11:50:14 +13:00
toggle-button-control Update dependencies order (https://github.com/woocommerce/woocommerce-blocks/pull/1146) 2019-11-08 17:30:11 +01:00
utils Update NPM dependencies and script dependency handling (https://github.com/woocommerce/woocommerce-blocks/pull/1337) 2019-12-10 12:17:46 -05:00
view-switcher Introduce view switcher component for the cart block (https://github.com/woocommerce/woocommerce-blocks/pull/1576) 2020-01-16 14:50:48 +00:00
README.md introduce block title component (https://github.com/woocommerce/woocommerce-blocks/pull/1240) 2019-11-21 18:21:14 +01:00

README.md

Components

These are shared components used by the blocks. If there's a component that is more universally useful, it should go into @woocommerce/components these components are specific to the Gutenberg context.

The *-control components here are designed to exist in the InspectorControls sidebar, or in a Placeholder component for the "edit state" of a block.

GridContentControl

A combination of toggle controls for content visibility in product grids.

GridLayoutControl

A combination of range controls for product grid layout settings.

ProductOrderbyControl

A pre-configured SelectControl for product orderby settings.

ProductPreview

Display a preview for a given product.

ProductAttributeTermControl

A component using SearchListControl to show product attributes as selectable options. Only allows for selecting attribute terms from one attribute at a time (multiple terms can be selected).

ProductCategoryControl

A component using SearchListControl to show product categories as selectable options. Options are displayed in hierarchy. Can select multiple categories.

ProductControl

A component using SearchListControl to show products as selectable options. Only one product can be selected at a time.

ProductsControl

A component using SearchListControl to show products as selectable options. Multiple products can be selected at once.

Icons

These are a collection of custom icons used by the blocks or components, usually from Material.

Utilities

There are some functions that work across components, these have been extracted into this utilities folder.

Block Title

A block that is responsible for showing the title for some of our blocks.