+ );
}
-export class StructuredListHead extends Component {
- static propTypes = {
- /**
- * Provide the contents of your StructuredListHead
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the node
- */
- className: PropTypes.string,
- };
-
- render() {
- const { children, className, ...other } = this.props;
-
- const classes = classNames(`${prefix}--structured-list-thead`, className);
- return (
-
- {children}
-
- );
- }
+StructuredListWrapper.propTypes = {
+ /**
+ * Specify a label to be read by screen readers on the container node
+ */
+ ariaLabel: PropTypes.string,
+
+ /**
+ * Specify whether a border should be added to your StructuredListWrapper
+ */
+ border: deprecate(
+ PropTypes.bool,
+ `\nThe prop \`border\` will be removed in the next major version of Carbon.`
+ ),
+
+ /**
+ * Provide the contents of your StructuredListWrapper
+ */
+ children: PropTypes.node,
+
+ /**
+ * Specify an optional className to be applied to the container node
+ */
+ className: PropTypes.string,
+
+ /**
+ * Specify whether your StructuredListWrapper should have selections
+ */
+ selection: PropTypes.bool,
+};
+
+StructuredListWrapper.defaultProps = {
+ selection: false,
+ ariaLabel: 'Structured list section',
+};
+
+export function StructuredListHead(props) {
+ const { children, className, ...other } = props;
+ const classes = classNames(`${prefix}--structured-list-thead`, className);
+
+ return (
+
+ {children}
+
+ );
}
-const getInstanceId = setupGetInstanceId();
-
-export class StructuredListInput extends Component {
- static propTypes = {
- /**
- * Specify an optional className to be applied to the input
- */
- className: PropTypes.string,
-
- /**
- * Specify whether the underlying input should be checked by default
- */
- defaultChecked: PropTypes.bool,
-
- /**
- * Specify a custom `id` for the input
- */
- id: PropTypes.string,
-
- /**
- * Provide a `name` for the input
- */
- name: PropTypes.string,
-
- /**
- * Provide an optional hook that is called each time the input is updated
- */
- onChange: PropTypes.func,
-
- /**
- * Provide a `title` for the input
- */
- title: PropTypes.string,
-
- /**
- * Specify the value of the input
- */
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
- };
-
- static defaultProps = {
- onChange: () => {},
- value: 'value',
- title: 'title',
- };
-
- constructor(props) {
- super(props);
- this.uid = this.props.id || getInstanceId();
- }
-
- render() {
- const { className, value, name, title, ...other } = this.props;
- const classes = classNames(`${prefix}--structured-list-input`, className);
- return (
-
- );
- }
+StructuredListHead.propTypes = {
+ /**
+ * Provide the contents of your StructuredListHead
+ */
+ children: PropTypes.node,
+
+ /**
+ * Specify an optional className to be applied to the node
+ */
+ className: PropTypes.string,
+};
+
+export function StructuredListBody(props) {
+ const { children, className, ...other } = props;
+ const classes = classNames(`${prefix}--structured-list-tbody`, className);
+
+ return (
+
+ {children}
+
+ );
}
-export class StructuredListRow extends Component {
- static propTypes = {
- /**
- * Provide the contents of your StructuredListRow
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify whether your StructuredListRow should be used as a header row
- */
- head: PropTypes.bool,
-
- /**
- * Specify whether a `