woocommerce/plugins/woocommerce-admin/packages/components
Sam Seay 172b115ef9 Fix the deprecated behaviour for `<Form>` callbacks and push removal to 9.0.0 (https://github.com/woocommerce/woocommerce-admin/pull/7356)
The deprecated (but not removed) `onChangeCallback` and `onSubmitCallback` props were not being called because of an error in the logic that checked for presence of the new callbacks (it was always truthy due to it having a fallback to an empty function).

This reverses the logic so that if the deprecated props are provided they will be called, if the new props (only) are provided they will be called instead.

This also pushes the removal of these back to 9.0.0, because in the past these deprecated version numbers had little thought behind them, but this gives a more realistic time frame for removal and an understanding that a *major* version will break compatibility, not a patch version as the old version number suggested.
2021-07-26 14:45:03 +12:00
..
src Fix the deprecated behaviour for `<Form>` callbacks and push removal to 9.0.0 (https://github.com/woocommerce/woocommerce-admin/pull/7356) 2021-07-26 14:45:03 +12:00
.npmrc Build: Move components to packages dir (https://github.com/woocommerce/woocommerce-admin/pull/804) 2018-11-15 13:16:23 -05:00
CHANGELOG.md Fix the deprecated behaviour for `<Form>` callbacks and push removal to 9.0.0 (https://github.com/woocommerce/woocommerce-admin/pull/7356) 2021-07-26 14:45:03 +12:00
README.md Revert Card component removal (https://github.com/woocommerce/woocommerce-admin/pull/7167) 2021-06-11 14:26:02 +08:00
jest.config.json Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00
package.json Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00
tsconfig-cjs.json Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00
tsconfig.json Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00

README.md

Components

This packages includes a library of components that can be used to create pages in the WooCommerce dashboard and reports pages.

Installation

Install the module

npm install @woocommerce/components --save

View the full Component documentation for usage information.

Usage

/**
 * Woocommerce dependencies
 */
import { Card } from '@woocommerce/components';

export default function MyCard() {
	return (
		<Card title="Store Performance" description="Key performance metrics">
			<p>Your stuff in a Card.</p>
		</Card>
	);
}

Many components include CSS to add style, you will need to add in order to appear correctly. Within WooCommerce, add the wc-components stylesheet as a dependency of your plugin's stylesheet. See wp_enqueue_style documentation for how to specify dependencies.

In non-WordPress projects, link to the build-style/card/style.css file directly, it is located at node_modules/@woocommerce/components/build-style/<component_name>/style.css.