Export `Button` and `Label` from `wc-blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4406)

* Remove snackbar filtering

* Revert "Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)"

This reverts commit 983ce48cad.

* Export Label and Button from the wc-blocks-checkout package

* Reorder exports

This is so the diff is smaller in the PR

* Revert "Remove snackbar filtering"

This reverts commit 8e598436e871aa56f89740fbe6fbe522fd02db1d.
This commit is contained in:
Thomas Roberts 2021-07-02 10:24:07 +01:00 committed by GitHub
parent 93b750ee19
commit 589f6923d6
25 changed files with 32 additions and 17 deletions

View File

@ -2,7 +2,7 @@
* External dependencies * External dependencies
*/ */
import { __, _n, sprintf } from '@wordpress/i18n'; import { __, _n, sprintf } from '@wordpress/i18n';
import { Button } from '@woocommerce/blocks-checkout'; import Button from '@woocommerce/base-components/button';
import { Icon, done as doneIcon } from '@woocommerce/icons'; import { Icon, done as doneIcon } from '@woocommerce/icons';
import { useState, useEffect } from '@wordpress/element'; import { useState, useEffect } from '@wordpress/element';
import { useAddToCartFormContext } from '@woocommerce/base-context'; import { useAddToCartFormContext } from '@woocommerce/base-context';

View File

@ -4,7 +4,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import classnames from 'classnames'; import classnames from 'classnames';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
import { import {
useInnerBlockLayoutContext, useInnerBlockLayoutContext,
useProductDataContext, useProductDataContext,

View File

@ -2,13 +2,13 @@
* External dependencies * External dependencies
*/ */
import { __, sprintf } from '@wordpress/i18n'; import { __, sprintf } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import ProductPrice from '@woocommerce/base-components/product-price'; import ProductPrice from '@woocommerce/base-components/product-price';
import ProductName from '@woocommerce/base-components/product-name'; import ProductName from '@woocommerce/base-components/product-name';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format'; import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import { import {
__experimentalApplyCheckoutFilter, __experimentalApplyCheckoutFilter,
mustContain, mustContain,
Label,
} from '@woocommerce/blocks-checkout'; } from '@woocommerce/blocks-checkout';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Dinero from 'dinero.js'; import Dinero from 'dinero.js';

View File

@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks'; import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
import { Icon, done } from '@woocommerce/icons'; import { Icon, done } from '@woocommerce/icons';
import { Button } from '@woocommerce/blocks-checkout'; import Button from '@woocommerce/base-components/button';
const PlaceOrderButton = () => { const PlaceOrderButton = () => {
const { const {

View File

@ -2,7 +2,7 @@
* External dependencies * External dependencies
*/ */
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { Button } from '@woocommerce/blocks-checkout'; import Button from '@woocommerce/base-components/button';
import { useState } from '@wordpress/element'; import { useState } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal'; import isShallowEqual from '@wordpress/is-shallow-equal';
import { useValidationContext } from '@woocommerce/base-context'; import { useValidationContext } from '@woocommerce/base-context';

View File

@ -6,7 +6,8 @@ import { _n, sprintf } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities'; import { decodeEntities } from '@wordpress/html-entities';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping'; import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import { Panel, Label } from '@woocommerce/blocks-checkout'; import { Panel } from '@woocommerce/blocks-checkout';
import Label from '@woocommerce/base-components/label';
import { useSelectShippingRate } from '@woocommerce/base-context/hooks'; import { useSelectShippingRate } from '@woocommerce/base-context/hooks';
import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart'; import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

View File

@ -3,8 +3,9 @@
*/ */
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element'; import { useState, useEffect, useRef } from '@wordpress/element';
import { Button, Panel, Label } from '@woocommerce/blocks-checkout'; import Button from '@woocommerce/base-components/button';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input'; import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
import Label from '@woocommerce/base-components/label';
import LoadingMask from '@woocommerce/base-components/loading-mask'; import LoadingMask from '@woocommerce/base-components/loading-mask';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id'; import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
@ -12,6 +13,7 @@ import {
ValidationInputError, ValidationInputError,
useValidationContext, useValidationContext,
} from '@woocommerce/base-context'; } from '@woocommerce/base-context';
import { Panel } from '@woocommerce/blocks-checkout';
/** /**
* Internal dependencies * Internal dependencies

View File

@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* Internal dependencies * Internal dependencies

View File

@ -3,7 +3,7 @@
*/ */
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* Internal dependencies * Internal dependencies

View File

@ -4,7 +4,7 @@
import { __, sprintf } from '@wordpress/i18n'; import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* Internal dependencies * Internal dependencies

View File

@ -3,7 +3,7 @@
*/ */
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id'; import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
/** /**

View File

@ -4,11 +4,11 @@
import { forwardRef, InputHTMLAttributes } from 'react'; import { forwardRef, InputHTMLAttributes } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import { useState } from '@wordpress/element'; import { useState } from '@wordpress/element';
import { Label } from '@woocommerce/blocks-checkout';
/** /**
* Internal dependencies * Internal dependencies
*/ */
import Label from '../label';
import './style.scss'; import './style.scss';
interface TextInputProps interface TextInputProps

View File

@ -6,7 +6,7 @@ import { useQueryStateByKey } from '@woocommerce/base-context/hooks';
import { useMemo } from '@wordpress/element'; import { useMemo } from '@wordpress/element';
import classnames from 'classnames'; import classnames from 'classnames';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* Internal dependencies * Internal dependencies

View File

@ -4,7 +4,7 @@
import { __, sprintf } from '@wordpress/i18n'; import { __, sprintf } from '@wordpress/i18n';
import { formatPrice } from '@woocommerce/price-format'; import { formatPrice } from '@woocommerce/price-format';
import { RemovableChip } from '@woocommerce/base-components/chip'; import { RemovableChip } from '@woocommerce/base-components/chip';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* Format a min/max price range to display. * Format a min/max price range to display.

View File

@ -2,7 +2,7 @@
* External dependencies * External dependencies
*/ */
import { _n, sprintf } from '@wordpress/i18n'; import { _n, sprintf } from '@wordpress/i18n';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
/** /**
* The label for an attribute term filter. * The label for an attribute term filter.

View File

@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element'; import { useState, useEffect } from '@wordpress/element';
import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout'; import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
import { Button } from '@woocommerce/blocks-checkout'; import Button from '@woocommerce/base-components/button';
import { CHECKOUT_URL } from '@woocommerce/block-settings'; import { CHECKOUT_URL } from '@woocommerce/block-settings';
import { useCheckoutContext } from '@woocommerce/base-context'; import { useCheckoutContext } from '@woocommerce/base-context';
import { usePaymentMethods } from '@woocommerce/base-context/hooks'; import { usePaymentMethods } from '@woocommerce/base-context/hooks';

View File

@ -3,7 +3,7 @@
*/ */
import { usePaymentMethods } from '@woocommerce/base-context/hooks'; import { usePaymentMethods } from '@woocommerce/base-context/hooks';
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { Label } from '@woocommerce/blocks-checkout'; import Label from '@woocommerce/base-components/label';
import { usePaymentMethodDataContext } from '@woocommerce/base-context'; import { usePaymentMethodDataContext } from '@woocommerce/base-context';
/** /**

View File

@ -0,0 +1,6 @@
/**
* External dependencies
*/
import Button from '@woocommerce/base-components/button';
export default Button;

View File

@ -0,0 +1,6 @@
/**
* External dependencies
*/
import Label from '@woocommerce/base-components/label';
export default Label;