b65d473796
* Add key event handlers * Track selected item and focus * Fix selected indexes on up down selection and drop * Consolidate update item order logic * Hide horizontal items on drag * Update naming of ordering persistence * Announce keyboard events to screen readers * Consolidate reset method * Simplify drop index numbers and conditions * Fix up announcements * Add tests around new utils * Fall back for item name in announcement from aria label or alt text * Update lock file * Add changelog entry * Handle PR feedback * Fix up lock file after rebase * Update lock file * Update lock file again * Update lock file after pnpm7 * Use trunk lock file * Update lock file with a11y package * Try new lock file * Try lock file with pnpm add * pnpm add from root * Fix itemToString in SelectControl * Downgrade a11y to v3.5.0 |
||
---|---|---|
.. | ||
changelog | ||
src | ||
.eslintrc.js | ||
.gitignore | ||
.npmrc | ||
CHANGELOG.md | ||
PREVIOUS_CHANGELOG.md | ||
README.md | ||
babel.config.js | ||
composer.json | ||
composer.lock | ||
jest.config.json | ||
package.json | ||
tsconfig-cjs.json | ||
tsconfig.json | ||
webpack.config.js |
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
pnpm 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
.