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
toggle-button Realistic Examples . #3827
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9736a46
Toggle Button example and Accessibility fix
ashishkumbhare116 f2b91bb
Reverted aria-label fix
ashishkumbhare116 78250c7
"package.json file Wdio-default value update"
ashishkumbhare116 3a9e249
"Removed the ChangeLog comment"
ashishkumbhare116 e9c4fdf
"Updated Changelog comment"
ashishkumbhare116 2085793
"Added Lint fixes"
ashishkumbhare116 cac52d1
Merge branch 'main' into toggle-button-fix
supreethmr d162e35
Ressolved lint errors on ToggleCommon CSS file
ashishkumbhare116 a151c1b
Added the required changes on review
ashishkumbhare116 e4559cc
spacing added for button
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we try adding padding as well so that buttons inside the container's are properly aligned There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added fix on 'a151c1b' |
||
|
||
button { | ||
margin: 5px; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this change been released? if not, can you move back to unreleased