woocommerce/plugins/woocommerce-admin/client/components
Kelly Dwan 7711da472a Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334)
* Validate component with helper function

Fixes compat issue with react-docgen

* Switch all components to default exports

This ensures we can read all components for documentation generation (plus, standardizing is good)

* inValidDays -> invalidDays

Invalid is a single word, so by capitalization rules the V should be lowercase

* Export child-components of Chart

* Fix table exports
2018-08-31 13:19:13 -04:00
..
animation-slider Animation mixin + add `prefers-reduced-motion` support to existing animations (https://github.com/woocommerce/woocommerce-admin/pull/317) 2018-08-23 13:47:27 -04:00
calendar Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
card Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
chart Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297) 2018-08-20 17:18:13 -04:00
count Update woo-dash naming to new wc-admin name (https://github.com/woocommerce/woocommerce-admin/pull/183) 2018-07-10 08:48:06 -04:00
dropdown-button Animation mixin + add `prefers-reduced-motion` support to existing animations (https://github.com/woocommerce/woocommerce-admin/pull/317) 2018-08-23 13:47:27 -04:00
ellipsis-menu Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
filters Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
flag Add Flag Component (https://github.com/woocommerce/woocommerce-admin/pull/197) 2018-07-16 12:28:26 -04:00
gravatar Add Activity Panel Outbound Link Component (https://github.com/woocommerce/woocommerce-admin/pull/213) 2018-07-17 14:51:56 -04:00
higher-order/use-filters Update woo-dash naming to new wc-admin name (https://github.com/woocommerce/woocommerce-admin/pull/183) 2018-07-10 08:48:06 -04:00
link Add Activity Panel Outbound Link Component (https://github.com/woocommerce/woocommerce-admin/pull/213) 2018-07-17 14:51:56 -04:00
order-status Add Order Status Component (https://github.com/woocommerce/woocommerce-admin/pull/214) 2018-07-17 09:11:13 -04:00
pagination Verify the page number exists. 2018-08-01 11:51:11 -07:00
product-image Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231) 2018-07-20 14:24:39 -04:00
rating Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297) 2018-08-20 17:18:13 -04:00
search Components: Add a search component based on Autocomplete (https://github.com/woocommerce/woocommerce-admin/pull/322) 2018-08-28 15:15:24 -04:00
segmented-selection Segmented-selection: remove focus outline in favor of inset box-shadow 2018-08-30 08:21:59 +12:00
split-button Add Collapsed Review View (https://github.com/woocommerce/woocommerce-admin/pull/242) 2018-08-01 08:21:51 -04:00
summary Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
table Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
tag Components: Add a search component based on Autocomplete (https://github.com/woocommerce/woocommerce-admin/pull/322) 2018-08-28 15:15:24 -04:00
README.md Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297) 2018-08-20 17:18:13 -04:00
index.js Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00

README.md

Components

This folder contains the WooCommerce-created components. These are exported onto a global, wc.components, for general use.

How to use:

For any files not imported into components/index.js (analytics/*, layout/*, dashboard/*, etc), we can use import { Card, etc … } from @woocommerce/components.

For any component/* files, we should import from component-specific paths, not from component/index.js, to prevent circular dependencies. See components/card/index.js for an example.

import { Card, Link } from '@woocommerce/components';

render: function() {
  return (
    <Card title="Card demo">
      Card content with an <Link href="/">example link.</Link>
    </Card>
  );
}

For external development

External developers will need to enqueue the components library, wc-components, and then can access them from the global.

const { Card, Link } = wc.components;

render: function() {
  return (
    <Card title="Card demo">
      Card content with an <Link href="/">example link.</Link>
    </Card>
  );
}