From d015127e967124086d3cbb99ec6e8c670b541998 Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Wed, 25 Oct 2023 11:55:58 -0400 Subject: [PATCH 1/7] initial setup --- .../terra-compact-interactive-list/.npmignore | 9 + .../terra-compact-interactive-list/.npmrc | 1 + .../CHANGELOG.md | 5 + .../terra-compact-interactive-list/LICENSE | 203 ++++++++++++++++++ .../terra-compact-interactive-list/NOTICE | 13 ++ .../terra-compact-interactive-list/README.md | 43 ++++ .../package.json | 55 +++++ .../src/CompactInteractiveList.jsx | 75 +++++++ .../src/CompactInteractiveList.module.scss | 28 +++ .../CompactInteractiveList.module.scss | 7 + .../CompactInteractiveList.module.scss | 7 + .../src/proptypes/cellShape.js | 20 ++ .../src/proptypes/columnShape.js | 30 +++ .../src/proptypes/rowShape.js | 22 ++ .../src/proptypes/validators.js | 18 ++ .../src/utils/constants.js | 8 + .../jest/CompactInteractiveList.test.jsx | 24 +++ .../CompactInteractiveList.test.jsx.snap | 15 ++ .../default_compact_interactive_list.png | Bin 0 -> 7768 bytes .../default_compact_interactive_list.png | Bin 0 -> 7281 bytes .../wdio/compact-interactive-list-spec.js | 11 + .../translations/en-US.json | 4 + .../translations/en.json | 4 + packages/terra-framework-docs/package.json | 1 + .../compact-interactive-list/About.1.doc.mdx | 45 ++++ .../ChangeLog.3.doc.mdx | 7 + .../DefaultCompactInteractiveList.1.doc.mdx | 3 + .../DefaultCompactInteractiveList.jsx | 8 + .../DefaultCompactInteractiveList.test.jsx | 8 + packages/terra-table/README.md | 2 +- packages/terra-table/package.json | 4 +- 31 files changed, 677 insertions(+), 3 deletions(-) create mode 100644 packages/terra-compact-interactive-list/.npmignore create mode 100644 packages/terra-compact-interactive-list/.npmrc create mode 100644 packages/terra-compact-interactive-list/CHANGELOG.md create mode 100644 packages/terra-compact-interactive-list/LICENSE create mode 100644 packages/terra-compact-interactive-list/NOTICE create mode 100644 packages/terra-compact-interactive-list/README.md create mode 100644 packages/terra-compact-interactive-list/package.json create mode 100644 packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx create mode 100644 packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss create mode 100644 packages/terra-compact-interactive-list/src/clinical-lowlight-theme/CompactInteractiveList.module.scss create mode 100644 packages/terra-compact-interactive-list/src/orion-fusion-theme/CompactInteractiveList.module.scss create mode 100644 packages/terra-compact-interactive-list/src/proptypes/cellShape.js create mode 100644 packages/terra-compact-interactive-list/src/proptypes/columnShape.js create mode 100644 packages/terra-compact-interactive-list/src/proptypes/rowShape.js create mode 100644 packages/terra-compact-interactive-list/src/proptypes/validators.js create mode 100644 packages/terra-compact-interactive-list/src/utils/constants.js create mode 100644 packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx create mode 100644 packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap create mode 100644 packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_large/compact-interactive-list-spec/default_compact_interactive_list.png create mode 100644 packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_medium/compact-interactive-list-spec/default_compact_interactive_list.png create mode 100644 packages/terra-compact-interactive-list/tests/wdio/compact-interactive-list-spec.js create mode 100644 packages/terra-compact-interactive-list/translations/en-US.json create mode 100644 packages/terra-compact-interactive-list/translations/en.json create mode 100644 packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/About.1.doc.mdx create mode 100644 packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/ChangeLog.3.doc.mdx create mode 100644 packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.1.doc.mdx create mode 100644 packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.jsx create mode 100644 packages/terra-framework-docs/src/terra-dev-site/test/compact-interactive-list/DefaultCompactInteractiveList.test.jsx diff --git a/packages/terra-compact-interactive-list/.npmignore b/packages/terra-compact-interactive-list/.npmignore new file mode 100644 index 00000000000..4964b68f07d --- /dev/null +++ b/packages/terra-compact-interactive-list/.npmignore @@ -0,0 +1,9 @@ +*.log +target +reports +tests/**/__snapshots__/ +aggregated-translations +dev-site-config +screenshots +errorScreenshots +generated-themes \ No newline at end of file diff --git a/packages/terra-compact-interactive-list/.npmrc b/packages/terra-compact-interactive-list/.npmrc new file mode 100644 index 00000000000..43c97e719a5 --- /dev/null +++ b/packages/terra-compact-interactive-list/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/packages/terra-compact-interactive-list/CHANGELOG.md b/packages/terra-compact-interactive-list/CHANGELOG.md new file mode 100644 index 00000000000..100d5823157 --- /dev/null +++ b/packages/terra-compact-interactive-list/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## Unreleased + +* Initial package release. \ No newline at end of file diff --git a/packages/terra-compact-interactive-list/LICENSE b/packages/terra-compact-interactive-list/LICENSE new file mode 100644 index 00000000000..f4f87bd4ed6 --- /dev/null +++ b/packages/terra-compact-interactive-list/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + \ No newline at end of file diff --git a/packages/terra-compact-interactive-list/NOTICE b/packages/terra-compact-interactive-list/NOTICE new file mode 100644 index 00000000000..46468f3a66e --- /dev/null +++ b/packages/terra-compact-interactive-list/NOTICE @@ -0,0 +1,13 @@ +Copyright 2017 - 2019 Cerner Innovation, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/terra-compact-interactive-list/README.md b/packages/terra-compact-interactive-list/README.md new file mode 100644 index 00000000000..1e0c2cc2512 --- /dev/null +++ b/packages/terra-compact-interactive-list/README.md @@ -0,0 +1,43 @@ +# Terra Compact Interactive List + +[![NPM version](https://badgen.net/npm/v/terra-compact-interactive-list)](https://www.npmjs.org/package/terra-compact-interactive-list) +[![Build Status](https://badgen.net/travis/cerner/terra-framework)](https://travis-ci.com/cerner/terra-framework) + +--- +### Notice + +> Terra Compact Interactive List is currently under alpha release. There may be breaking changes between releases until it is stable with the 1.0 release. +--- + +The Compact Interactive List component provides users a way to render a collection of interactive data in a list format into a single tab stop. The list can be arranged in columns to fit wide space, and the user can navigate between them with the arrow keys. + +- [Getting Started](#getting-started) +- [Documentation](https://engineering.cerner.com/terra-ui/components/cerner-terra-framework-docs/compact-interactive-list/about) +- [LICENSE](#license) + +## Getting Started + +- Install from [npmjs](https://www.npmjs.com): `npm install terra-compact-interactive-list` + + +## Peer Dependencies + +This component requires the following peer dependencies be installed in your app for the component to properly function. + +| Peer Dependency | Version | +|-|-| +| react | ^16.8.5 | +| react-dom | ^16.8.5 | +| react-intl | ^2.8.0 | + + + +## LICENSE + +Copyright 2017 - 2019 Cerner Innovation, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +    http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/packages/terra-compact-interactive-list/package.json b/packages/terra-compact-interactive-list/package.json new file mode 100644 index 00000000000..2ce5a59cb70 --- /dev/null +++ b/packages/terra-compact-interactive-list/package.json @@ -0,0 +1,55 @@ +{ + "name": "terra-compact-interactive-list", + "main": "lib/compactInteractiveList.js", + "version": "0.1.0", + "description": "The Terra Compact Interactive List component provides users a way to render a collection of interactive data in a list format into a single tab stop.", + "repository": { + "type": "git", + "url": "git+https://github.com/cerner/terra-framework.git", + "directory": "packages/terra-compact-interactive-list" + }, + "keywords": [ + "Cerner", + "Terra", + "Framework", + "terra-compact-interactive-list", + "compact-interactive-list", + "List", + "UI" + ], + "author": "Cerner Corporation", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/cerner/terra-framework/issues" + }, + "homepage": "https://github.com/cerner/terra-framework#readme", + "peerDependencies": { + "react": "^16.8.5", + "react-dom": "^16.8.5", + "react-intl": "2 || 3 || 4 || 5" + }, + "dependencies": { + "classnames": "^2.2.5", + "keycode-js": "^3.1.0", + "prop-types": "^15.5.8", + "terra-theme-context": "^1.0.0" + }, + "scripts": { + "clean:install": "npm run clean && time npm install", + "clean:lib": "rm -rf lib", + "clean:node_modules": "echo 'removing ./node_modules' && rm -rf node_modules && echo 'removed ./node_modules'", + "clean": "npm run clean:node_modules && npm run clean:lib", + "compile": "babel --root-mode upward src --out-dir lib --copy-files", + "lint": "npm run lint:js && npm run lint:scss", + "lint:js": "eslint --ext .js,.jsx . --ignore-path ../../.eslintignore", + "lint:js:fix": "eslint --ext .js,.jsx . --fix --ignore-path ../../.eslintignore", + "lint:scss": "stylelint src/**/*.scss", + "precompile": "rm -rf lib", + "test": "npm run lint && npm run jest && npm run wdio", + "jest": "jest --config ../../jest.config.js", + "wdio-default": "cd ../.. && terra wdio", + "wdio-lowlight": "cd ../.. && terra wdio --themes clinical-lowlight-theme", + "wdio-fusion": "cd ../.. && terra wdio --themes orion-fusion-theme", + "wdio": "npm run wdio-default && npm run wdio-lowlight && npm run wdio-fusion" + } +} diff --git a/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx new file mode 100644 index 00000000000..4e5f2f69169 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx @@ -0,0 +1,75 @@ +import React, { useContext } from 'react'; +import PropTypes from 'prop-types'; +import { injectIntl } from 'react-intl'; +import classNames from 'classnames/bind'; +import ThemeContext from 'terra-theme-context'; +import styles from './CompactInteractiveList.module.scss'; + +const cx = classNames.bind(styles); + +const propTypes = { + /** + * String that will be used to identify the table. If multiple tables are on the same page, each table should have + * a unique id. + */ + id: PropTypes.string.isRequired, + + /** + * String that identifies the element (or elements) that labels the table. + */ + ariaLabelledBy: PropTypes.string, + + /** + * String that labels the table for accessibility. If ariaLabelledBy is specified, ariaLabel will not be used. + */ + ariaLabel: PropTypes.string, + + /** + * Boolean indicating whether or not the table columns should be displayed. Setting the value to false will hide the columns, + * but the voice reader will use the column header values for a11y. + */ + hasColumnHeaders: PropTypes.bool, +}; + +const defaultProps = { + hasColumnHeaders: true, +}; + +// const defaultColumnMinimumWidth = 60; +// const defaultColumnMaximumWidth = 300; + +const CompactInteractiveList = (props) => { + const { + id, + ariaLabelledBy, + ariaLabel, + hasColumnHeaders, + } = props; + + const theme = useContext(ThemeContext); + + return ( +
+
+
+
This is the placeholder div
+
+
+
+ ); +}; + +CompactInteractiveList.propTypes = propTypes; +CompactInteractiveList.defaultProps = defaultProps; + +export default injectIntl(CompactInteractiveList); diff --git a/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss b/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss new file mode 100644 index 00000000000..40936e0d1dc --- /dev/null +++ b/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss @@ -0,0 +1,28 @@ +@import './clinical-lowlight-theme/CompactInteractiveList.module'; +@import './orion-fusion-theme/CompactInteractiveList.module'; + +:local { + .compact-interactive-list-container { + height: 100%; + overflow: auto; + width: 100%; + } + + .compact-interactive-list { + :focus { + outline: var(--terra-compact-interactive-list-cell-focus-outline, 3px dashed #000); + outline-offset: var(--terra-compact-interactive-list-cell-focus-outline-offset, -2px); + } + } + + /* stylelint-disable selector-max-compound-selectors */ + // TODO - this needs to be adjusted to new div structure rather than td and tr + .headerless { + tr:first-child { + td, + th { + border-top: var(--terra-compact-interactive-list-headerless-first-row-border-top, 1px solid #dedfe0); + } + } + } +} diff --git a/packages/terra-compact-interactive-list/src/clinical-lowlight-theme/CompactInteractiveList.module.scss b/packages/terra-compact-interactive-list/src/clinical-lowlight-theme/CompactInteractiveList.module.scss new file mode 100644 index 00000000000..da5807badee --- /dev/null +++ b/packages/terra-compact-interactive-list/src/clinical-lowlight-theme/CompactInteractiveList.module.scss @@ -0,0 +1,7 @@ +:local { + .clinical-lowlight-theme { + --terra-compact-interactive-list-cell-focus-outline: 3px dashed #fff; + --terra-compact-interactive-list-cell-focus-outline-offset: -2px; + --terra-compact-interactive-list-headerless-first-row-border-top: 1px solid #181b1d; + } +} diff --git a/packages/terra-compact-interactive-list/src/orion-fusion-theme/CompactInteractiveList.module.scss b/packages/terra-compact-interactive-list/src/orion-fusion-theme/CompactInteractiveList.module.scss new file mode 100644 index 00000000000..a51dbcff2f7 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/orion-fusion-theme/CompactInteractiveList.module.scss @@ -0,0 +1,7 @@ +:local { + .orion-fusion-theme { + --terra-compact-interactive-list-cell-focus-outline: 3px dashed #000; + --terra-compact-interactive-list-cell-focus-outline-offset: -2px; + --terra-compact-interactive-list-headerless-first-row-border-top: 1px solid #c8cacb; + } +} diff --git a/packages/terra-compact-interactive-list/src/proptypes/cellShape.js b/packages/terra-compact-interactive-list/src/proptypes/cellShape.js new file mode 100644 index 00000000000..de65f5aba22 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/proptypes/cellShape.js @@ -0,0 +1,20 @@ +import PropTypes from 'prop-types'; + +const cellShape = PropTypes.shape({ + /** + * Content that will be rendered within the Cell. + */ + content: PropTypes.node, + /** + * @private + * Boolean value indicating whether or not the column header is selectable. + */ + isSelectable: PropTypes.bool, + /** + * @private + * Boolean value indicating whether or not the cell should render as selected. + */ + isSelected: PropTypes.bool, +}); + +export default cellShape; diff --git a/packages/terra-compact-interactive-list/src/proptypes/columnShape.js b/packages/terra-compact-interactive-list/src/proptypes/columnShape.js new file mode 100644 index 00000000000..178aac1af56 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/proptypes/columnShape.js @@ -0,0 +1,30 @@ +import PropTypes from 'prop-types'; + +const columnShape = PropTypes.shape({ + /** + * Required string representing a unique identifier for the column. + */ + id: PropTypes.string.isRequired, + /** + * String of text to render within the column header cell. + */ + displayName: PropTypes.string, + /** + * Boolean value indicating whether or not the column has an error in the data. + */ + hasError: PropTypes.bool, + /** + * Number that specifies the minimum column width in pixels. + */ + minimumWidth: PropTypes.number, + /** + * Number that specifies the maximum column width in pixels. + */ + maximumWidth: PropTypes.number, + /** + * A number (in px) specifying the width of the column. If not provided, the Table's default column width will be used. + */ + width: PropTypes.number, +}); + +export default columnShape; diff --git a/packages/terra-compact-interactive-list/src/proptypes/rowShape.js b/packages/terra-compact-interactive-list/src/proptypes/rowShape.js new file mode 100644 index 00000000000..0f86898c41a --- /dev/null +++ b/packages/terra-compact-interactive-list/src/proptypes/rowShape.js @@ -0,0 +1,22 @@ +import PropTypes from 'prop-types'; +import cellShape from './cellShape'; + +const rowShape = PropTypes.shape({ + /** + * An identifier to uniquely identify the row within the table. + */ + id: PropTypes.string.isRequired, + + /** + * Data to be displayed in the cells of the row. Cells will be rendered in the row in the order given. + */ + cells: PropTypes.arrayOf(cellShape), + /** + * A string identifier used to describe the row contents. This value will be used to construct additional labels + * for internal controls (e.g. row selection cells). + */ + ariaLabel: PropTypes.string, + +}); + +export default rowShape; diff --git a/packages/terra-compact-interactive-list/src/proptypes/validators.js b/packages/terra-compact-interactive-list/src/proptypes/validators.js new file mode 100644 index 00000000000..79bb98c3cd7 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/proptypes/validators.js @@ -0,0 +1,18 @@ +import ERRORS from '../utils/constants'; + +// eslint-disable-next-line consistent-return +const validateRowHeaderIndex = (props) => { + if (!Number.isInteger(props.rowHeaderIndex)) { + return new Error(ERRORS.ROW_HEADER_INDEX_NOT_AN_INTEGER); + } + + if (props.rowHeaderIndex < 0) { + return new Error(ERRORS.ROW_HEADER_INDEX_LESS_THAN_ZERO); + } + + if (props.pinnedColumns.length && props.rowHeaderIndex >= props.pinnedColumns.length) { + return new Error(ERRORS.ROW_HEADER_INDEX_EXCEEDS_PINNED); + } +}; + +export default validateRowHeaderIndex; diff --git a/packages/terra-compact-interactive-list/src/utils/constants.js b/packages/terra-compact-interactive-list/src/utils/constants.js new file mode 100644 index 00000000000..ccccc39b608 --- /dev/null +++ b/packages/terra-compact-interactive-list/src/utils/constants.js @@ -0,0 +1,8 @@ +const ERRORS = { + ROW_HEADER_INDEX_EXCEEDS_COLUMNS: 'Prop rowHeaderIndex exceeds the size of columns.', + ROW_HEADER_INDEX_LESS_THAN_ZERO: 'Prop rowHeaderIndex must be a positive integer.', + ROW_HEADER_INDEX_NOT_AN_INTEGER: 'Prop rowHeaderIndex must be an integer.', + COLUMNS_UNDEFINED: 'Tthe column data should be provided.', +}; + +export default ERRORS; diff --git a/packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx b/packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx new file mode 100644 index 00000000000..bf639e1aedc --- /dev/null +++ b/packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx @@ -0,0 +1,24 @@ +import React from 'react'; +/* eslint-disable-next-line import/no-extraneous-dependencies */ +import { shallowWithIntl } from 'terra-enzyme-intl'; +import CompactInteractiveList from '../../src/CompactInteractiveList'; + +beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(); + jest.spyOn(console, 'warn').mockImplementation(); +}); + +afterAll(() => { + console.error.mockRestore(); // eslint-disable-line no-console + console.warn.mockRestore(); // eslint-disable-line no-console +}); + +describe('placeholder for tests', () => { + it('placeholder for a test', () => { + const wrapper = shallowWithIntl( + , + ).dive(); + + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap b/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap new file mode 100644 index 00000000000..613e10d72db --- /dev/null +++ b/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`placeholder for tests placeholder for a test 1`] = ` +
+
+ This is the placeholder div +
+
+`; diff --git a/packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_large/compact-interactive-list-spec/default_compact_interactive_list.png b/packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_large/compact-interactive-list-spec/default_compact_interactive_list.png new file mode 100644 index 0000000000000000000000000000000000000000..886015bb6bc102661958aa93f166d4d00662c2c0 GIT binary patch literal 7768 zcmeHM`B#%?+NPz-OciL4M<{z46sF1|FcKn5R20TRh}8mCC1r*>iVgTjg9@0KOZ`7V`DoH{%n4?864?)l(5Cd#?$M_p#$IKeWV!p z{lhOlDfD|IGj1E%LcDX;?Qb8S?b+RZ>f=qqW3BE7KDqv7=HX*bpMAQ$vvvQUyAOQE zI`oO+^yk}`{#yC?#%KGFJ=kAubFcNiw@!2Z!p?6#JHJ$+Bb7RZD4FFOvo(Z&=km#|W4nybH?dEjnV2$z|aUtIP=6hSs4_Bt?ah}8- z!wFDtCR)g0phg+%Ik*u7rm?CVG9A8q%Id`{whkk94*6tH;%t>WME)c1c9h>}ZNTX2 z6x$m^BgTeJ=gqXtp8y&u!c!*kH%aEX+ZPB60Wu-J)X5$gxmzLNE#O9;KR=cjA^%ws zOvKlc&Z{IxX*tK|Bw2B_{)n4Vz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%AkHA+862f zJ_i3DHG{@R8T)sO5Zj}=Db11Y{O9C@|C-zdj_mKT_FK=}HirM@unnJV0Ahm;|CWyp zHf*qAgAE&O04s?NDcF#L4Jp`=f(AZP#p literal 0 HcmV?d00001 diff --git a/packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_medium/compact-interactive-list-spec/default_compact_interactive_list.png b/packages/terra-compact-interactive-list/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_medium/compact-interactive-list-spec/default_compact_interactive_list.png new file mode 100644 index 0000000000000000000000000000000000000000..9a58b6aea87e90e52145e937ba2366a5d53157c3 GIT binary patch literal 7281 zcmeHLX;f2Lx{XaKWm^>Oaw#HHTc{L+AVh@_NQzRRZ75KALZz4-2(c6hBtnb~DMuWT zpiu$@NLhA?7LyDzCQyhngycp_A%rPPCWeqm0tq1@c{ldz)vJ50_y7IiN6wF%bIv{A zKKt9>{_d@#VZj!E-tlJ$1Y&XIZ-*5}CKfd9F;ZoZ4y zxcxJt(;I>AbJ2Ci_uXIaURPJP+4kV&E9aj^7XI~5fdx%peQoyn_1nJH-~4SP;4l2c zpUJwua+&gSPu{unr=O2s-m~uS(VI74e(n);rHFBD*IWI9Bmwu$Y3eoHkVRkn+l4=Iml@Uw9U(rYUvZ4|BP*Xp;%_mSR}XDTQm z?z$KQ$!9?nfg8!qXOmv|YbKqjG3r)*W+*)^wrN~qL3Ac9d?1TPgcYJr)`|F5U&^E* z-_1L_C!LR@d4C3h#PtW+;igZurbw2E&VuF9AtH?KH@5{vVlF9ZDT@KETAZB{ zhGj5RQxd94Ah&?cv7z;YK{n_>y03;|is8v`N)0cD7LC>B6h=3m^$E65zmOP5I&|a4 z4cw@+6PnylX&66*mnP0OQoN-3@cM-Q`!Y|WrWE(bEo*3EXrvlkPI(LXKyw{3&UR!C zMJY!flf{;VNf2RORh~UFD6$b;Q<|=JQgN^(r_Lg8k6OO$04!~GBT+@0d>}3-8MLJr zSkGG3qcf=FcTYcU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M76usyna}k+}hmVc=zN*`g9zD`8p{WU=XT@oyNV;8`jcpJ4*B# zw2EM9rFaS3inWXDrR%}=VB?0uRoX|=cVItZPzrk`a<~*^`}8Bw_`it(C;Z%c?1Qmx ztfoDoIhL>yd>H)cA=p}dgWn2vHj@ADY}P>_XKVhwdTru=HhydHfRtJz#TqI0gT3II zQmm!Ie|;ERBgL9Nu6c@2--y>zVJ#KbQeiC>{?&-Bx#s@|u33jvWgg!99b)%(keHAo NfnkShzCC&6e*x_6zB~W` literal 0 HcmV?d00001 diff --git a/packages/terra-compact-interactive-list/tests/wdio/compact-interactive-list-spec.js b/packages/terra-compact-interactive-list/tests/wdio/compact-interactive-list-spec.js new file mode 100644 index 00000000000..41816680299 --- /dev/null +++ b/packages/terra-compact-interactive-list/tests/wdio/compact-interactive-list-spec.js @@ -0,0 +1,11 @@ +Terra.describeViewports('CompactInteractiveList', ['medium', 'large'], () => { + describe('placeholder', () => { + beforeEach(() => { + browser.url('/raw/tests/cerner-terra-framework-docs/compact-interactive-list/default-compact-interactive-list'); + }); + + it('placeholder', () => { + Terra.validates.element('default compact interactive list'); + }); + }); +}); diff --git a/packages/terra-compact-interactive-list/translations/en-US.json b/packages/terra-compact-interactive-list/translations/en-US.json new file mode 100644 index 00000000000..a9b0b46a9f8 --- /dev/null +++ b/packages/terra-compact-interactive-list/translations/en-US.json @@ -0,0 +1,4 @@ +{ + "Terra.compactInteractiveList.columnError": "Errors associated with column", + "Terra.compactInteractiveList.rowIndex" : "Row {row}" +} diff --git a/packages/terra-compact-interactive-list/translations/en.json b/packages/terra-compact-interactive-list/translations/en.json new file mode 100644 index 00000000000..a9b0b46a9f8 --- /dev/null +++ b/packages/terra-compact-interactive-list/translations/en.json @@ -0,0 +1,4 @@ +{ + "Terra.compactInteractiveList.columnError": "Errors associated with column", + "Terra.compactInteractiveList.rowIndex" : "Row {row}" +} diff --git a/packages/terra-framework-docs/package.json b/packages/terra-framework-docs/package.json index db6129779ee..5f6a6867717 100644 --- a/packages/terra-framework-docs/package.json +++ b/packages/terra-framework-docs/package.json @@ -42,6 +42,7 @@ "terra-brand-footer": "^3.11.0", "terra-button": "^3.3.0", "terra-collapsible-menu-view": "^6.82.0", + "terra-compact-interactive-list": "^0.1.0", "terra-content-container": "^3.0.0", "terra-data-grid": "^0.8.1", "terra-date-input": "^1.46.0", diff --git a/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/About.1.doc.mdx b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/About.1.doc.mdx new file mode 100644 index 00000000000..c5bcadda86f --- /dev/null +++ b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/About.1.doc.mdx @@ -0,0 +1,45 @@ +import { Notice } from "@cerner/terra-docs"; +import { Badge } from 'terra-file-path/package.json?dev-site-package'; + +import CompactInteractiveListPropsTable from 'terra-compact-interactive-list/src/CompactInteractiveList?dev-site-props-table'; + +import DefaultCompactInteractiveList from './Examples.2/DefaultCompactInteractiveList?dev-site-example'; + +# Terra CompactInteractiveList + + +Terra Compact Interactive List is currently under alpha release. There may be breaking changes between releases until it is stable with the 1.0 release. + + +The `terra-compact-interactive-list` component provides users a way to render a collection of interactive data in a list format into a single tab stop. The list can be arranged in columns to fit wide space, and the user can navigate between them with the arrow keys. + +## Getting Started + +- Install with [npmjs](https://www.npmjs.com): + - `npm install terra-compact-interactive-list` + + +## Peer Dependencies + +This component requires the following peer dependencies be installed in your app for the component to properly function. + +| Peer Dependency | Version | +|-|-| +| react | ^16.8.5 | +| react-dom | ^16.8.5 | +| react-intl | ^2.8.0 | + + + +## Component Features + + * [Cross-Browser Support](https://engineering.cerner.com/terra-ui/about/terra-ui/component-standards#cross-browser-support) + * [Mobile Support](https://engineering.cerner.com/terra-ui/about/terra-ui/component-standards#mobile-support) + * [Internationalization Support](https://engineering.cerner.com/terra-ui/about/terra-ui/component-standards#internationalization-i18n) + * [LTR/RTL Support](https://engineering.cerner.com/terra-ui/about/terra-ui/component-standards#ltr--rtl) + +## Examples + + +## Compact Interactive List Props Table + diff --git a/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/ChangeLog.3.doc.mdx b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/ChangeLog.3.doc.mdx new file mode 100644 index 00000000000..d5c485d4acd --- /dev/null +++ b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/ChangeLog.3.doc.mdx @@ -0,0 +1,7 @@ +import { Badge } from 'terra-compact-interactive-list/package.json?dev-site-package'; + +import ChangeLog from 'terra-compact-interactive-list/CHANGELOG.md'; + + + + diff --git a/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.1.doc.mdx b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.1.doc.mdx new file mode 100644 index 00000000000..75df6c0f6f9 --- /dev/null +++ b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.1.doc.mdx @@ -0,0 +1,3 @@ +import DefaultCompactInteractiveList from './DefaultCompactInteractiveList?dev-site-example'; + + diff --git a/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.jsx b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.jsx new file mode 100644 index 00000000000..000e1ba3ea3 --- /dev/null +++ b/packages/terra-framework-docs/src/terra-dev-site/doc/compact-interactive-list/Examples.2/DefaultCompactInteractiveList.jsx @@ -0,0 +1,8 @@ +import React from 'react'; +import CompactInteractiveList from 'terra-compact-interactive-list'; + +const DefaultCompactInteractiveList = () => ( + +); + +export default DefaultCompactInteractiveList; diff --git a/packages/terra-framework-docs/src/terra-dev-site/test/compact-interactive-list/DefaultCompactInteractiveList.test.jsx b/packages/terra-framework-docs/src/terra-dev-site/test/compact-interactive-list/DefaultCompactInteractiveList.test.jsx new file mode 100644 index 00000000000..000e1ba3ea3 --- /dev/null +++ b/packages/terra-framework-docs/src/terra-dev-site/test/compact-interactive-list/DefaultCompactInteractiveList.test.jsx @@ -0,0 +1,8 @@ +import React from 'react'; +import CompactInteractiveList from 'terra-compact-interactive-list'; + +const DefaultCompactInteractiveList = () => ( + +); + +export default DefaultCompactInteractiveList; diff --git a/packages/terra-table/README.md b/packages/terra-table/README.md index 0da1e1b74db..6fcd2f7f387 100644 --- a/packages/terra-table/README.md +++ b/packages/terra-table/README.md @@ -5,7 +5,7 @@ The terra-table component provides users a way to render data in a tabular format. - [Getting Started](#getting-started) -- [Documentation](https://engineering.cerner.com/terra-ui/components/cerner-table-framework-docs/table/about) +- [Documentation](https://engineering.cerner.com/terra-ui/components/cerner-terra-framework-docs/table/about) - [LICENSE](#license) ## Getting Started diff --git a/packages/terra-table/package.json b/packages/terra-table/package.json index 46b0aa8a844..28c028426e1 100644 --- a/packages/terra-table/package.json +++ b/packages/terra-table/package.json @@ -18,9 +18,9 @@ "author": "Cerner Corporation", "license": "Apache-2.0", "bugs": { - "url": "https://github.com/cerner/table-framework/issues" + "url": "https://github.com/cerner/terra-framework/issues" }, - "homepage": "https://github.com/cerner/table-framework#readme", + "homepage": "https://github.com/cerner/terra-framework#readme", "peerDependencies": { "react": "^16.8.5", "react-dom": "^16.8.5", From 7183a0c9ffa0dfee2970638adb188f8c4762e25c Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 10:22:34 -0400 Subject: [PATCH 2/7] package.json fix --- packages/terra-compact-interactive-list/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/terra-compact-interactive-list/package.json b/packages/terra-compact-interactive-list/package.json index 2ce5a59cb70..91208b9e8b2 100644 --- a/packages/terra-compact-interactive-list/package.json +++ b/packages/terra-compact-interactive-list/package.json @@ -1,6 +1,6 @@ { "name": "terra-compact-interactive-list", - "main": "lib/compactInteractiveList.js", + "main": "lib/CompactInteractiveList.js", "version": "0.1.0", "description": "The Terra Compact Interactive List component provides users a way to render a collection of interactive data in a list format into a single tab stop.", "repository": { From a6395757df5b8dbd4b8143e6d47854332763b10c Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 10:37:29 -0400 Subject: [PATCH 3/7] snapshot updated --- .../__snapshots__/CompactInteractiveList.test.jsx.snap | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap b/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap index 613e10d72db..62b19761c40 100644 --- a/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap +++ b/packages/terra-compact-interactive-list/tests/jest/__snapshots__/CompactInteractiveList.test.jsx.snap @@ -9,7 +9,15 @@ exports[`placeholder for tests placeholder for a test 1`] = ` className="compact-interactive-list" role="grid" > - This is the placeholder div +
+
+ This is the placeholder div +
+
`; From 0cd19f21915e9a3e2a9300d657fe8e587bba2687 Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 10:56:35 -0400 Subject: [PATCH 4/7] terra-table one more url fixed --- packages/terra-framework-docs/CHANGELOG.md | 1 + packages/terra-table/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/terra-framework-docs/CHANGELOG.md b/packages/terra-framework-docs/CHANGELOG.md index b52afb34230..85d079c634d 100644 --- a/packages/terra-framework-docs/CHANGELOG.md +++ b/packages/terra-framework-docs/CHANGELOG.md @@ -7,6 +7,7 @@ * Added * Added example for Flowsheet Data Grid containing "No Result" cells. + * Added initial setup for `terra-compact-interactive-list` documentation. ## 1.42.0 - (October 20, 2023) diff --git a/packages/terra-table/package.json b/packages/terra-table/package.json index 28c028426e1..b37a32bcd4b 100644 --- a/packages/terra-table/package.json +++ b/packages/terra-table/package.json @@ -5,7 +5,7 @@ "description": "The Terra Table component provides user a way to display data in an accessible table format.", "repository": { "type": "git", - "url": "git+https://github.com/cerner/table-framework.git", + "url": "git+https://github.com/cerner/terra-framework.git", "directory": "packages/terra-table" }, "keywords": [ From f30994ef9334b0d319add36e7308791b7289fb60 Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 14:13:26 -0400 Subject: [PATCH 5/7] Update NOTICE Co-authored-by: Saad Adnan <38024451+sdadn@users.noreply.github.com> --- packages/terra-compact-interactive-list/NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/terra-compact-interactive-list/NOTICE b/packages/terra-compact-interactive-list/NOTICE index 46468f3a66e..25b68bca33d 100644 --- a/packages/terra-compact-interactive-list/NOTICE +++ b/packages/terra-compact-interactive-list/NOTICE @@ -1,4 +1,4 @@ -Copyright 2017 - 2019 Cerner Innovation, Inc. +Copyright 2023 - present Cerner Innovation, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 4392403f5207d7912ba8948206ef39898f607aad Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 15:41:42 -0400 Subject: [PATCH 6/7] validators and constants removed, shapes updated --- .../src/CompactInteractiveList.jsx | 5 ++--- .../src/proptypes/columnShape.js | 4 ---- .../src/proptypes/rowShape.js | 6 ------ .../src/proptypes/validators.js | 18 ------------------ .../src/utils/constants.js | 8 -------- packages/terra-framework-docs/package.json | 2 +- 6 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 packages/terra-compact-interactive-list/src/proptypes/validators.js delete mode 100644 packages/terra-compact-interactive-list/src/utils/constants.js diff --git a/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx index 4e5f2f69169..94afc2a7213 100644 --- a/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx +++ b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx @@ -25,14 +25,13 @@ const propTypes = { ariaLabel: PropTypes.string, /** - * Boolean indicating whether or not the table columns should be displayed. Setting the value to false will hide the columns, - * but the voice reader will use the column header values for a11y. + * Boolean indicating whether or not the column headers should be displayed. Defaults to false. */ hasColumnHeaders: PropTypes.bool, }; const defaultProps = { - hasColumnHeaders: true, + hasColumnHeaders: false, }; // const defaultColumnMinimumWidth = 60; diff --git a/packages/terra-compact-interactive-list/src/proptypes/columnShape.js b/packages/terra-compact-interactive-list/src/proptypes/columnShape.js index 178aac1af56..c98b73e1b97 100644 --- a/packages/terra-compact-interactive-list/src/proptypes/columnShape.js +++ b/packages/terra-compact-interactive-list/src/proptypes/columnShape.js @@ -9,10 +9,6 @@ const columnShape = PropTypes.shape({ * String of text to render within the column header cell. */ displayName: PropTypes.string, - /** - * Boolean value indicating whether or not the column has an error in the data. - */ - hasError: PropTypes.bool, /** * Number that specifies the minimum column width in pixels. */ diff --git a/packages/terra-compact-interactive-list/src/proptypes/rowShape.js b/packages/terra-compact-interactive-list/src/proptypes/rowShape.js index 0f86898c41a..dd9526c0829 100644 --- a/packages/terra-compact-interactive-list/src/proptypes/rowShape.js +++ b/packages/terra-compact-interactive-list/src/proptypes/rowShape.js @@ -11,12 +11,6 @@ const rowShape = PropTypes.shape({ * Data to be displayed in the cells of the row. Cells will be rendered in the row in the order given. */ cells: PropTypes.arrayOf(cellShape), - /** - * A string identifier used to describe the row contents. This value will be used to construct additional labels - * for internal controls (e.g. row selection cells). - */ - ariaLabel: PropTypes.string, - }); export default rowShape; diff --git a/packages/terra-compact-interactive-list/src/proptypes/validators.js b/packages/terra-compact-interactive-list/src/proptypes/validators.js deleted file mode 100644 index 79bb98c3cd7..00000000000 --- a/packages/terra-compact-interactive-list/src/proptypes/validators.js +++ /dev/null @@ -1,18 +0,0 @@ -import ERRORS from '../utils/constants'; - -// eslint-disable-next-line consistent-return -const validateRowHeaderIndex = (props) => { - if (!Number.isInteger(props.rowHeaderIndex)) { - return new Error(ERRORS.ROW_HEADER_INDEX_NOT_AN_INTEGER); - } - - if (props.rowHeaderIndex < 0) { - return new Error(ERRORS.ROW_HEADER_INDEX_LESS_THAN_ZERO); - } - - if (props.pinnedColumns.length && props.rowHeaderIndex >= props.pinnedColumns.length) { - return new Error(ERRORS.ROW_HEADER_INDEX_EXCEEDS_PINNED); - } -}; - -export default validateRowHeaderIndex; diff --git a/packages/terra-compact-interactive-list/src/utils/constants.js b/packages/terra-compact-interactive-list/src/utils/constants.js deleted file mode 100644 index ccccc39b608..00000000000 --- a/packages/terra-compact-interactive-list/src/utils/constants.js +++ /dev/null @@ -1,8 +0,0 @@ -const ERRORS = { - ROW_HEADER_INDEX_EXCEEDS_COLUMNS: 'Prop rowHeaderIndex exceeds the size of columns.', - ROW_HEADER_INDEX_LESS_THAN_ZERO: 'Prop rowHeaderIndex must be a positive integer.', - ROW_HEADER_INDEX_NOT_AN_INTEGER: 'Prop rowHeaderIndex must be an integer.', - COLUMNS_UNDEFINED: 'Tthe column data should be provided.', -}; - -export default ERRORS; diff --git a/packages/terra-framework-docs/package.json b/packages/terra-framework-docs/package.json index b7cd7f7ebe6..f55e6af3054 100644 --- a/packages/terra-framework-docs/package.json +++ b/packages/terra-framework-docs/package.json @@ -41,8 +41,8 @@ "terra-arrange": "^3.53.0", "terra-brand-footer": "^3.11.0", "terra-button": "^3.3.0", - "terra-compact-interactive-list": "^0.1.0", "terra-collapsible-menu-view": "^6.83.0", + "terra-compact-interactive-list": "^0.1.0", "terra-content-container": "^3.0.0", "terra-data-grid": "^1.0.0", "terra-date-input": "^1.46.0", From 862cf1d61cd1ffed5384fbc43f7ef6d275e56353 Mon Sep 17 00:00:00 2001 From: Alla Doroshkevych Date: Thu, 26 Oct 2023 16:36:30 -0400 Subject: [PATCH 7/7] removed headers classname --- .../src/CompactInteractiveList.jsx | 13 +------------ .../src/CompactInteractiveList.module.scss | 11 ----------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx index 94afc2a7213..b290afc88e4 100644 --- a/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx +++ b/packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx @@ -23,15 +23,6 @@ const propTypes = { * String that labels the table for accessibility. If ariaLabelledBy is specified, ariaLabel will not be used. */ ariaLabel: PropTypes.string, - - /** - * Boolean indicating whether or not the column headers should be displayed. Defaults to false. - */ - hasColumnHeaders: PropTypes.bool, -}; - -const defaultProps = { - hasColumnHeaders: false, }; // const defaultColumnMinimumWidth = 60; @@ -42,7 +33,6 @@ const CompactInteractiveList = (props) => { id, ariaLabelledBy, ariaLabel, - hasColumnHeaders, } = props; const theme = useContext(ThemeContext); @@ -58,7 +48,7 @@ const CompactInteractiveList = (props) => { role="grid" aria-labelledby={ariaLabelledBy} aria-label={ariaLabel} - className={cx('compact-interactive-list', theme.className, { headerless: !hasColumnHeaders })} + className={cx('compact-interactive-list', theme.className)} >
This is the placeholder div
@@ -69,6 +59,5 @@ const CompactInteractiveList = (props) => { }; CompactInteractiveList.propTypes = propTypes; -CompactInteractiveList.defaultProps = defaultProps; export default injectIntl(CompactInteractiveList); diff --git a/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss b/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss index 40936e0d1dc..8260dba4b42 100644 --- a/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss +++ b/packages/terra-compact-interactive-list/src/CompactInteractiveList.module.scss @@ -14,15 +14,4 @@ outline-offset: var(--terra-compact-interactive-list-cell-focus-outline-offset, -2px); } } - - /* stylelint-disable selector-max-compound-selectors */ - // TODO - this needs to be adjusted to new div structure rather than td and tr - .headerless { - tr:first-child { - td, - th { - border-top: var(--terra-compact-interactive-list-headerless-first-row-border-top, 1px solid #dedfe0); - } - } - } }