Skip to content

Commit

Permalink
Merge pull request #2037 from woocommerce/dev/1833-externalize-icons-…
Browse files Browse the repository at this point in the history
…notice-tip

Externalize `Dashicon`, `Icon`, `Notice` and `Tip` components imported from `@wordpress/components`
  • Loading branch information
eason9487 authored Aug 9, 2023
2 parents ec72227 + d507cb9 commit ebca4f5
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .externalized.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["@woocommerce/components","@woocommerce/customer-effort-score","@woocommerce/data","@woocommerce/navigation","@woocommerce/settings","@wordpress/a11y","@wordpress/api-fetch","@wordpress/data","@wordpress/data-controls","@wordpress/date","@wordpress/deprecated","@wordpress/dom","@wordpress/element","@wordpress/escape-html","@wordpress/hooks","@wordpress/html-entities","@wordpress/i18n","@wordpress/is-shallow-equal","@wordpress/keycodes","@wordpress/priority-queue","@wordpress/rich-text","@wordpress/url","@wordpress/warning","extracted/@wordpress/components","lodash","moment","react","react-dom"]
["@woocommerce/components","@woocommerce/customer-effort-score","@woocommerce/data","@woocommerce/navigation","@woocommerce/settings","@wordpress/a11y","@wordpress/api-fetch","@wordpress/data","@wordpress/data-controls","@wordpress/date","@wordpress/deprecated","@wordpress/dom","@wordpress/element","@wordpress/escape-html","@wordpress/hooks","@wordpress/html-entities","@wordpress/i18n","@wordpress/is-shallow-equal","@wordpress/keycodes","@wordpress/primitives","@wordpress/priority-queue","@wordpress/rich-text","@wordpress/url","@wordpress/warning","extracted/@wordpress/components","lodash","moment","react","react-dom"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useRef,
createInterpolateElement,
} from '@wordpress/element';
import { Notice } from '@wordpress/components';
import { Notice } from 'extracted/@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/different-currency-notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Notice } from '@wordpress/components';
import { Notice } from 'extracted/@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';

/**
Expand Down
57 changes: 0 additions & 57 deletions js/src/components/dismissible-notice/index.js

This file was deleted.

125 changes: 0 additions & 125 deletions js/src/components/dismissible-notice/index.test.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Notice } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider, Notice } 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 @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Tip } from '@wordpress/components';
import { Tip } 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 { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Tip } from '@wordpress/components';
import { Tip } from 'extracted/@wordpress/components';
import GridiconNoticeOutline from 'gridicons/dist/notice-outline';

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

Expand Down
2 changes: 1 addition & 1 deletion js/src/get-started-page/unsupported-notices/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 { Notice, Icon } from '@wordpress/components';
import { Notice, Icon } from 'extracted/@wordpress/components';
import { external as externalIcon } from '@wordpress/icons';
import { Link } from '@woocommerce/components';
import { createInterpolateElement } from '@wordpress/element';
Expand Down
2 changes: 1 addition & 1 deletion js/src/product-feed/issues-table-card/issues-solved.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Dashicon } from '@wordpress/components';
import { Dashicon } 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 { __, sprintf } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import { Icon } from '@wordpress/components';
import { Icon } from 'extracted/@wordpress/components';
import { SelectControl } from '@woocommerce/components';
import { edit as editIcon } from '@wordpress/icons';

Expand Down Expand Up @@ -68,7 +68,7 @@ export default function EditVisibilityAction( {
'google-listings-and-ads'
) }
>
<Icon icon={ editIcon } size={ 24 } />
<Icon icon={ editIcon } />
</AppTooltip>
);
}
Expand Down
2 changes: 1 addition & 1 deletion js/src/product-feed/product-feed-table-card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
}

.app-tooltip__children-container {
.gla-tooltip__children-container {
// Clear the 4px space gap for SVG
line-height: 0;

Expand Down
3 changes: 2 additions & 1 deletion js/src/product-feed/review-request/review-request-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { CheckboxControl, Notice } from '@wordpress/components';
import { CheckboxControl } from '@wordpress/components';
import { Notice } from 'extracted/@wordpress/components';
import { createInterpolateElement, useState } from '@wordpress/element';
import { recordEvent } from '@woocommerce/tracks';

Expand Down
2 changes: 1 addition & 1 deletion js/src/reports/programs/campaign-name-cell.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.gla-reports__tooltip-campaign-name {
.app-tooltip__children-container {
.gla-tooltip__children-container {
width: 100%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Notice } from '@wordpress/components';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider, Notice } 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 @@ -16,7 +16,7 @@
}

&__product-quantity-separator,
.app-tooltip__children-container {
.gla-tooltip__children-container {
font-size: $gla-font-smallest;
font-weight: normal;
color: $gray-700;
Expand All @@ -28,7 +28,7 @@
margin: 0 $grid-unit-10;
}

.app-tooltip__children-container {
.gla-tooltip__children-container {
padding-bottom: calc($grid-unit-05 / 2);
line-height: 1;
border-bottom: $border-width dashed $gray-600;
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const requestToExternal = ( request ) => {
// WP 5.4 is the min version for <Card* />, <TabPanel />
'@wordpress/compose',
'@wordpress/components',
'@wordpress/primitives',
// Opt-out WooCommerce packages.
'@woocommerce/currency',
'@woocommerce/date',
Expand Down

0 comments on commit ebca4f5

Please sign in to comment.