woocommerce/packages/js/components
Moon 8f02ecbeba
Migrate Ellipsis Menu component to TS (#36405)
* Migrate ellipsis-menu to TS

* Add changelog

* Remove React.VFC -- it is deprecated in React 18

* Make renderContent props optional

* Allow KeyboardEvent

* Make onToggle optional

* Allow undefined for backward compatibility

* Remove unnecessary @ts-expect-error -- ellipsis menu is now in TS

* Make onToggle required

* Make event e required - backward compatibility

* Use toggleHandlerOverride to make it more readable

* Remove React.VFC -- it is deprecated in React 18
2023-04-27 17:00:35 -07:00
..
changelog Migrate Ellipsis Menu component to TS (#36405) 2023-04-27 17:00:35 -07:00
src Migrate Ellipsis Menu component to TS (#36405) 2023-04-27 17:00:35 -07:00
typings Migrate Rating component to TS (#36301) 2023-04-26 15:21:16 -07:00
.eslintrc.js Update the @woocommerce/eslint-plugin and fix bugs (#36988) 2023-03-02 11:36:38 +13:00
.gitignore Update JS packages changelogs (#33412) 2022-06-16 10:06:31 +12:00
.npmrc Moved WCA Packages 2022-03-18 14:25:26 -07:00
CHANGELOG.md Prepare Packages for Release (#36210) 2023-01-03 18:53:06 +07:00
PREVIOUS_CHANGELOG.md @woocommerce/components: Prep changelog for release (#33359) 2022-06-14 14:21:02 +12:00
README.md Moved WCA Packages 2022-03-18 14:25:26 -07:00
babel.config.js Update/unify jest@27 across all packages (#34322) 2022-09-06 09:29:45 -05:00
composer.json Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
composer.lock Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
jest.config.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07:00
package.json Update monorepo to pnpm 8 and Node to 16.14 (#37915) 2023-04-25 18:49:30 +12:00
tsconfig-cjs.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07:00
tsconfig.json Fix TypeScript Incremental Build Regression (#37432) 2023-03-24 12:07:49 -07:00
webpack.config.js Emit error on webpack build when invalid export name used in import for JS (#37195) 2023-03-26 21:42:33 -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

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.