Skip to content

Commit

Permalink
Merge pull request #266 from dcos-labs/mp/fix/modal-feedback-post-merge
Browse files Browse the repository at this point in the history
Address post-merge modal feedback
  • Loading branch information
Philipp Hinrichsen authored Jan 3, 2019
2 parents d52ea12 + 5cc1cf8 commit e5511de
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"memoize-one": "4.0.2",
"react": "16.5.2",
"react-click-outside": "3.0.1",
"react-delegate-component": "^1.0.0",
"react-delegate-component": "1.0.0",
"react-dom": "16.5.2",
"react-emotion": "9.2.12",
"react-toggled": "1.2.7",
Expand Down
41 changes: 32 additions & 9 deletions packages/modal/stories/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import PrimaryButton from "../../button/components/PrimaryButton";
import {
flex,
flexItem,
padding,
textSize,
tintContentSecondary
} from "../../shared/styles/styleUtils";
Expand Down Expand Up @@ -111,7 +112,10 @@ storiesOf("Modal", module)
onClose={onClose}
title="I am modal"
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand All @@ -135,7 +139,10 @@ storiesOf("Modal", module)
onClose={onClose}
title="I am modal"
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand All @@ -159,7 +166,10 @@ storiesOf("Modal", module)
onClose={onClose}
title="I am modal"
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand All @@ -185,7 +195,10 @@ storiesOf("Modal", module)
subtitle="Optional subtitle"
closeText="Dismiss"
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand Down Expand Up @@ -218,7 +231,9 @@ storiesOf("Modal", module)
<input type="checkbox" id="fauxToggle" />
<label htmlFor="fauxToggle">Faux toggle</label>
</div>
<div className={flexItem("shrink")}>{ctaButton}</div>
<div className={cx(flexItem("shrink"), padding("left", "s"))}>
{ctaButton}
</div>
</div>
</div>
</div>
Expand All @@ -232,7 +247,10 @@ storiesOf("Modal", module)
title="I am modal"
closeText="Dismiss"
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand All @@ -259,7 +277,10 @@ storiesOf("Modal", module)
closeText="Dismiss"
isContentFlush={true}
ctaButton={
<PrimaryButton onClick={action("handling CTA")}>
<PrimaryButton
onClick={action("handling CTA")}
aria-haspopup={true}
>
Continue
</PrimaryButton>
}
Expand All @@ -281,11 +302,13 @@ storiesOf("Modal", module)
isOpen={isOpen}
onClose={onClose}
title="I am modal"
initialFocus="#test-input"
initialFocus="#focus-input"
>
<div>
<ModalContent />
<TextInput inputLabel="I get focus" id="focus-input" />
<div className={padding("top", "m")}>
<TextInput inputLabel="I get focus" id="focus-input" />
</div>
</div>
</DialogModal>
)}
Expand Down
2 changes: 2 additions & 0 deletions packages/modal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export const fullscreenModalHeader = css`
`;

export const modalCloseWrapper = css`
cursor: pointer;
&:focus-within {
outline: -webkit-focus-ring-color auto 5px;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/modal/tests/__snapshots__/Modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ exports[`Modal DialogModal renders DialogModal 1`] = `
}
.emotion-3 {
cursor: pointer;
display: inherit;
box-sizing: border-box;
-webkit-flex-basis: auto;
Expand Down Expand Up @@ -632,6 +633,7 @@ exports[`Modal DialogModal renders DialogModal 1`] = `
}
.emotion-3 {
cursor: pointer;
display: inherit;
box-sizing: border-box;
-webkit-flex-basis: auto;
Expand Down Expand Up @@ -1520,7 +1522,7 @@ exports[`Modal FullscreenModal renders FullscreenModal 1`] = `
Title
</div>
<div
class="css-1x3nq8p"
class="css-6nx4bk"
>
<span
class="css-ms94x0"
Expand Down Expand Up @@ -1745,6 +1747,7 @@ exports[`Modal FullscreenModal renders FullscreenModal 1`] = `
}
.emotion-3 {
cursor: pointer;
display: inherit;
box-sizing: border-box;
-webkit-flex-basis: auto;
Expand Down

0 comments on commit e5511de

Please sign in to comment.