-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web-twig): Introduction Tooltip stories
- Loading branch information
1 parent
f8daf72
commit 64037cb
Showing
6 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/web-twig/src/Resources/components/Tooltip/Tooltip.stories.twig
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,17 @@ | ||
{% extends 'layout/default.html.twig' %} | ||
|
||
{% block content %} | ||
|
||
{# Tooltip Default #} | ||
{% include '@components/Tooltip/stories/Tooltip.twig' %} | ||
|
||
{# Tooltip Placements #} | ||
{% include '@components/Tooltip/stories/TooltipPlacements.twig' %} | ||
|
||
{# Tooltip Clickable #} | ||
{% include '@components/Tooltip/stories/TooltipClickable.twig' %} | ||
|
||
{# Tooltip Dismissible #} | ||
{% include '@components/Tooltip/stories/TooltipDismissible.twig' %} | ||
|
||
{% endblock %} |
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
16 changes: 16 additions & 0 deletions
16
packages/web-twig/src/Resources/components/Tooltip/stories/Tooltip.twig
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,16 @@ | ||
<section class="docs-Section"> | ||
|
||
<h2 class="docs-Heading">Static Tooltip (No Interaction)</h2> | ||
|
||
<TooltipWrapper style="max-width: 15rem; margin: 6rem auto;"> | ||
<div class="docs-Box px-600 py-500"> | ||
Tooltips<br /> | ||
all day long… | ||
</div> | ||
<Tooltip placement="top">Hello there!</Tooltip> | ||
<Tooltip placement="right">Hello there!</Tooltip> | ||
<Tooltip placement="bottom">Hello there! There is slightly more text in this tooltip.</Tooltip> | ||
<Tooltip placement="left">Hello there!</Tooltip> | ||
</TooltipWrapper> | ||
|
||
</section> |
24 changes: 24 additions & 0 deletions
24
packages/web-twig/src/Resources/components/Tooltip/stories/TooltipClickable.twig
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,24 @@ | ||
<section class="docs-Section"> | ||
|
||
<h2 class="docs-Heading">Tooltip on Click (JavaScript)</h2> | ||
|
||
<div class="mb-800"> | ||
<Button | ||
id="tooltip-trigger" | ||
class="mb-800" | ||
data-target="#my-js-controlled-tooltip" | ||
data-toggle="tooltip" | ||
> | ||
Toggle tooltip | ||
</Button> | ||
</div> | ||
<TooltipWrapper class="d-inline-block"> | ||
<div class="docs-Box px-600 py-500" aria-describedby="my-js-controlled-tooltip"> | ||
I have an externally-triggered tooltip | ||
</div> | ||
<Tooltip id="my-js-controlled-tooltip" class="is-hidden"> | ||
Hello there! | ||
</Tooltip> | ||
</TooltipWrapper> | ||
|
||
</section> |
12 changes: 12 additions & 0 deletions
12
packages/web-twig/src/Resources/components/Tooltip/stories/TooltipDismissible.twig
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,12 @@ | ||
<section class="docs-Section"> | ||
|
||
<h2 class="docs-Heading">Dismissible Tooltip</h2> | ||
|
||
<TooltipWrapper class="d-inline-block"> | ||
<Button aria-describedby="my-dismissible-tooltip">I have a tooltip 😎</Button> | ||
<Tooltip id="my-dismissible-tooltip" placement="right" isDismissible> | ||
Close me | ||
</Tooltip> | ||
</TooltipWrapper> | ||
|
||
</section> |
38 changes: 38 additions & 0 deletions
38
packages/web-twig/src/Resources/components/Tooltip/stories/TooltipPlacements.twig
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,38 @@ | ||
<section class="docs-Section"> | ||
|
||
<h2 class="docs-Heading">Tooltip on Hover (Pure CSS)</h2> | ||
|
||
<TooltipWrapper class="d-inline-block"> | ||
<ButtonLink href="#" aria-describedby="my-tooltip-hover-top" class="TooltipTarget"> | ||
Tooltip on top | ||
</ButtonLink> | ||
<Tooltip id="my-tooltip-hover-top" placement="top"> | ||
Hello there! | ||
</Tooltip> | ||
</TooltipWrapper> | ||
<TooltipWrapper class="d-inline-block"> | ||
<ButtonLink href="#" aria-describedby="my-tooltip-hover-right" class="TooltipTarget"> | ||
Tooltip on right | ||
</ButtonLink> | ||
<Tooltip id="my-tooltip-hover-right" placement="right"> | ||
Hello there! | ||
</Tooltip> | ||
</TooltipWrapper> | ||
<TooltipWrapper class="d-inline-block"> | ||
<ButtonLink href="#" aria-describedby="my-tooltip-hover-bottom" class="TooltipTarget"> | ||
Tooltip on bottom | ||
</ButtonLink> | ||
<Tooltip id="my-tooltip-hover-bottom" placement="bottom"> | ||
Hello there! | ||
</Tooltip> | ||
</TooltipWrapper> | ||
<TooltipWrapper class="d-inline-block"> | ||
<ButtonLink href="#" aria-describedby="my-tooltip-hover-left" class="TooltipTarget"> | ||
Tooltip on left | ||
</ButtonLink> | ||
<Tooltip id="my-tooltip-hover-left" placement="left"> | ||
Hello there! | ||
</Tooltip> | ||
</TooltipWrapper> | ||
|
||
</section> |