Skip to content

Commit

Permalink
Merge pull request #2036 from woocommerce/dev/1833-externalize-flex-a…
Browse files Browse the repository at this point in the history
…nd-card

Externalize `Flex`, `Card` and their associated group components imported from `@wordpress/components`
  • Loading branch information
eason9487 authored Aug 9, 2023
2 parents e1a0388 + 16142a3 commit ec72227
Show file tree
Hide file tree
Showing 39 changed files with 67 additions and 42 deletions.
2 changes: 1 addition & 1 deletion js/src/attribute-mapping/attribute-mapping-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';
import { format as formatDate } from '@wordpress/date';

/**
Expand Down
7 changes: 6 additions & 1 deletion js/src/attribute-mapping/attribute-mapping-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
*/
import { __ } from '@wordpress/i18n';
import { Pagination, Table, TablePlaceholder } from '@woocommerce/components';
import { CardBody, CardFooter, Flex, FlexItem } from '@wordpress/components';
import {
CardBody,
CardFooter,
Flex,
FlexItem,
} from 'extracted/@wordpress/components';
import { useEffect } from '@wordpress/element';
import { recordEvent } from '@woocommerce/tracks';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/account-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import GridiconPhone from 'gridicons/dist/phone';
import { Icon, store as storeIcon } from '@wordpress/icons';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/connected-icon-label/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { Flex, FlexItem } from '@wordpress/components';
import { Flex, FlexItem } from 'extracted/@wordpress/components';
import GridiconCheckmarkCircle from 'gridicons/dist/checkmark-circle';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import { parsePhoneNumberFromString as parsePhoneNumber } from 'libphonenumber-js';
import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import { Flex, FlexItem, FlexBlock, RadioControl } from '@wordpress/components';
import { RadioControl } from '@wordpress/components';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element';
import { CardDivider } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { Spinner } from '@woocommerce/components';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { useState, useEffect, useRef } from '@wordpress/element';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
useRef,
createInterpolateElement,
} from '@wordpress/element';
import { Notice, Flex } from '@wordpress/components';
import { Notice } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useRef, createInterpolateElement } from '@wordpress/element';
import { CardDivider } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { Spinner } from '@woocommerce/components';
import { update as updateIcon } from '@wordpress/icons';
import { getPath, getQuery } from '@woocommerce/navigation';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useState, createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { CardDivider } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CardDivider } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { CardDivider, Notice } from '@wordpress/components';
import { Notice } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { noop } from 'lodash';
import { getSetting } from '@woocommerce/settings'; // eslint-disable-line import/no-unresolved
// The above is an unpublished package, delivered with WC, we use Dependency Extraction Webpack Plugin to import it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { CardDivider } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { getSetting } from '@woocommerce/settings'; // eslint-disable-line import/no-unresolved
// The above is an unpublished package, delivered with WC, we use Dependency Extraction Webpack Plugin to import it.
// See https://github.com/woocommerce/woocommerce-admin/issues/7781
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/billing-card/billing-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import Gridiconcheckmark from 'gridicons/dist/checkmark';
import { Flex, FlexBlock } from '@wordpress/components';
import { Flex, FlexBlock } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useRef } from '@wordpress/element';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import GridiconChevronLeft from 'gridicons/dist/chevron-left';
import GridiconChevronRight from 'gridicons/dist/chevron-right';

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 { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/tree-select-control/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { noop } from 'lodash';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';
import { Icon, chevronUp, chevronDown } from '@wordpress/icons';
import classnames from 'classnames';

Expand Down
2 changes: 1 addition & 1 deletion js/src/dashboard/summary-section/summary-card.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Card, CardHeader } from '@wordpress/components';
import { Card, CardHeader } from 'extracted/@wordpress/components';
/**
* Internal dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Card, CardBody, CardFooter, CardHeader } from '@wordpress/components';
import { Button } from 'extracted/@wordpress/components';
import {
Card,
CardBody,
CardFooter,
CardHeader,
Button,
} from 'extracted/@wordpress/components';
import { isEqual, isFunction } from 'lodash';
import PropTypes from 'prop-types';
import { getIdsFromQuery, updateQueryString } from '@woocommerce/navigation';
Expand Down
2 changes: 1 addition & 1 deletion js/src/get-started-page/benefits-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Card, CardBody, FlexItem } from '@wordpress/components';
import { Card, CardBody, FlexItem } from 'extracted/@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';

/**
Expand Down
7 changes: 6 additions & 1 deletion js/src/get-started-page/customer-quotes-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Card, CardHeader, Flex, FlexBlock } from '@wordpress/components';
import {
Flex,
FlexBlock,
Card,
CardHeader,
} from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
7 changes: 6 additions & 1 deletion js/src/get-started-page/features-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Card, CardHeader, Flex, FlexBlock } from '@wordpress/components';
import {
Flex,
FlexBlock,
Card,
CardHeader,
} from 'extracted/@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/get-started-page/get-started-card/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Card, CardBody, FlexItem } from '@wordpress/components';
import { FlexItem, Card, CardBody } from 'extracted/@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

Expand Down
3 changes: 2 additions & 1 deletion js/src/get-started-page/get-started-with-video-card/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* External dependencies
*/
import { Card, CardBody, FlexBlock, Tip } from '@wordpress/components';
import { Tip } from '@wordpress/components';
import { FlexBlock, Card, CardBody } from 'extracted/@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

Expand Down
2 changes: 1 addition & 1 deletion js/src/product-feed/issues-table-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Card, CardHeader } from '@wordpress/components';
import { Card, CardHeader } from 'extracted/@wordpress/components';
import classnames from 'classnames';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/product-feed/issues-table-card/issues-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { CardBody, CardFooter } from '@wordpress/components';
import { CardBody, CardFooter } from 'extracted/@wordpress/components';
import { Pagination, TablePlaceholder } from '@woocommerce/components';

/**
Expand Down
4 changes: 2 additions & 2 deletions js/src/product-feed/product-feed-table-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*/
import { __, _n, sprintf } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { CheckboxControl } from '@wordpress/components';
import {
CheckboxControl,
Card,
CardHeader,
CardBody,
CardFooter,
} from '@wordpress/components';
} from 'extracted/@wordpress/components';
import {
EmptyTable,
Pagination,
Expand Down
4 changes: 2 additions & 2 deletions js/src/product-feed/product-statistics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
import { __ } from '@wordpress/i18n';
import {
FlexItem,
Card,
CardHeader,
CardBody,
CardFooter,
FlexItem,
} from '@wordpress/components';
} from 'extracted/@wordpress/components';

import {
SummaryList,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Flex, FlexItem } from '@wordpress/components';
import { Flex, FlexItem } from 'extracted/@wordpress/components';

/**
* Renders a status line. With a title, an icon and a description for the status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import { format as formatDate } from '@wordpress/date';
import { Flex, FlexItem } from '@wordpress/components';
import { Flex, FlexItem } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/settings/edit-store-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import { getHistory } from '@woocommerce/navigation';
import { useState } from '@wordpress/element';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/settings/linked-accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { queueRecordEvent } from '@woocommerce/tracks';
import { __ } from '@wordpress/i18n';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';
import { useState } from '@wordpress/element';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { CardDivider, Notice } from '@wordpress/components';
import { Notice } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { useState, createInterpolateElement } from '@wordpress/element';
import { getNewPath } from '@woocommerce/navigation';

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 { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import { Pill } from '@woocommerce/components';
import GridiconCheckmark from 'gridicons/dist/checkmark';
import GridiconGift from 'gridicons/dist/gift';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { sprintf, __, _n } from '@wordpress/i18n';
import { useEffect } from '@wordpress/element';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import { Spinner } from '@woocommerce/components';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
import apiFetch from '@wordpress/api-fetch';
import { select } from '@wordpress/data';
import { useState } from '@wordpress/element';
import { Flex } from '@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';
import { noop, merge } from 'lodash';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/wcdl/section/card/body/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CardBody } from '@wordpress/components';
import { CardBody } from 'extracted/@wordpress/components';
import classnames from 'classnames';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/wcdl/section/card/footer/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CardFooter } from '@wordpress/components';
import { CardFooter } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/wcdl/section/card/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Card as WPCard } from '@wordpress/components';
import { Card as WPCard } from 'extracted/@wordpress/components';

/**
* Internal dependencies
Expand Down

0 comments on commit ec72227

Please sign in to comment.