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

[terra-popup] Enabled close button in Popup #2158

Merged
merged 40 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c5bd351
Enabled close button for examples
May 8, 2024
2a1cc60
Merge branch 'main' of https://github.com/cerner/terra-framework into…
May 8, 2024
9cfc037
Updating test
May 8, 2024
594953d
Modified Contributors.md file
May 8, 2024
359f536
Updated tests
May 9, 2024
4c7f1bc
Merge branch 'main' into UXPLATFORM-10398
adavijit May 9, 2024
c36a4f4
Updated tests
May 9, 2024
39e7864
Updated tests
May 9, 2024
58d749f
Enabled close button for pills
May 10, 2024
69dbb52
Enabled close button as prop to terra-pills
May 10, 2024
8298895
Modified changelog.md for terra-pills
May 10, 2024
e9d00bb
Added username in contributors.md file
May 10, 2024
3f6c185
Updated test snapshots
May 10, 2024
5bf96d6
Updated test snapshots
May 10, 2024
c3c9d8c
Updated test snapshots
May 10, 2024
4ae36d8
Updated test snapshots
May 10, 2024
dd4ecd8
wdio
saket2403 May 13, 2024
f6af8c7
wdio fix
May 13, 2024
2d9501f
Merge branch 'UXPLATFORM-10398' of https://github.com/cerner/terra-fr…
May 13, 2024
1d9c542
wdio fix
May 13, 2024
3a8521c
fix menu issue
May 14, 2024
167a0cf
Merge branch 'main' into UXPLATFORM-10398
adavijit May 14, 2024
48797b6
added changelog
May 14, 2024
bc19f3e
wdio fix
May 14, 2024
dc4763a
wdio
saket2403 May 15, 2024
cb7677e
fixed popup issue when automatic height/width
May 15, 2024
d532aad
fixed popup issue when automatic height/width
May 15, 2024
33828fd
added close button in compact-interactive-list
May 15, 2024
fef0ccb
Merge branch 'main' of https://github.com/cerner/terra-framework into…
May 15, 2024
7bf9d3a
Updated screenshots
May 16, 2024
53e31d9
Refactor popup logic
May 17, 2024
f6fca37
Jest snapshot update
May 17, 2024
1088611
Merge branch 'main' of https://github.com/cerner/terra-framework into…
May 17, 2024
bc51374
Jest snapshot update
May 17, 2024
271cc11
Jest snapshot update
May 17, 2024
c34708c
Updated changelog
May 17, 2024
9064765
Updated changelog
May 17, 2024
5e0c3fd
Updated snapshots
May 17, 2024
bb9c39b
Revert Target Ref Changes
saket2403 May 20, 2024
610b70f
Pills Changelog
saket2403 May 20, 2024
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
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Cerner Corporation
- Aaron Johnson [@zxeleven]
- Serhii Pavlov [@sPavl0v]
- Dmytro Smoliakov [@user099]
- Avijit Das [@adavijit]

[@tbiethman]: https://github.com/tbiethman
[@mjhenkes]: https://github.com/mjhenkes
Expand Down Expand Up @@ -105,3 +106,4 @@ Cerner Corporation
[@zxeleven]: https://github.com/zxeleven
[@sPavl0v]: https://github.com/sPavl0v
[@user099]: https://github.com/user099
[@adavijit]: https://github.com/adavijit
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ exports[`ApplicationNavigation correctly applies the theme context className 1`]
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -313,6 +314,7 @@ exports[`ApplicationNavigation should render default element 1`] = `
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -450,6 +452,7 @@ exports[`ApplicationNavigation should render with prop data at large breakpoint
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -679,6 +682,7 @@ exports[`ApplicationNavigation should render with prop data at medium breakpoint
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ exports[`Extensions should render default element 1`] = `
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -62,7 +63,8 @@ exports[`Extensions should render prop data 1`] = `
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ exports[`CompactHeader should render with function callbacks 1`] = `
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -1030,7 +1031,8 @@ exports[`CompactHeader should render with ids for navigation and extension items
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,8 @@ exports[`Header should render with function callbacks 1`] = `
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down Expand Up @@ -1730,7 +1731,8 @@ exports[`Header should render with navigation and extension item ids 1`] = `
contentWidth="320"
isArrowDisplayed={true}
isContentFocusDisabled={true}
isHeaderDisabled={false}
isHeaderDisabled={true}
isMenu={false}
isOpen={false}
onRequestClose={[Function]}
popupContentRole="dialog"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/terra-framework-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
## 1.87.0 - (May 14, 2024)

* Changed
* Enabled `close` button in examples.
* Modified Button in `PopupStandard` example.
* Removed `ariaLabel` from `PopupStandard` example.
* Updated `terra-slide-panel` example to use `terra-buttons`.

## 1.86.0 - (May 8, 2024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function PopupAttachmentBehavior() {
isOpen={open}
targetRef={getButtonNode}
onRequestClose={handleRequestClose}
isHeaderDisabled={false}
>
<Placeholder title="Popup Content" />
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function PopupAttachment() {
isOpen={open}
targetRef={getButtonNode}
onRequestClose={handleRequestClose}
isHeaderDisabled={false}
>
<Placeholder title="Popup Content" />
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function PopupBounded() {
isOpen={open}
onRequestClose={handleRequestClose}
targetRef={getButtonNode}
isHeaderDisabled={false}
isContentFocusDisabled
>
<Placeholder title="Popup Content" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function PopupDimensions() {
<div>
<Popup
{...contentDimensions}
isHeaderDisabled={false}
classNameContent="test-content"
isOpen={open}
onRequestClose={handleRequestClose}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
overflow: hidden;
width: 200px;
}

.popup-button {
display: block;
font-size: 1rem;
height: 30px;
max-width: 80px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.terra-popup-content {
list-style-type: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function ModalContainer(props) {
<React.Fragment>
<div className={cx('content-container')}>
<Popup
isHeaderDisabled={false}
isArrowDisplayed
isOpen={open}
onRequestClose={handlePopupRequestClose}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { useRef, useState } from 'react';
import Popup from 'terra-popup';
import classNames from 'classnames/bind';
import styles from './PopupDocCommon.module.scss';

const cx = classNames.bind(styles);
import Button from 'terra-button';

function PopupStandard() {
const buttonElement = useRef();
Expand Down Expand Up @@ -35,13 +32,13 @@ function PopupStandard() {
Using inert makes the content outside the popup inaccessible to screen readers and keyboard interactions while the popup is active, ensuring keyboard focus is trapped within the popup for better accessibility.
<p>This example shows how to pass custom aria label for screen readers.</p>
</div>
<button type="button" className={cx('popup-button')} onClick={handleButtonClick} ref={setButtonNode}>Medications</button>
<Button text="Medications" onClick={handleButtonClick} refCallback={setButtonNode} />
<Popup
isOpen={open}
targetRef={getButtonNode}
onRequestClose={handleRequestClose}
isHeaderDisabled={false}
ariaLabel="Press escape to close medications pop up"
isContentFocusDisabled
>
<label htmlFor="html">Medications for patient John Doe</label>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function PopupArrow() {
<Button text="Medication Links" onClick={handleButtonClick} refCallback={setButtonNode} />
<Popup
isOpen={open}
isHeaderDisabled={false}
onRequestClose={handleRequestClose}
targetRef={getButtonNode}
isArrowDisplayed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const PopupWithInteractiveContent = () => {
targetRef={getButtonNode}
onRequestClose={handleRequestClose}
contentHeight="auto"
isHeaderDisabled={false}
>
{/* eslint-disable-next-line react/forbid-dom-props */}
<div style={{ padding: '1em' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const PillTemplate = ({
id={pill.id}
key={pill.id}
metaData={{ index }}
isPopupHeaderDisabled={false}
/>
))}
</FilterPills>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow was horizontally attached.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ArrowPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>this is popup content</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class OffsetPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup was adjusted because the target was smaller than the arrow position allowed.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class OffsetPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup was adjusted because the target was smaller than the arrow position allowed.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical attachment.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has verital-left attachment, but was adjusted to be on the screen.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical-right attachment, but was adjusted to be on the screen.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic height of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic height of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic width of 400px, but is bounded by the parent width of 200px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic width of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded by height.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class BoundedPopup extends React.Component {
isHeaderDisabled
>
<BoundedNoHeaderContent />
<button type="button" onClick={this.handleRequestClose}>Close</button>
</Popup>
<button type="button" id="bounded-button" onClick={this.handleButtonClick} ref={this.setButtonNode}>
Bounded Popup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded and presents a header.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded by width.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DefaultPopup extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>this is popup content</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical attachment.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DefaultPopup extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>this is popup content</p>
<button id="button1" type="button">Test button 1</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class PopupWithContentWidth extends Component {
isOpen={open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>This is a popup with custom contentWidth and contentHeight</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<TestPopupContent size={this.state.size} onClick={() => this.setState({ size: 'large' })} />
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup defaults its size.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup is 240h by 960w.</p>
</Popup>
Expand Down
Loading
Loading