Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Move Button and Label components to @woocommerce/blocks-checkout pa…
Browse files Browse the repository at this point in the history
…ckage (#4222)

* Move Button to checkout package

* Move Label to Components Package
  • Loading branch information
opr authored and grogou committed Aug 20, 2021
1 parent 0b91fbe commit fccc72b
Show file tree
Hide file tree
Showing 24 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __, _n, sprintf } from '@wordpress/i18n';
import Button from '@woocommerce/base-components/button';
import { Button } from '@woocommerce/blocks-checkout';
import { Icon, done as doneIcon } from '@woocommerce/icons';
import { useState, useEffect } from '@wordpress/element';
import { useAddToCartFormContext } from '@woocommerce/base-context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';
import {
useInnerBlockLayoutContext,
useProductDataContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import ProductPrice from '@woocommerce/base-components/product-price';
import ProductName from '@woocommerce/base-components/product-name';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import {
__experimentalApplyCheckoutFilter,
mustBeString,
mustContain,
Label,
} from '@woocommerce/blocks-checkout';
import PropTypes from 'prop-types';
import Dinero from 'dinero.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
import { Icon, done } from '@woocommerce/icons';
import Button from '@woocommerce/base-components/button';
import { Button } from '@woocommerce/blocks-checkout';

const PlaceOrderButton = () => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import Button from '@woocommerce/base-components/button';
import { Button } from '@woocommerce/blocks-checkout';
import { useState } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { useValidationContext } from '@woocommerce/base-context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { _n, sprintf } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';
import type { ReactElement } from 'react';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import { Panel } from '@woocommerce/blocks-checkout';
import Label from '@woocommerce/base-components/label';
import { Panel, Label } from '@woocommerce/blocks-checkout';
import { useSelectShippingRate } from '@woocommerce/base-context/hooks';
import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
*/
import { __ } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element';
import Button from '@woocommerce/base-components/button';
import { Button, Panel, Label } from '@woocommerce/blocks-checkout';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
import Label from '@woocommerce/base-components/label';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import PropTypes from 'prop-types';
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
import {
ValidationInputError,
useValidationContext,
} from '@woocommerce/base-context';
import { Panel } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/base/components/filter-submit-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/base/components/load-more-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/base/components/pagination/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/base/components/sort-select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/js/base/components/text-input/text-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { forwardRef } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { useState } from '@wordpress/element';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
*/
import Label from '../label';
import './style.scss';

const TextInput = forwardRef(
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/active-filters/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getSetting } from '@woocommerce/settings';
import { useMemo } from '@wordpress/element';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/active-filters/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __, sprintf } from '@wordpress/i18n';
import { formatPrice } from '@woocommerce/price-format';
import { RemovableChip } from '@woocommerce/base-components/chip';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Format a min/max price range to display.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/attribute-filter/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { _n, sprintf } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';

/**
* The label for an attribute term filter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
import Button from '@woocommerce/base-components/button';
import { Button } from '@woocommerce/blocks-checkout';
import { CHECKOUT_URL } from '@woocommerce/block-settings';
import { useCheckoutContext } from '@woocommerce/base-context';
import { usePaymentMethods } from '@woocommerce/base-context/hooks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { usePaymentMethods } from '@woocommerce/base-context/hooks';
import { __ } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import { Label } from '@woocommerce/blocks-checkout';
import { usePaymentMethodDataContext } from '@woocommerce/base-context';

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/checkout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export { default as ExperimentalOrderMeta } from './order-meta';
export { default as ExperimentalOrderShippingPackages } from './order-shipping-packages';
export { default as Panel } from './panel';
export { SlotFillProvider } from 'wordpress-components';
export { default as Button } from './button';
export { default as Label } from './label';

0 comments on commit fccc72b

Please sign in to comment.