forked from carbon-design-system/ibm-products
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exporting description list child components (carbon-design-syste…
- Loading branch information
1 parent
ed3f912
commit b0e84bf
Showing
7 changed files
with
164 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/ibm-products/src/components/DescriptionList/DescriptionListBody.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright IBM Corp. 2024, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// Import portions of React that are needed. | ||
import React from 'react'; | ||
// Other standard imports. | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
|
||
import { getDevtoolsProps } from '../../global/js/utils/devtools'; | ||
import { pkg /*, carbon */ } from '../../settings'; | ||
// Carbon and package components we use. | ||
import { StructuredListBody } from '@carbon/react'; | ||
|
||
// The block part of our conventional BEM class names (blockClass__E--M). | ||
const blockClass = `${pkg.prefix}--description-list__body`; | ||
const componentName = 'DescriptionListBody'; | ||
|
||
export let DescriptionListBody = React.forwardRef( | ||
({ children /* TODO: remove if not needed. */, className, ...rest }, ref) => { | ||
return ( | ||
<StructuredListBody | ||
className={cx(blockClass, className)} | ||
ref={ref} | ||
{...getDevtoolsProps(componentName)} | ||
{...rest} | ||
> | ||
{children} | ||
</StructuredListBody> | ||
); | ||
} | ||
); | ||
|
||
DescriptionListBody.propTypes = { | ||
/** Provide the contents of the node */ | ||
children: PropTypes.node, | ||
/** Provide an optional class to be applied to the containing node */ | ||
className: PropTypes.string, | ||
}; | ||
DescriptionListBody = pkg.checkComponentEnabled( | ||
DescriptionListBody, | ||
componentName | ||
); | ||
DescriptionListBody.displayName = componentName; |
48 changes: 48 additions & 0 deletions
48
packages/ibm-products/src/components/DescriptionList/DescriptionListCell.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright IBM Corp. 2024, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// Import portions of React that are needed. | ||
import React from 'react'; | ||
// Other standard imports. | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
|
||
import { getDevtoolsProps } from '../../global/js/utils/devtools'; | ||
import { pkg /*, carbon */ } from '../../settings'; | ||
// Carbon and package components we use. | ||
import { StructuredListCell } from '@carbon/react'; | ||
|
||
// The block part of our conventional BEM class names (blockClass__E--M). | ||
const blockClass = `${pkg.prefix}--description-list__cell`; | ||
const componentName = 'DescriptionListCell'; | ||
|
||
export let DescriptionListCell = React.forwardRef( | ||
({ children /* TODO: remove if not needed. */, className, ...rest }, ref) => { | ||
return ( | ||
<StructuredListCell | ||
className={cx(blockClass, className)} | ||
ref={ref} | ||
{...getDevtoolsProps(componentName)} | ||
{...rest} | ||
> | ||
{children} | ||
</StructuredListCell> | ||
); | ||
} | ||
); | ||
|
||
DescriptionListCell.propTypes = { | ||
/** Provide the contents of the node */ | ||
children: PropTypes.node, | ||
/** Provide an optional class to be applied to the containing node */ | ||
className: PropTypes.string, | ||
}; | ||
DescriptionListCell = pkg.checkComponentEnabled( | ||
DescriptionListCell, | ||
componentName | ||
); | ||
DescriptionListCell.displayName = componentName; |
49 changes: 49 additions & 0 deletions
49
packages/ibm-products/src/components/DescriptionList/DescriptionListRow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright IBM Corp. 2024, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// Import portions of React that are needed. | ||
import React from 'react'; | ||
// Other standard imports. | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
|
||
import { getDevtoolsProps } from '../../global/js/utils/devtools'; | ||
import { pkg /*, carbon */ } from '../../settings'; | ||
// Carbon and package components we use. | ||
import { StructuredListRow } from '@carbon/react'; | ||
|
||
// The block part of our conventional BEM class names (blockClass__E--M). | ||
const blockClass = `${pkg.prefix}--description-list__row`; | ||
const componentName = 'DescriptionListRow'; | ||
|
||
export let DescriptionListRow = React.forwardRef( | ||
({ children /* TODO: remove if not needed. */, className, ...rest }, ref) => { | ||
return ( | ||
<StructuredListRow | ||
className={cx(blockClass, className)} | ||
// role="row" | ||
ref={ref} | ||
{...getDevtoolsProps(componentName)} | ||
{...rest} | ||
> | ||
{children} | ||
</StructuredListRow> | ||
); | ||
} | ||
); | ||
|
||
DescriptionListRow.propTypes = { | ||
/** Provide the contents of the node */ | ||
children: PropTypes.node, | ||
/** Provide an optional class to be applied to the containing node */ | ||
className: PropTypes.string, | ||
}; | ||
DescriptionListRow = pkg.checkComponentEnabled( | ||
DescriptionListRow, | ||
componentName | ||
); | ||
DescriptionListRow.displayName = componentName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters