feat(tooltip): add TooltipFooter component

This commit is contained in:
Eric Y Liu 2021-04-01 15:31:56 -07:00
commit 3718f3e867
9 changed files with 98 additions and 8 deletions

View file

@ -1,5 +1,5 @@
{
"total": 166,
"total": 167,
"components": [
{
"moduleName": "Accordion",
@ -11202,6 +11202,25 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
{
"moduleName": "TooltipFooter",
"filePath": "src/Tooltip/TooltipFooter.svelte",
"props": [
{
"name": "selectorPrimaryFocus",
"kind": "let",
"description": "Specify a selector to be focused inside the footer when opening the tooltip",
"type": "string",
"value": "\"a[href], button:not([disabled])\"",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [],
"typedefs": []
},
{
"moduleName": "TooltipIcon",
"filePath": "src/TooltipIcon/TooltipIcon.svelte",

View file

@ -1,5 +1,5 @@
<script>
import { Tooltip, Link, Button } from "carbon-components-svelte";
import { Tooltip, TooltipFooter, Link, Button } from "carbon-components-svelte";
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
import Preview from "../../components/Preview.svelte";
</script>
@ -45,10 +45,10 @@ By default, the tooltip is triggered by an information icon.
<p>
Resources are provisioned based on your account's organization.
</p>
<div class="bx--tooltip__footer">
<TooltipFooter selectorPrimaryFocus="#d">
<Link href="/">Learn more</Link>
<Button size="small">Manage</Button>
</div>
<Button id="d" size="small">Manage</Button>
</TooltipFooter>
</Tooltip>
### Custom icon (component)