This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
toggle-button Realistic Examples . (#3827)
* Toggle Button example and Accessibility fix * Reverted aria-label fix * "package.json file Wdio-default value update" * "Removed the ChangeLog comment" * "Updated Changelog comment" * "Added Lint fixes" * Ressolved lint errors on ToggleCommon CSS file * Added the required changes on review * spacing added for button --------- Co-authored-by: Supreeth <[email protected]> Co-authored-by: SM051274 <[email protected]>
- Loading branch information
1 parent
01fa65c
commit 29b8978
Showing
8 changed files
with
151 additions
and
20 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
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
53 changes: 48 additions & 5 deletions
53
...s/terra-core-docs/src/terra-dev-site/doc/toggle-button/example/IsIconOnlyToggleButton.jsx
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 |
---|---|---|
@@ -1,10 +1,53 @@ | ||
import React from 'react'; | ||
import ToggleButton from 'terra-toggle-button'; | ||
import classNames from 'classnames/bind'; | ||
import styles from './ToggleButtonCommon.module.scss'; | ||
|
||
const IconOnly = () => ( | ||
<ToggleButton isIconOnly closedButtonText="Icon Only ToggleButton"> | ||
<p>Cerner has been a pioneer in healthcare technology since 1979 and is well positioned to provide our clients with the stability and vision they need from their technology provider. With cumulative research and development spend exceeding $6.6 billion, Cerner will continue to deliver award-winning solutions for the now and the next.</p> | ||
</ToggleButton> | ||
); | ||
const cx = classNames.bind(styles); | ||
|
||
const IconOnly = () => { | ||
const [isButtonOn, setButtonOn] = React.useState(false); | ||
|
||
const handleButtonClick = () => { | ||
setButtonOn(!isButtonOn); | ||
}; | ||
|
||
const handleBookAppointmentClick = () => { | ||
// eslint-disable-next-line no-alert | ||
alert('Appointment Book Button Clicked'); | ||
}; | ||
|
||
const handleContactClick = () => { | ||
// eslint-disable-next-line no-alert | ||
alert('Contact Button Clicked'); | ||
}; | ||
|
||
return ( | ||
<ToggleButton | ||
isIconOnly | ||
closedButtonText={isButtonOn ? 'Icon Only ToggleButton (ON)' : 'Icon Only ToggleButton (OFF)'} | ||
onToggle={handleButtonClick} | ||
> | ||
<h2>Welcome to Our Clinic!</h2> | ||
<p> | ||
At our clinic, we provide exceptional healthcare services for patients of all ages. Our team of experienced doctors and medical staff is dedicated to ensuring your well-being and delivering personalized care. | ||
</p> | ||
<p> | ||
We offer a wide range of medical specialties, including cardiology, pediatrics, dermatology, orthopedics, and more. Our state-of-the-art facilities are equipped with the latest medical technologies to provide accurate diagnoses and effective treatments. | ||
</p> | ||
<p> | ||
Whether you need a routine check-up, have a specific health concern, or require ongoing care, our compassionate healthcare professionals are here to support you every step of the way. We prioritize patient satisfaction and strive to create a comfortable and nurturing environment for everyone who walks through our doors. | ||
</p> | ||
<div className={cx('toggle-div-style')}> | ||
<button type="button" onClick={handleBookAppointmentClick}> | ||
Book an Appointment | ||
</button> | ||
<button type="button" onClick={handleContactClick}> | ||
Contact Us | ||
</button> | ||
</div> | ||
</ToggleButton> | ||
); | ||
}; | ||
|
||
export default IconOnly; |
11 changes: 9 additions & 2 deletions
11
...ra-core-docs/src/terra-dev-site/doc/toggle-button/example/IsInitiallyOpenToggleButton.jsx
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
10 changes: 10 additions & 0 deletions
10
...rra-core-docs/src/terra-dev-site/doc/toggle-button/example/ToggleButtonCommon.module.scss
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,10 @@ | ||
:local { | ||
.toggle-div-style { | ||
margin-top: 20px; | ||
text-align: center; | ||
|
||
button { | ||
margin: 5px; | ||
} | ||
} | ||
} |