-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CopyButton): use tooltip styles for feedback and add animation (#…
- Loading branch information
Showing
7 changed files
with
271 additions
and
144 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
34 changes: 34 additions & 0 deletions
34
packages/components/src/components/copy-button/_keyframes.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,34 @@ | ||
// | ||
// Copyright IBM Corp. 2016, 2018 | ||
// | ||
// This source code is licensed under the Apache-2.0 license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
// | ||
|
||
@mixin content-visible { | ||
visibility: visible; | ||
opacity: 1; | ||
} | ||
|
||
@mixin content-hidden { | ||
visibility: hidden; | ||
opacity: 0; | ||
} | ||
|
||
@keyframes hide-feedback { | ||
0% { | ||
@include content-visible; | ||
} | ||
100% { | ||
@include content-hidden; | ||
} | ||
} | ||
|
||
@keyframes show-feedback { | ||
0% { | ||
@include content-hidden; | ||
} | ||
100% { | ||
@include content-visible; | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
packages/components/src/components/copy-button/copy-button.hbs
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,11 +1,11 @@ | ||
<!-- | ||
<!-- | ||
Copyright IBM Corp. 2016, 2018 | ||
This source code is licensed under the Apache-2.0 license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
<button data-copy-btn class="{{@root.prefix}}--snippet-button" type="button" aria-label="Copy" tabindex="0"> | ||
{{ carbon-icon 'Copy16' class=(add @root.prefix '--snippet__icon')}} | ||
<div class="{{@root.prefix}}--btn--copy__feedback" role="alert" data-feedback="Copied!"></div> | ||
<button data-copy-btn class="{{@root.prefix}}--copy-btn" type="button" tabindex="0"> | ||
<span class="{{@root.prefix}}--assistive-text {{@root.prefix}}--copy-btn__feedback">Copied!</span> | ||
{{ carbon-icon 'Copy16' class=(add @root.prefix '--snippet__icon' hidden="true")}} | ||
</button> |
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
Oops, something went wrong.