Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Move from local icons to polaris-icons (#686)" #775

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f

### Enhancements

- Moved icons to a separate npm package ([#686](https://github.com/Shopify/polaris-react/pull/686))

### Bug fixes

- Fixed the new variant of the `Badge` component so that it is simpler and easier to read ([#751](https://github.com/Shopify/polaris-react/pull/751))
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
"@shopify/app-bridge": "^0.7.3",
"@shopify/images": "^1.1.0",
"@shopify/javascript-utilities": "^2.2.1",
"@shopify/polaris-icons": "1.0.0-beta.5",
"@shopify/polaris-tokens": "^2.0.0",
"@shopify/react-compose": "^0.1.6",
"@shopify/react-html": "^3.0.3",
Expand Down
15 changes: 3 additions & 12 deletions playground/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const postcssShopify = require('postcss-shopify');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;

const INTERNAL_ICON_PATH_REGEX = /icons\//;
const PACKAGE_ICON_PATH_REGEX = /polaris-icons\//;
const ICON_PATH_REGEX = /icons\//;
const IMAGE_PATH_REGEX = /\.(jpe?g|png|gif|svg)$/;

module.exports = (env = {production: false}) => ({
Expand Down Expand Up @@ -118,11 +117,7 @@ module.exports = (env = {production: false}) => ({
},
{
test(resource) {
return (
(INTERNAL_ICON_PATH_REGEX.test(resource) ||
PACKAGE_ICON_PATH_REGEX.test(resource)) &&
resource.endsWith('.svg')
);
return ICON_PATH_REGEX.test(resource) && resource.endsWith('.svg');
},
use: [
{
Expand All @@ -139,11 +134,7 @@ module.exports = (env = {production: false}) => ({
{
test(resource) {
return (
IMAGE_PATH_REGEX.test(resource) &&
!(
INTERNAL_ICON_PATH_REGEX.test(resource) ||
PACKAGE_ICON_PATH_REGEX.test(resource)
)
IMAGE_PATH_REGEX.test(resource) && !ICON_PATH_REGEX.test(resource)
);
},
use: [
Expand Down
6 changes: 3 additions & 3 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ import {
circlePlus,
circlePlusOutline,
conversation,
deleteIcon,
delete as deleteIcon,
disable,
dispute,
duplicate,
embed,
exportIcon,
export as exportIcon,
external,
help,
home,
horizontalDots,
importIcon,
import as importIcon,
logOut,
notes,
notification,
Expand Down
1 change: 1 addition & 0 deletions src/icons/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/arrow-up-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/cancel-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/caret-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/caret-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/checkmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/chevron-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/chevron-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/chevron-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-chevron-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-chevron-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-chevron-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-information.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-plus-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/circle-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/conversation.svg
1 change: 1 addition & 0 deletions src/icons/delete.svg
1 change: 1 addition & 0 deletions src/icons/disable.svg
1 change: 1 addition & 0 deletions src/icons/dispute.svg
1 change: 1 addition & 0 deletions src/icons/duplicate.svg
1 change: 1 addition & 0 deletions src/icons/ellipsis.svg
1 change: 1 addition & 0 deletions src/icons/embed.svg
1 change: 1 addition & 0 deletions src/icons/export.svg
1 change: 1 addition & 0 deletions src/icons/external.svg
1 change: 1 addition & 0 deletions src/icons/help.svg
1 change: 1 addition & 0 deletions src/icons/home.svg
1 change: 1 addition & 0 deletions src/icons/horizontal-dots.svg
1 change: 1 addition & 0 deletions src/icons/import.svg
108 changes: 53 additions & 55 deletions src/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
import POLARIS_ICONS from '@shopify/polaris-icons';

export const add = POLARIS_ICONS.add;
export const alert = POLARIS_ICONS.alert;
export const arrowDown = POLARIS_ICONS.arrowDown;
export const arrowLeft = POLARIS_ICONS.arrowLeft;
export const arrowRight = POLARIS_ICONS.arrowRight;
export const arrowUp = POLARIS_ICONS.arrowUp;
export const arrowUpDown = POLARIS_ICONS.arrowUpDown;
export const calendar = POLARIS_ICONS.calendar;
export const cancel = POLARIS_ICONS.cancel;
export const cancelSmall = POLARIS_ICONS.cancelSmall;
export const caretDown = POLARIS_ICONS.caretDown;
export const caretUp = POLARIS_ICONS.caretUp;
export const checkmark = POLARIS_ICONS.checkmark;
export const chevronDown = POLARIS_ICONS.chevronDown;
export const chevronLeft = POLARIS_ICONS.chevronLeft;
export const chevronRight = POLARIS_ICONS.chevronRight;
export const chevronUp = POLARIS_ICONS.chevronUp;
export const circleCancel = POLARIS_ICONS.circleCancel;
export const circleChevronDown = POLARIS_ICONS.circleChevronDown;
export const circleChevronLeft = POLARIS_ICONS.circleChevronLeft;
export const circleChevronRight = POLARIS_ICONS.circleChevronRight;
export const circleChevronUp = POLARIS_ICONS.circleChevronUp;
export const circleInformation = POLARIS_ICONS.circleInformation;
export const circlePlus = POLARIS_ICONS.circlePlus;
export const circlePlusOutline = POLARIS_ICONS.circlePlusOutline;
export const conversation = POLARIS_ICONS.conversation;
export const deleteIcon = POLARIS_ICONS.deleteIcon;
export const disable = POLARIS_ICONS.disable;
export const dispute = POLARIS_ICONS.dispute;
export const duplicate = POLARIS_ICONS.duplicate;
export const ellipsis = POLARIS_ICONS.ellipsis;
export const embed = POLARIS_ICONS.embed;
export const exportIcon = POLARIS_ICONS.exportIcon;
export const external = POLARIS_ICONS.external;
export const help = POLARIS_ICONS.help;
export const home = POLARIS_ICONS.home;
export const horizontalDots = POLARIS_ICONS.horizontalDots;
export const importIcon = POLARIS_ICONS.importIcon;
export const logOut = POLARIS_ICONS.logOut;
export const menu = POLARIS_ICONS.menu;
export const notes = POLARIS_ICONS.notes;
export const notification = POLARIS_ICONS.notification;
export const onlineStore = POLARIS_ICONS.onlineStore;
export const orders = POLARIS_ICONS.orders;
export const print = POLARIS_ICONS.print;
export const products = POLARIS_ICONS.products;
export const profile = POLARIS_ICONS.profile;
export const subtract = POLARIS_ICONS.subtract;
export const refresh = POLARIS_ICONS.refresh;
export const risk = POLARIS_ICONS.risk;
export const save = POLARIS_ICONS.save;
export const search = POLARIS_ICONS.search;
export const view = POLARIS_ICONS.view;
export {default as add} from './add.svg';
export {default as alert} from './alert.svg';
export {default as arrowDown} from './arrow-down.svg';
export {default as arrowLeft} from './arrow-left.svg';
export {default as arrowRight} from './arrow-right.svg';
export {default as arrowUp} from './arrow-up.svg';
export {default as arrowUpDown} from './arrow-up-down.svg';
export {default as calendar} from './calendar.svg';
export {default as cancel} from './cancel.svg';
export {default as cancelSmall} from './cancel-small.svg';
export {default as caretDown} from './caret-down.svg';
export {default as caretUp} from './caret-up.svg';
export {default as checkmark} from './checkmark.svg';
export {default as chevronDown} from './chevron-down.svg';
export {default as chevronLeft} from './chevron-left.svg';
export {default as chevronRight} from './chevron-right.svg';
export {default as chevronUp} from './chevron-up.svg';
export {default as circleCancel} from './circle-cancel.svg';
export {default as circleChevronDown} from './circle-chevron-down.svg';
export {default as circleChevronLeft} from './circle-chevron-left.svg';
export {default as circleChevronRight} from './circle-chevron-right.svg';
export {default as circleChevronUp} from './circle-chevron-up.svg';
export {default as circleInformation} from './circle-information.svg';
export {default as circlePlus} from './circle-plus.svg';
export {default as circlePlusOutline} from './circle-plus-outline.svg';
export {default as conversation} from './conversation.svg';
export {default as delete} from './delete.svg';
export {default as disable} from './disable.svg';
export {default as dispute} from './dispute.svg';
export {default as duplicate} from './duplicate.svg';
export {default as embed} from './embed.svg';
export {default as ellipsis} from './ellipsis.svg';
export {default as export} from './export.svg';
export {default as external} from './external.svg';
export {default as help} from './help.svg';
export {default as home} from './home.svg';
export {default as horizontalDots} from './horizontal-dots.svg';
export {default as import} from './import.svg';
export {default as logOut} from './log-out.svg';
export {default as menu} from './menu.svg';
export {default as notes} from './notes.svg';
export {default as notification} from './notification.svg';
export {default as onlineStore} from './online-store.svg';
export {default as orders} from './orders.svg';
export {default as print} from './print.svg';
export {default as products} from './products.svg';
export {default as profile} from './profile.svg';
export {default as subtract} from './subtract.svg';
export {default as refresh} from './refresh.svg';
export {default as risk} from './risk.svg';
export {default as save} from './save.svg';
export {default as search} from './search.svg';
export {default as view} from './view.svg';
1 change: 1 addition & 0 deletions src/icons/log-out.svg
1 change: 1 addition & 0 deletions src/icons/menu.svg
1 change: 1 addition & 0 deletions src/icons/notes.svg
Loading