-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(info icon): styles and guidance for help text
re #2132
- Loading branch information
Showing
6 changed files
with
151 additions
and
0 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
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,91 @@ | ||
<div class="demo-content"> | ||
<h1>Info Icons & Help Text</h1> | ||
<h6>Last updated Jun 12, 2024</h6> | ||
|
||
<hc-tile> | ||
<h5 id="intro">Why Info Icons?<span class="hc-icon-right hc-info-ico fa fa-info-circle" hcTooltip="To give extra context!"></span></h5> | ||
<p>Information icons provide in-context UI help. They're ideal for cases where the supplmental info is A) not critical, or B) verbose enough that it would clutter the UI if displayed all the time.</p> | ||
|
||
<p>Use them generously in form controls, in tables, or in any other place where the user may benefit from some additional context.</p> | ||
|
||
<h4>To use Cashmere styled info icons:</h4> | ||
<ol> | ||
<li>Add the <code>.hc-info-ico</code> class to a <code>span</code> or <code>hc-icon</code> with an appropriate icon.</li> | ||
<li>Use <code>[hcTooltip]</code> or <code>[hcPop]</code>, or trigger a modal to deliver the helpful info.</li> | ||
</ol> | ||
|
||
<br><br> | ||
<div id="tooltipExample"></div> | ||
</hc-tile> | ||
|
||
<hc-tile> | ||
<h5 id="intro">Use with HcTooltip</h5> | ||
<hc-form-field> | ||
<hc-form-field> | ||
<hc-label>Name <span class="hc-icon-right hc-info-ico fa fa-info-circle" hcTooltip="Some helpful context"></span></hc-label> | ||
<input hcInput placeholder="Enter name"/> | ||
</hc-form-field> | ||
</hc-form-field> | ||
|
||
<pre><code> | ||
<hc-form-field> | ||
<hc-form-field> | ||
<hc-label> | ||
Name | ||
<span class="hc-icon-left hc-info-ico fa fa-info-circle" | ||
hcTooltip="Some helpful context"> | ||
</span></hc-label> | ||
<input hcInput placeholder="Enter name"/> | ||
</hc-form-field> | ||
</hc-form-field> | ||
</code></pre> | ||
</hc-tile> | ||
|
||
<hc-tile> | ||
<h5 id="intro">Use with HcPop</h5> | ||
<hc-tile> | ||
<strong>Sepsis Dashboard<span class="hc-icon-right hc-info-ico fa fa-info-circle" [hcPop]="helpPop"></span></strong> | ||
</hc-tile> | ||
<hc-pop #helpPop> | ||
<strong>Helpful Context</strong> | ||
<p>Some <strong>helpful context</strong> that the user might need to know.</p> | ||
<button hc-button>Thanks for the help!</button> | ||
</hc-pop> | ||
|
||
<pre><code> | ||
<hc-form-field> | ||
<hc-form-field> | ||
<hc-label> | ||
Name | ||
<span class="hc-icon-left hc-info-ico fa fa-info-circle" | ||
hcPop="helpPop"> | ||
</span></hc-label> | ||
<input hcInput placeholder="Enter name"/> | ||
</hc-form-field> | ||
</hc-form-field> | ||
|
||
<hc-pop #helpPop> | ||
<strong>Helpful Context</strong> | ||
<p>Some <strong>helpful context</strong> that the user might need to know.</p> | ||
<button hc-button>Thanks for the help!</button> | ||
</hc-pop> | ||
</code></pre> | ||
</hc-tile> | ||
|
||
<hc-tile> | ||
<h5 id="intro">Other Options for Help Text</h5> | ||
<h3>HTML <code>title</code> attributes:</h3> | ||
<p>Use these for less intrusive hover tooltips. They're great for quick, | ||
one-line explanations — "hover to discover" style. If the user hesitates on a button you can explain to them in another | ||
way the ramifications of clicking that button. You should almost always include these on clickable elements by default | ||
if you're not already using an <code>hcTooltip</code>. | ||
</p> | ||
<div id="titleAttributeExample"></div> | ||
|
||
<h3>On-Screen Help</h3> | ||
<p>For cases where the guidance is critical for success, and isn't easily learnable in any other way, | ||
it's good to just include the helpful instructions there in place. Be sure to keep it as quick and concise as possible. | ||
</p> | ||
<div id="inContextHelp"></div> | ||
</hc-tile> | ||
</div> |
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
import {Component} from '@angular/core'; | ||
import {SectionService} from 'src/app/shared/section.service'; | ||
import {BaseDemoComponent} from '../../shared/base-demo.component'; | ||
|
||
@Component({ | ||
selector: 'hc-info-icons-demo', | ||
templateUrl: './info-icons-demo.component.html', | ||
styleUrls: ['./info-icons-demo.component.scss'] | ||
}) | ||
export class InfoIconsDemoComponent extends BaseDemoComponent { | ||
constructor(sectionService: SectionService) { | ||
super(sectionService); | ||
} | ||
} |
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