woocommerce/plugins/woocommerce-blocks/assets/js/icons
Albert Juhé Lluveras 0e1b1e3579 Add types to packages directory (https://github.com/woocommerce/woocommerce-blocks/pull/3914)
* Add Typescript to Panel and Icon

* Fix Icon component import

* Convert packages/checkout/utils/validation/index to TypeScript

* Convert checkout registry to TypeScript

* Add return type to mustContain

* Add TypeScript to Totals components from @woocommerce/blocks-checkout

* Add TypeScript to @woocommerce/price-format

* Use types from @woocommerce/type-defs when possible

* Allow empty objects when loading

* Fix formatting in payment-method-data-context.js

* Add missing return types

* Fix up price warnings

* Fix more warnings in FormattedMonetaryAmount

Co-authored-by: Raluca Stan <ralucastn@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-03-05 14:03:48 +00:00
..
icon Add types to packages directory (https://github.com/woocommerce/woocommerce-blocks/pull/3914) 2021-03-05 14:03:48 +00:00
library Add subtotal to cart and checkout and update the CartLineItem component with new styles (https://github.com/woocommerce/woocommerce-blocks/pull/3734) 2021-01-27 11:34:59 +00:00
stories Add storybook story for icon library (https://github.com/woocommerce/woocommerce-blocks/pull/2787) 2020-06-26 10:22:41 -04:00
README.md add new icons and remove old ones (https://github.com/woocommerce/woocommerce-blocks/pull/1644) 2020-01-31 19:20:33 +01:00
index.js Add subtotal to cart and checkout and update the CartLineItem component with new styles (https://github.com/woocommerce/woocommerce-blocks/pull/3734) 2021-01-27 11:34:59 +00:00
tsconfig.json Add types to packages directory (https://github.com/woocommerce/woocommerce-blocks/pull/3914) 2021-03-05 14:03:48 +00:00

README.md

Icons

WooCommerce Blocks Icons Library.

Usage

import { Icon, bill, woo } from '@woocommerce/icons';

<Icon srcElement={ bill } />

<Icon srcElement={ bill } size={ 16 } />

<Icon srcElement={ woo } width={ 20 } height={ Math.floor( 20 * 1.67 ) } />

Props

Name Type Default Description
size integer 24 Size of icon in pixels.

Adding Icons

  1. Add the icon file to ./library folder.
  2. Make sure to use SVG primitive from @wordpress/components and not a native svg. SVG offers more accessibility features.
  3. Remove width and height since they're handled by Icon.
  4. Remove any hardcoded colors on the svg. If necessary, use CurrentColor.
  5. Export the Icon in ./library/index.js.