* Migrate Storybook to 6.4.0 and enable auto-detection of controls (https://github.com/woocommerce/woocommerce-blocks/pull/5249)
Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).
Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:
* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories
More context: https://github.com/storybookjs/storybook/issues/12292
* Use `react-docgen` only in development environments
This should reduce production bundle size dramatically. The only
problem here is that Storybook runs its `build` command with the
`NODE_ENV` set to `production`. For this reason, we change the
script to provide `BABEL_ENV` set to `development` to still make sure
the correct configuration is loaded, while trying to reduce any
side-effects on changing the whole `NODE_ENV`.
* Add global style for product categories list block woocommerce/woocommerce-blocks#4965
Add global style for product categories list block
* add support for link color
* add feature flag
* fix code style and PHP warning
* update doc comment
* remove empty space
* refactor StyleAttributesUtils (https://github.com/woocommerce/woocommerce-blocks/pull/5277)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Mini Cart Block: add link to edit template part from sidebar woocommerce/woocommerce-blocks#5186
Mini Cart Block: add link to edit template part from sidebar
* fix e2e tests
* Product details metadata now accepts as a default prop, with as an optional alternative
* Updated product details test snapshot
* Don't overwrite key prop
* One of key or value must be entered in ProductItemResponseData type
* Convert ReturnToCartButton component to TS
* Convert FormStep component to TS
* Remoe proptypes from FormStep and AddressFormn components
* Converted order-summary component to TS
* Convert product-price component to TS
* alias path to type-defs
* Fix errors
* Changes from Thomas feedback
* Change minPrice maxPrice logic to be more robust
* Changed types from inline to interface in ReturnToCartButton component
* Check for string type in order-summary-item
* add missing isString check
On the front-end, checkboxes with labels would look squished when the labels wrapped
on a second line. That was due to the flex container taking too much space for the label
as the checkbox minimum dimensions was set in `px` rather than `em`, making it work
differently depending on the relative font size.
* Fix Mini Cart block when Gutenberg is not enabled
* Escape Mini Cart template part
* Avoid creating $part variable
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Within the editor, the checkbox appeared aligned at the bottom of the paragraph, while
on the front-end it would appear aligned at the top. The alignment was actually correct
but a top margin was assigned to checkboxes in the backend.
Instead of removing that globally, this commit resets it for checkboxes within the checkout
block.
* Reference the WooCommerce DEWP instead of WPDEWP
* Apply suggestions from code review
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Format with decimal and thousands, with tests
* Update packages/prices/utils/price.ts
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Fix wrong event prefix in doc comment
* Make className prop in CartLineItemsTableProps optional
* Mini Cart as template part
* Remove BlockTemplatePartsController and instead use BlockTemplatesController
* Remove old code
* Clean up frontend rendering
* Update tests
* Improve if clause
* Fix wrong tests title
* Fix wrong variable name
* Make sure Mini Cart contents block is unmounted whem mini cart closes or unmounts
* Remove unnecessary waitFor
* Fix PaymentMethodDataProvider wrong children type
* TypeScript fixes
* Make comment shorter
* Remove test code
* Fix contant unmounts of Mini Cart contents block
* Fix wrong template_type passed
* Set Template part area to 'uncategorized'
* Set Template part area to the correct value
* Move template dir check outside loop