Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Switch-Component #2846

Merged
merged 97 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
846945d
initital commit
supreethmr Feb 13, 2020
1c002b1
Addresed code review comments
supreethmr Feb 18, 2020
aa3d849
jest snapshot update.
supreethmr Feb 18, 2020
5479327
Merge branch 'master' into add-switch-component
supreethmr Feb 19, 2020
f9309c6
Fixing accessiblity issues
supreethmr Feb 19, 2020
7de52ce
snapshots updated.
supreethmr Feb 19, 2020
8225561
code review comments
supreethmr Feb 20, 2020
69e5f5b
Fixed WDIO Error
supreethmr Feb 25, 2020
3ccbde1
Code review comments
supreethmr Mar 3, 2020
895c4fa
disabled screenshots update
supreethmr Mar 3, 2020
5baa668
nit documentation update
supreethmr Mar 3, 2020
caa5e28
Merge branch 'master' into add-switch-component
supreethmr Mar 4, 2020
32b000c
adding missed wdio screenshots
supreethmr Mar 4, 2020
82b228d
Updating screenshots due to WDIO inconsistency
supreethmr Mar 4, 2020
69f11f1
Fixing Wdio Tests Failing inconsistently
supreethmr Mar 5, 2020
1cd79a7
Merge branch 'master' into add-switch-component
supreethmr Mar 6, 2020
c70ff0f
Merge branch 'master' into add-switch-component
supreethmr Mar 10, 2020
cb0e6cf
Merge branch 'master' into add-switch-component
supreethmr Mar 11, 2020
0ccfff4
Tweaked animation to feel a little snappier.
jeremyfuksa Mar 12, 2020
1d76e78
Updated snapshot tests.
jeremyfuksa Mar 12, 2020
f12b29a
Added Open source theme styles
supreethmr Mar 16, 2020
043268c
Merge branch 'master' into add-switch-component
supreethmr Mar 17, 2020
a30ab9b
addressing code review comments
supreethmr Mar 17, 2020
fcbd00f
Updated screenshots for open source theme styles
supreethmr Mar 17, 2020
1e34dcb
updated theme variables
supreethmr Mar 17, 2020
d94dfe5
Merge branch 'master' into add-switch-component
supreethmr Mar 18, 2020
f4692ff
removed onkeydown and onkey-up event handlers and updated jest sanpshots
supreethmr Mar 18, 2020
b5cdc74
changed buttonId and status label color
supreethmr Mar 18, 2020
aca3303
Merge branch 'master' into add-switch-component
supreethmr Mar 29, 2020
8cbf032
Merge branch 'master' into add-switch-component
supreethmr Apr 1, 2020
94492b2
Wdio Snapshots updated
supreethmr Apr 1, 2020
1d14af8
Updated wdio to fix the travis build
ShettyAkarsh Apr 1, 2020
34cf912
Fixed in Extra screenshots
ShettyAkarsh Apr 1, 2020
829ac15
Added the test back
ShettyAkarsh Apr 1, 2020
b63ba0b
Updated Screen shots
ShettyAkarsh Apr 1, 2020
f41e323
Added Fusion and LowLight Theme for Switch
supreethmr Apr 1, 2020
8219ea9
removed moveing to root for default
supreethmr Apr 2, 2020
9666383
added browser.refresh() to fix Travis build failure
supreethmr Apr 2, 2020
3255265
Merge branch 'master' into add-switch-component
supreethmr Apr 2, 2020
6a35f2a
Updated screenshots and fixed mozila firefox inner
supreethmr Apr 2, 2020
5f416f3
Renamed Screenshots
supreethmr Apr 2, 2020
fc5e26e
Updated Jest snapshots
supreethmr Apr 3, 2020
2e5fe01
updated snaphosts and removed focus for mouse events
supreethmr Apr 3, 2020
48fce2d
Addressed code review comments.
supreethmr Apr 7, 2020
d8ea53b
documentation updates
supreethmr Apr 8, 2020
b91daba
Merge branch 'master' into add-switch-component
supreethmr Apr 8, 2020
4c55957
snapshot updates
supreethmr Apr 8, 2020
7b30cc7
Merge branch 'master' into add-switch-component
supreethmr Apr 16, 2020
7984757
Prop Renamed and Added Translations
supreethmr Apr 16, 2020
b29f650
updated screenshots and fixed slider position issue in cliical theme
supreethmr Apr 17, 2020
2552b48
Fixing travis build
supreethmr Apr 17, 2020
519a9b0
Merge branch 'master' into add-switch-component
supreethmr Apr 17, 2020
a6d82c7
Fixing Travis build and Focus Styles
supreethmr Apr 21, 2020
95fb4d8
Merge branch 'master' into add-switch-component
supreethmr Apr 24, 2020
3efa9a0
Fixed focus styles
supreethmr Apr 24, 2020
d3e248c
Merge branch 'master' into add-switch-component
supreethmr Apr 27, 2020
fe9e402
Fixed Focus issue on Tab
supreethmr Apr 28, 2020
9347608
fixing travis build
supreethmr Apr 29, 2020
c6efc72
Merge branch 'master' into add-switch-component
supreethmr May 21, 2020
8ba4fb4
Added Theme context for Switch
supreethmr May 21, 2020
65cae48
jest snapshot update.
supreethmr May 21, 2020
2c6cbfe
Merge branch 'master' into add-switch-component
supreethmr May 21, 2020
3d0d8c7
Merge branch 'master' into add-switch-component
supreethmr May 22, 2020
52587e2
screen shot updates to fix travis build
supreethmr May 22, 2020
3def656
Merge branch 'master' into add-switch-component
supreethmr May 29, 2020
4e8bb01
changed opacity to 0.8 for default theme
supreethmr Jun 2, 2020
c345547
fixed label selection and status label.
supreethmr Jun 3, 2020
dbe657a
Merge branch 'master' into add-switch-component
supreethmr Jun 4, 2020
e85c5e2
Merge branch 'master' into add-switch-component
supreethmr Jun 5, 2020
472bd40
reverted code changes to keep component interactable
supreethmr Jun 5, 2020
24d50e7
Merge branch 'master' into add-switch-component
lokesh-0813 Jun 8, 2020
a19cbbd
removed duplicate theme variables
supreethmr Jun 8, 2020
ac27f06
Merge branch 'master' into add-switch-component
supreethmr Jun 9, 2020
5040f87
updated translations
supreethmr Jun 9, 2020
e53bfdc
fixed pointer styles
supreethmr Jun 11, 2020
3994333
Merge branch 'master' into add-switch-component
supreethmr Jun 11, 2020
f9aa558
removed lowlight theme config
supreethmr Jun 11, 2020
471b352
Merge branch 'add-switch-component' of https://github.com/cerner/terr…
supreethmr Jun 11, 2020
7a55b5d
updated WDIO scripts to latest changes and DOC links
supreethmr Jun 11, 2020
c000dbe
Merge branch 'master' into add-switch-component
supreethmr Jun 12, 2020
3708707
minor change
supreethmr Jun 12, 2020
93c8956
Merge branch 'master' into add-switch-component
supreethmr Jun 16, 2020
38b1058
Merge branch 'master' into add-switch-component
supreethmr Jun 17, 2020
f19226d
Merge branch 'master' into add-switch-component
supreethmr Jun 22, 2020
6294f15
changed button to input type button
supreethmr Jun 22, 2020
a85d411
screen shots updated
supreethmr Jun 23, 2020
7ab0178
Changed Switch Structure and updated styles and tests
supreethmr Jul 1, 2020
006c41a
Merge branch 'master' into add-switch-component
supreethmr Jul 1, 2020
893ebe6
changed button to div
supreethmr Jul 2, 2020
353bec2
doc update
supreethmr Jul 2, 2020
2d33153
Merge branch 'master' into add-switch-component
supreethmr Jul 3, 2020
64be4d7
doc update.
supreethmr Jul 3, 2020
0645856
Merge branch 'add-switch-component' of https://github.com/cerner/terr…
supreethmr Jul 3, 2020
7a753a7
code revie w comments
supreethmr Jul 3, 2020
12e5788
Merge branch 'main' into add-switch-component
emilyrohrbough Jul 13, 2020
8069334
updated refernces to main
supreethmr Jul 14, 2020
bf87afc
Merge branch 'add-switch-component' of https://github.com/cerner/terr…
supreethmr Jul 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/terra-switch/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.log
target
reports
tests/**/__snapshots__/
aggregated-translations
dev-site-config
screenshots
errorScreenshots
generated-themes
1 change: 1 addition & 0 deletions packages/terra-switch/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 7 additions & 0 deletions packages/terra-switch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ChangeLog
=========

Unreleased
----------
### Added
* Added Switch Component
202 changes: 202 additions & 0 deletions packages/terra-switch/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@

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 2020 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.
13 changes: 13 additions & 0 deletions packages/terra-switch/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2020 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.
41 changes: 41 additions & 0 deletions packages/terra-switch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Terra Switch

[![NPM version](https://badgen.net/npm/v/terra-switch)](https://www.npmjs.org/package/terra-switch)
[![Build Status](https://badgen.net/travis/cerner/terra-switch)](https://travis-ci.com/cerner/terra-core)

The terra-switch component indicates whether a setting is on or off and provide users with instantaneous feedback.

Switch can be used for only one of these set of binary options:
• On / Off

- [Getting Started](#getting-started)
- [Documentation](https://engineering.cerner.com/terra-core/components/terra-switch/switch/switch)
- [LICENSE](#license)

## Getting Started

- Install with [npm](https://www.npmjs.com): `npm install terra-switch`

<!-- AUTO-GENERATED-CONTENT:START Peer Dependencies -->
## 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 |



<!-- AUTO-GENERATED-CONTENT:END -->

## LICENSE

Copyright 2020 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

&nbsp;&nbsp;&nbsp;&nbsp;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.
6 changes: 6 additions & 0 deletions packages/terra-switch/clinical-lowlight-wdio.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const path = require('path');
const wdioConf = require('../../config/wdio/clinical-lowlight-theme/wdio.conf.js');

wdioConf.config.specs = [path.join(__dirname, 'tests', 'wdio', '**', '*-spec.js')];

exports.config = wdioConf.config;
45 changes: 45 additions & 0 deletions packages/terra-switch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "terra-switch",
"main": "lib/Switch.js",
"version": "0.0.0",
"description": "The terra-switch component provides users a way to toggle between state ON and OFF.",
"repository": {
"type": "git",
"url": "git+https://github.com/cerner/terra-core.git"
},
"keywords": [
"switch",
"Cerner",
"Terra",
"terra-switch",
"UI"
],
"author": "Cerner Corporation",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/cerner/terra-core/issues"
},
"homepage": "https://github.com/cerner/terra-core#readme",
"scripts": {
"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:scss": "stylelint src/**/*.scss",
"precompile": "rm -rf lib",
"test": "npm run jest && npm run lint && npm run wdio",
"jest": "jest --config ../../jestconfig.js",
"wdio-default": "cd ../.. && npx wdio ./packages/$npm_package_name/wdio.conf.js",
"wdio-lowlight": "cd ../.. && THEME=clinical-lowlight-theme npx wdio ./packages/$npm_package_name/clinical-lowlight-wdio.conf.js",
"wdio-fusion": "cd ../.. && THEME=orion-fusion-theme npx wdio ./packages/$npm_package_name/wdio.conf.js",
"wdio": "npm run wdio-default && npm run wdio-fusion && npm run wdio-lowlight"
},
"peerDependencies": {
"react": "^16.8.5",
"react-dom": "^16.8.5"
},
"dependencies": {
"classnames": "^2.2.5",
"keycode-js": "^2.0.1",
"prop-types": "^15.5.8"
}
}
Loading