Skip to content

Commit

Permalink
fix: correct error Dialog icon position and wrapping fixes #492, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jianliao authored Feb 5, 2020
1 parent 0909251 commit 1d56fd9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/dialog/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ only screen and (max-device-height: 350px) {

.spectrum-Dialog-typeIcon {
display: block;
margin-left: var(--spectrum-dialog-icon-margin-left);
flex-shrink: 0;
align-self: flex-start;
}

.spectrum-Dialog-content {
Expand Down
23 changes: 23 additions & 0 deletions components/dialog/metadata/dialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,29 @@ examples:
<button class="spectrum-Button spectrum-Button--primary" onclick="closeDialog(this.closest('.spectrum-Dialog'))">OK</button>
</div>
</div>
- id: dialog-error
name: Dialog - Alert Error with long title
status: Verified
description: An error alert dialog has an error icon in the header and long title text.
demoClassName: spectrum-CSSExample-example--overlay
markup: |
<button class="spectrum-Button spectrum-Button--overBackground spectrum-CSSExample-overlayShowButton" onclick="openDialog(this.nextElementSibling)">Open Error Dialog</button>
<!-- spectrum-CSSExample-dialog class is included for demo purposes only -->
<div class="spectrum-Dialog spectrum-Dialog--error spectrum-Dialog--alert is-open spectrum-CSSExample-dialog">
<div class="spectrum-Dialog-header">
<h2 class="spectrum-Dialog-title">Unable to Share Project to Behance Community</h2>
<svg class="spectrum-Icon spectrum-UIIcon-AlertMedium spectrum-Dialog-typeIcon" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-AlertMedium" />
</svg>
</div>
<div class="spectrum-Dialog-content">
An error occurred while sharing your project. Please verify the email address and try again.
</div>
<div class="spectrum-Dialog-footer">
<button class="spectrum-Button spectrum-Button--primary" onclick="closeDialog(this.closest('.spectrum-Dialog'))">OK</button>
</div>
</div>
- id: dialog-error
name: Dialog - Alert 3 buttons
status: Verified
Expand Down
9 changes: 9 additions & 0 deletions components/popover/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ governing permissions and limitations under the License.
--spectrum-popover-target-offset: 13px;
--spectrum-popover-dialog-padding: 30px 29px;
--spectrum-popover-dialog-min-width: 270px;
--spectrum-popover-dialog-icon-margin-left: var(--spectrum-global-dimension-size-200);

--spectrum-popover-min-width: var(--spectrum-global-dimension-size-400);
--spectrum-popover-min-height: var(--spectrum-global-dimension-size-400);
Expand Down Expand Up @@ -143,3 +144,11 @@ governing permissions and limitations under the License.
margin-left: -12px;
}
}

.spectrum-Popover {
&.spectrum-Popover--dialog {
.spectrum-Dialog-typeIcon {
margin-left: var(--spectrum-popover-dialog-icon-margin-left);
}
}
}
4 changes: 3 additions & 1 deletion components/popover/metadata/popover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ examples:
<div class="spectrum-Popover spectrum-Popover--dialog spectrum-Popover--right spectrum-Dialog--error is-open" style="max-width:320px">
<div class="spectrum-Dialog-header">
<div class="spectrum-Dialog-title">Very Long Error Message With Much Text</div>
<div class="spectrum-Dialog-typeIcon"></div>
<svg class="spectrum-Icon spectrum-UIIcon-AlertMedium spectrum-Dialog-typeIcon" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-AlertMedium" />
</svg>
</div>
<div class="spectrum-Dialog-content">Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels. Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake sweet roll cake danish candy biscuit halvah</div>
<div class="spectrum-Dialog-footer">
Expand Down

0 comments on commit 1d56fd9

Please sign in to comment.