woocommerce/plugins/woocommerce-admin/packages/components/src/pagination
Sam Seay b448ff60b7 Update @wordpress/base-styles and replace deprecated variables (https://github.com/woocommerce/woocommerce-admin/pull/4759)
Fixes woocommerce/woocommerce-admin#4732

This updates `@wordpress/base-styles`, and because `@wordpress/components` depends on variables from it, that must be updated as well.

There are 3 major changes required as part of updating:

1. The $theme-color variable is no longer exposed by base-styles. Instead there are 3 css vars exposed. These are made available by use of a provided mixin. Situations where $theme-color was darkened using scss have been mapped as best as possible to the 2 other darkened shades of the css var that are available such as `--wp-admin-theme-color-darker-20` and `--wp-admin-theme-color-darker-10`. In some cases this means the colors are not exactly the same as before.

2. The post css `theme()` call is no longer available. All uses of this have been consolidated to use of the main theme css var `--wp-admin-theme-color`. This means that calls like `theme(secondary)` or `theme(outline)` etc have all been consolidated to the one color.

3. Many of the variables used for different shades of gray have been deprecated. These have been mapped across to the new gray variables. (Mapped according to the list described in woocommerce/woocommerce-admin#4732)
2020-07-17 12:11:42 +12:00
..
docs Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674) 2020-02-14 15:23:21 +13:00
stories Add showPagePicker, showPerPagePicker props to Pagination component (https://github.com/woocommerce/woocommerce-admin/pull/3980) 2020-03-27 11:24:51 +10:30
README.md Add showPagePicker, showPerPagePicker props to Pagination component (https://github.com/woocommerce/woocommerce-admin/pull/3980) 2020-03-27 11:24:51 +10:30
index.js IconButton: Replace with Button (https://github.com/woocommerce/woocommerce-admin/pull/4415) 2020-05-29 14:32:37 +12:00
style.scss Update @wordpress/base-styles and replace deprecated variables (https://github.com/woocommerce/woocommerce-admin/pull/4759) 2020-07-17 12:11:42 +12:00

README.md

Pagination

Use Pagination to allow navigation between pages that represent a collection of items. The component allows for selecting a new page and items per page options.

Usage

<Pagination
	page={ 1 }
	perPage={ 10 }
	total={ 500 }
	onPageChange={ ( newPage ) => setState( { page: newPage } ) }
	onPerPageChange={ ( newPerPage ) => setState( { perPage: newPerPage } ) }
/>

Props

Name Type Default Description
page Number null (required) The current page of the collection
onPageChange Function noop A function to execute when the page is changed
perPage Number null (required) The amount of results that are being displayed per page
onPerPageChange Function noop A function to execute when the per page option is changed
total Number null (required) The total number of results
className String null Additional classNames
showPagePicker Boolean true Whether the page picker should be shown.
showPerPagePicker Boolean true Whether the per page picker should shown.
showPageArrowsLabel Boolean true Whether the page arrows label should be shown.