From 8d0cec9bf8a7de886a868a0847ae707d2d89ae3f Mon Sep 17 00:00:00 2001 From: David Conner Date: Tue, 2 Jul 2019 23:28:15 -0400 Subject: [PATCH] fix(accordionItem): fixed naming for accordionItem component --- .../example/src/pages/components/Accordion.mdx | 16 ++++++++-------- packages/gatsby-theme-carbon/index.js | 2 +- .../src/components/Accordion/AccordionItem.js | 11 +++++++++++ .../src/components/Accordion/AccordionItems.js | 12 ------------ .../src/components/Accordion/index.js | 2 +- 5 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 packages/gatsby-theme-carbon/src/components/Accordion/AccordionItem.js delete mode 100644 packages/gatsby-theme-carbon/src/components/Accordion/AccordionItems.js diff --git a/packages/example/src/pages/components/Accordion.mdx b/packages/example/src/pages/components/Accordion.mdx index c933d3ff7..26539d30a 100644 --- a/packages/example/src/pages/components/Accordion.mdx +++ b/packages/example/src/pages/components/Accordion.mdx @@ -4,16 +4,16 @@ title: Accordion -The `` and `` components are used together to display a list of content sections that can be toggled open by clicking the respective title of each section. +The `` and `` components are used together to display a list of content sections that can be toggled open by clicking the respective title of each section. ## Example - Title 1)}>Content Section - Content Section - Content Section + Title 1)}>Content Section + Content Section + Content Section @@ -23,9 +23,9 @@ The `` and `` components are used together to display ``` - Content Section - Content Section - Content Section + Content Section + Content Section + Content Section ``` @@ -37,7 +37,7 @@ The `` and `` components are used together to display | children | node | | | Pass in the children that will be rendered within the Accordion | | className | string | | | Specify an optional className to be applied to the container node | -### `AccordionItems` Props +### `AccordionItem` Props | property | propType | required | default | description | | --------------- | -------- | -------- | -------------- ----------------| ----------------------------------------------------------------------------------- | diff --git a/packages/gatsby-theme-carbon/index.js b/packages/gatsby-theme-carbon/index.js index 0aaf77551..25bdfb32f 100644 --- a/packages/gatsby-theme-carbon/index.js +++ b/packages/gatsby-theme-carbon/index.js @@ -1,5 +1,5 @@ // Generic MDX Components -export { Accordion, AccordionItems } from './src/components/Accordion'; +export { Accordion, AccordionItem } from './src/components/Accordion'; export { AnchorLinks, AnchorLink } from './src/components/AnchorLinks'; export { default as PageDescription } from './src/components/PageDescription'; export { default as Video } from './src/components/Video/Video'; diff --git a/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItem.js b/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItem.js new file mode 100644 index 000000000..842ce0df0 --- /dev/null +++ b/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItem.js @@ -0,0 +1,11 @@ +import React from 'react'; +import cx from 'classnames'; +import { AccordionItem as CarbonAccordionItem } from 'carbon-components-react'; + +const AccordionItem = ({ className, children, ...rest }) => ( + + {children} + +); + +export default AccordionItem; diff --git a/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItems.js b/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItems.js deleted file mode 100644 index 299e02163..000000000 --- a/packages/gatsby-theme-carbon/src/components/Accordion/AccordionItems.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import cx from 'classnames'; -import { AccordionItem } from 'carbon-components-react'; -import { accordionItems } from './Accordion.module.scss'; - -const Accordion = ({ className, children, ...rest }) => ( - - {children} - -); - -export default Accordion; diff --git a/packages/gatsby-theme-carbon/src/components/Accordion/index.js b/packages/gatsby-theme-carbon/src/components/Accordion/index.js index 7f6e1562e..27d0e2c9c 100644 --- a/packages/gatsby-theme-carbon/src/components/Accordion/index.js +++ b/packages/gatsby-theme-carbon/src/components/Accordion/index.js @@ -1,2 +1,2 @@ export { default as Accordion } from './Accordion'; -export { default as AccordionItems } from './AccordionItems'; +export { default as AccordionItem } from './AccordionItem';